Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV dnn, OpenCL and Nvidia graphic cards

I am a newbie to OpenCV. I have a vague question regarding the combination of dnn, OpenCL and Nvidia graphic cards. I have written a program using dnn darknet for YOLO object detection. Without setting any special flags, I simply do net = dnn::readNetFromDarknet(xxx) and do predictions which works fine using the CPU

I have a GeForce GTX 1070 and now I want to use it to optimize the detection time. But when I try to set DNN_TARGET_OPENCL for my net, it says

OpenCV(ocl4dnn): consider to specify kernel configuration cache directory 
                 via OPENCV_OCL4DNN_CONFIG_PATH parameter.
OpenCL program build log: dnn/dummy
Status -11: CL_BUILD_PROGRAM_FAILURE
-cl-no-subgroup-ifp

And it takes the same amount of time to process an image so I'm guessing OpenCL is not being used.

I am using OpenCV 4.1.1 compiled with WITH_CUDA=ON. I have cuDNN set up as well.

  1. What is the connection between OpenCL and dnn?

  2. How do I get my YOLO to use the graphic card and speed up the process?