0
votes

My laptop has two graphics cards, Intel HD Graphics 530 and Nvidia Geforce GTX 965M. When I was using opencv3 with opencl, it automatically chose Intel. For faster speed, I want to use Nvidia instead. I tried adding

OPENCV_OPENCL_DEVICE = NVIDIA:GPU:GTX 965M

to environment variables, but it didn't work.
Environments:
Windows 10, OpenCV 3.4.5, Cuda 9.2, Visual Studio 2017

1
People here are so allergic to "it didn't work" that you might be asked to clarify - even though in this case it seems quite obvious what you mean. - Yunnosch
Try shorter case: OPENCV_OPENCL_DEVICE = NVIDIA:GPU: - Nuzhny
Thanks buddies, after referring to answers.opencv.org/question/108646/… and rebooting, I got this problem solved. Thanks for your advice! - user11183150

1 Answers

0
votes

For driver version 302 or higher (which should be available on most systems, since the current version is >400) you have to export the global variable NvOptimusEnablement.

extern "C" {
    _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}

Source: This driver technical notes from NVIDIA (page 3)