Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv::resize function costs 143M GPU memory in opencv version 3.2.0

Below is my test script:

image description

When the routine went to the first "std::cin.get()", no memory was occupied. But when I input something and went to the second "std::cin.get()", something strange happened. Bolow is the nvidia-smi result.

image description

As we can see, 143M GPU memory has been occupied.

System Info:

  1. Ubuntu 16.04
  2. Opencv3.2.0, cmake compile flag WITH_CUDA=OFF
  3. Nvidia GTX1080Ti, CUDA8.0

Anybody could explain what happened and how can I release the memory consumption?

Thanks in advance.

click to hide/show revision 2
None

updated 2017-12-28 06:48:55 -0600

berak gravatar image

cv::resize function costs 143M GPU memory in opencv version 3.2.0

Below is my test script:

image description

When the routine went to the first "std::cin.get()", no memory was occupied. But when I input something and went to the second "std::cin.get()", something strange happened. Bolow is the nvidia-smi result.

image description

As we can see, 143M GPU memory has been occupied.

System Info:

  1. Ubuntu 16.04
  2. Opencv3.2.0, cmake compile flag WITH_CUDA=OFF
  3. Nvidia GTX1080Ti, CUDA8.0

Anybody could explain what happened and how can I release the memory consumption?

Thanks in advance.

cv::resize function costs 143M GPU memory in opencv version 3.2.0

Below is my test script:

image description

When the routine went to the first "std::cin.get()", no memory was occupied. But when I input something and went to the second "std::cin.get()", something strange happened. Bolow is the nvidia-smi result.

image description As we can see, 143M GPU memory has been occupied.

System Info:

  1. Ubuntu 16.04
  2. Opencv3.2.0, cmake compile flag WITH_CUDA=OFF
  3. Nvidia GTX1080Ti, CUDA8.0

Anybody could explain what happened and how can I release the memory consumption?

Thanks in advance.

cv::resize function costs 143M GPU memory in opencv version 3.2.0

Below is my test script:

image description

include <opencv2 core="" core.hpp="">

include <opencv2 imgproc="" imgproc.hpp="">

include <opencv2 highgui="" highgui.hpp="">

//#include <opencv2 imgcodecs="" imgcodecs.hpp="">

include <iostream>

include <string>

int main() { std::string path = "/home/pangwong/TestSpace/test_images/car_test.png"; cv::Mat img = cv::imread(path); for (int i = 0; i < 100000; i++) { std::cin.get(); cv::resize(img, img, cv::Size(144, 144)); std::cout << "aaa" << std::endl; std::cin.get(); } }

When the routine went to the first "std::cin.get()", no memory was occupied. But when I input something and went to the second "std::cin.get()", something strange happened. Bolow is the nvidia-smi result.

image description As we can see, 143M GPU memory has been occupied.

System Info:

  1. Ubuntu 16.04
  2. Opencv3.2.0, cmake compile flag WITH_CUDA=OFF
  3. Nvidia GTX1080Ti, CUDA8.0

Anybody could explain what happened and how can I release the memory consumption?

Thanks in advance.

click to hide/show revision 5
None

updated 2017-12-28 07:15:17 -0600

berak gravatar image

cv::resize function costs 143M GPU memory in opencv version 3.2.0

Below is my test script:

include <opencv2 core="" core.hpp="">

include <opencv2 imgproc="" imgproc.hpp="">

include <opencv2 highgui="" highgui.hpp="">

#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
//#include <opencv2 imgcodecs="" imgcodecs.hpp="">

include <iostream>

include <string>

<opencv2/imgcodecs/imgcodecs.hpp> #include <iostream> #include <string> int main() { std::string path = "/home/pangwong/TestSpace/test_images/car_test.png"; cv::Mat img = cv::imread(path); for (int i = 0; i < 100000; i++) { std::cin.get(); cv::resize(img, img, cv::Size(144, 144)); std::cout << "aaa" << std::endl; std::cin.get(); } }

}

When the routine went to the first "std::cin.get()", no memory was occupied. But when I input something and went to the second "std::cin.get()", something strange happened. Bolow is the nvidia-smi result.

As we can see, 143M GPU memory has been occupied.

System Info:

  1. Ubuntu 16.04
  2. Opencv3.2.0, cmake compile flag WITH_CUDA=OFF
  3. Nvidia GTX1080Ti, CUDA8.0

Anybody could explain what happened and how can I release the memory consumption?

Thanks in advance.