简体   繁体   中英

Failed to load OpenCL runtime - OpenCV3 Python

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,

该解决方案将在不使用OpenCL的情况下编译OpenCV库,然后将它们链接到您的应用程序

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

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=

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM