How to stop using GPU in OpenCV 3.2? [closed]

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

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 reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-09-26 15:21:47.908909

Comments

How can you know that's GPU is used?

LBerger gravatar imageLBerger ( 2017-01-18 13:46:49 -0600 )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 -0600 )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 -0600 )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 -0600 )edit

you can make an issue

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

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

caruofc gravatar imagecaruofc ( 2017-01-18 14:58:13 -0600 )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 -0600 )edit