What is the minimum version of OpenCL required for OpenCV dnn module.

asked 2018-06-28 02:53:04 -0500

Akhilesh gravatar image

updated 2018-06-28 02:55:37 -0500

I need dnn model of OpenCV. I came to know that it uses OpenCL for acceleration. I tried to find the reference or document to know the required minimum version of OpenCL to run DNN module, but I didn't find any.

If anybody know, please help me. Anyway, I have GPU with OpenCL 1.1 EP. I want to know whether I can dnn module on it.

Any help would be greatly appreciated.

edit retag flag offensive close merge delete



When you are using open cv > 3.x, open cl will be used when possible. This includes the dnn implementation.

However, according to these performance measurements https://github.com/opencv/opencv/wiki... It can be that without open cl you are faster. But test by yourself.

Also compare to the native implementation with / without cuda. Yes - a lot of work, but after painful experiences and wasting time, i can give you the advice not to skip it.

holger gravatar imageholger ( 2018-06-28 04:02:47 -0500 )edit

@holger, using GPU instead CPU for such complicated algorithms as deep learning networks should be deterministic. So at first we need to compile OpenCV with OpenCL support by cmake option -DWITH_OPENCL=ON then enable OpenCL backend for a specific network by setPreferableTarget(DNN_TARGET_OPENCL)

dkurt gravatar imagedkurt ( 2018-06-28 04:43:33 -0500 )edit

Ok well then i need to take back what i wrote(please ignore) comment - sorry for the confusion. To use open cl for dnn evaluation you need to:

  1. Compile open cv with open cl support
  2. Enable it in your program via setPreferableTarget(DNN_TARGET_OPENCL)

I will do this too and do another round of performance measurement. I voted for your comment. Sometimes i am really stupid. Thank you Kurt again! Should i delete my comment from above?

holger gravatar imageholger ( 2018-06-28 04:57:50 -0500 )edit

@Akhilesh Stick to the comment of Dkurt

holger gravatar imageholger ( 2018-06-28 05:11:16 -0500 )edit