How to stop using GPU in OpenCV 3.2?

asked 2017-01-18 10:37:51 -0500

caruofc gravatar image

I set cv::ocl::setUseOpenCL(false); and verified using useOpenCL(). But my code is still using GPU when I use UMat. How can I stop using GPU? Temporarily I am using a workaround that uses Mat instead of UMat.

Anybody else is facing the same issue?

edit retag flag offensive close merge delete

Comments

How can you know that's GPU is used?

LBerger gravatar imageLBerger ( 2017-01-18 13:46:49 -0500 )edit
1

Somehow I knew this question would be asked :). I used TechPowerUp GPU-Z tool to figure that out.

caruofc gravatar imagecaruofc ( 2017-01-18 13:49:55 -0500 )edit
1

Ok Now I think cv::ocl::setUseOpenCL(false) disable opencl call and not opencl storage. When UMat is used I think data are stored in GPU even when setUseOpenCL(false) is called. I have checked in debug mode. Now how to disable this ?

You can check speed using this source files

LBerger gravatar imageLBerger ( 2017-01-18 14:27:29 -0500 )edit

Thanks LBerger for confirming, So I am not the only one who sees the issue and therefore, my question stands.

caruofc gravatar imagecaruofc ( 2017-01-18 14:37:56 -0500 )edit

you can make an issue

LBerger gravatar imageLBerger ( 2017-01-18 14:39:50 -0500 )edit
2

https://github.com/opencv/opencv/issues/8035 (Created). thnx

caruofc gravatar imagecaruofc ( 2017-01-18 14:58:13 -0500 )edit
1

Found the solution: You have to call cv::ocl::setUseOpenCL(false); in every thread that uses UMat.

caruofc gravatar imagecaruofc ( 2017-01-25 17:06:22 -0500 )edit