Failed to load OpenCL runtime - OpenCV3 Python

2019-03-05 02:01发布

I have a program that processes videos using foreground detection in OpenCV 2.4.9/python/on windows and packaged for a windows executable using py2exe. I recently updated opencv to opencv3 and repackaged my program. When i run on my computer (with opencv3 installed locally) everything goes fine.

However, when a user goes and downloads the program and runs it on another computer, they get the warning

Failed to load OpenCL runtime

This just seems to be just a warning, and i can detect no performance issues.

I have a couple options. I can just suppress this specific warning in a try statement, or i can somehow turn off the OpenCL on my computer for packaging the program. Suggestions on either strategy would be appreciated. Anything i am overlooking? To my understanding the OpenCL library is for acceleration using GPU.

Thanks,

3条回答
叛逆
2楼-- · 2019-03-05 02:24

the solution will be compiling the OpenCV libs without OpenCL and then link them to your application

查看更多
爷、活的狠高调
3楼-- · 2019-03-05 02:28

If you just don't need to use OpenCL, you can set the environment var as below:

export OPENCV_OPENCL_RUNTIME=999

Sometimes, if you want to turn on the opencl:

export OPENCV_OPENCL_RUNTIME=
查看更多
Juvenile、少年°
4楼-- · 2019-03-05 02:33

I had encounter the same problem, here's my solution:

  1. go to the Intel website and download the OpenCL library, then unzip it

  2. run the install.sh file

If your install fails because of update-alternatives errors, maybe it's because you are using Ubuntu/Debian distro and the Intel install package has a wrong setting with it.

To solve this, xfanzone did a very good job on this. Take a look here.

  1. download the patch zip file and patch your OpenCL package

  2. install it again, now it should work fine

查看更多
登录 后发表回答