Failed to load OpenCL runtime - OpenCV3 Python

人盡茶涼 提交于 2019-12-02 21:57:42

问题


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,


回答1:


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




回答2:


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




回答3:


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=


来源:https://stackoverflow.com/questions/25723059/failed-to-load-opencl-runtime-opencv3-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!