Ask Your Question
1

Running DNN on GPU (Problems with OpenCL and Halide)

asked 2018-08-08 09:06:28 -0600

Mary-Ann gravatar image

Hi,

I am running a Caffe based network, called DetectNet (https://devblogs.nvidia.com/detectnet...), using the Python-OpenCV dnn module. It has one special layer which I needed to register manually.

Now I would like to improve the performance, and switch to the GPU. I have already done some research and found these threads: https://github.com/opencv/opencv_cont... and http://answers.opencv.org/question/18... .

So I tried to use OpenCL and Halide. But apparently OpenCL is not supported on my machine (I am using NVidia), since I get this warning: [ WARN:0] DNN: OpenCL target is not supported with current OpenCL device (tested with Intel GPUs only), switching to CPU.

In case of Halide, I get an error: (-215:Assertion failed) haveHalide() in function 'wrapMat' The problem is the additional non-Caffe layer. If I delete this layer, no error occurs, and the application speeds up a bit (even though it is still pretty slow, and I actually need even higher performance). Unfortunately, the deleted layer sums up the calculations and produces the output of the network, so I can not simply delete it.

So my question is, if/how it is possible to run DetectNet with the Halide Interface. In the second thread it was mentioned, that a general GPU support is planned for the future. Are there any information available, when this feature could be possibly released?

Thank you for any answers!

Mary-Ann

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2018-11-21 01:09:12 -0600

Try setting the environment variable OPENCV_DNN_OPENCL_ALLOW_ALL_DEVICES=1 E.g. on linux shell: OPENCV_DNN_OPENCL_ALLOW_ALL_DEVICES=1 ./your_program

edit flag offensive delete link more
0

answered 2018-08-29 01:52:08 -0600

tyzeroy gravatar image

@Mary-Ann, my opencv version is 3.4.2 and I got the same waring "[ WARN:0] DNN: OpenCL target is not supported with current OpenCL device (tested with Intel GPUs only), switching to CPU." After googling, i found the reason. https://github.com/opencv/opencv/pull... https://github.com/opencv/opencv/pull... because of those issues, it seems to force switching CPU if GPU is not Intel and the InteGPU is only supported now.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-08 09:06:28 -0600

Seen: 5,482 times

Last updated: Aug 08 '18