2

On Windows 10, I want to use GPU as DNN backend to save CPU power. It works for Intel GPU, but there is problem on AMD GPU.

After I use setPreferableTarget(DNN_TARGET_OPENCL), the speed become very slow (much slower than DNN_TARGET_CPU). I checked with task manager and saw all calculation is on CPU actually.

The following is some log.

[ INFO:0] global D:\work\opencv\opencv\modules\core\src\ocl.cpp (891)
cv::ocl::haveOpenCL Initialize OpenCL runtime...

OpenCV(ocl4dnn): consider to specify kernel configuration cache
directory via OPENCV_OCL4DNN_CONFIG_PATH parameter.

[ INFO:0] global D:\work\opencv\opencv\modules\core\src\ocl.cpp (433)
cv::ocl::OpenCLBinaryCacheConfigurator::OpenCLBinaryCacheConfigurator
Successfully initialized OpenCL cache directory:
C:\Users\wangq\AppData\Local\Temp\opencv\4.3\opencl_cache\

[ INFO:0] global D:\work\opencv\opencv\modules\core\src\ocl.cpp (457)
cv::ocl::OpenCLBinaryCacheConfigurator::prepareCacheDirectoryForContext
Preparing OpenCL cache configuration for context:
Advanced_Micro_Devices__Inc_--Baffin--2906_10

OpenCL program build log: dnn/dummy

Status -66: CL_INVALID_COMPILER_OPTIONS

-cl-no-subgroup-ifp -D AMD_DEVICE

Any help would be appreciated.

rizerphe
  • 1,340
  • 1
  • 14
  • 24
Jimmy
  • 21
  • 3
  • Welcome to Stack Overflow! Please format your code properly, [click here to learn how](https://stackoverflow.com/help/formatting). – rizerphe Jun 25 '20 at 04:57
  • 1
    not sure whether this is up to date, but according to this blog, opencv opencl backend only supported intel gpus: "We set the DNN backend to OpenCV here and the target to CPU. You could try setting the preferable target to cv.dnn.DNN_TARGET_OPENCL to run it on a GPU. But keep in mind that the current OpenCV version is tested only with Intel’s GPUs, it would automatically switch to CPU, if you do not have an Intel GPU." https://www.learnopencv.com/deep-learning-based-object-detection-using-yolov3-with-opencv-python-c/ – Micka Dec 17 '20 at 20:33
  • Looks like it is the fact. – Jimmy Dec 19 '20 at 02:16

0 Answers0