Using OpenCL backend for dnn module of openCV 4.6.0

Viewed 48

I'm trying to run openCV's dnn module in c++ I'm getting an error i've seen a number of time around but never found a proper answer so far

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 Error in processing command line: Don't understand command line argument "-cl-no-subgroup-ifp"!

I'm on windows, using openCV 4.6.0 that i compiled myself with the OpenCL flag turned on. Code runs fine when using the CPU target but throws the previous mentioned block when switching from DNN_TARGET_CPU to DNN_TARGET_OPENCL. It doesn't crash but from what i can see it doesn't use the GPU and runs even slower than with the CPU option.

I was able to create and use a python version of the same code without any hitch (opencv-python 4.6.0 / same model / usecase) and it used my GPU just fine so it must be some configuration that is wrong on the c++ side.

May anyone have an idea ? Thanks

1 Answers

So after some testing on different hardware it appears that the OpenCL implementation only works with integrated graphic chips. Tested on two different machine and it worked with their integrated GPUs, tested on other hardware (Nvidia and AMD graphic cards) and it doesn't work. I assume we have to wait for better support to come around, especially for AMD cards where the CUDA backend isn't an option.

Related