Unable to load pyopencl python dll file even with latest drivers

I installed the latest version of CUDA and the driver for my GPU. I am using Python 2.7.10 on Win7 64bit. I tried installing pyopencl from:

a . unofficial Windows binaries at http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl

b . by compiling my own after getting sources from https://pypi.python.org/pypi/pyopencl

The installation was successful in both cases, but I get one error message when I try to import it:

>>> import pyopencl Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\pyopencl-2015.1-py2.7-win-amd64.egg\pyope cl\__init__.py", line 30, in <module> import pyopencl._cl as _cl ImportError: DLL load failed: The specified procedure could not be found. >>> 

I have a Visual C ++ Redistributable for Visual Studio 2015 installed from https://www.microsoft.com/en-us/download/details.aspx?id=48145 .

I also tried with two different versions of the GPU driver (including the latest). Same. Many people seem to get the same error, and on some forums I read that updating GPU drivers to the latest version, it works fine. But not for me.

Does anyone know how to fix this?

+6
source share
3 answers

I had the same problem and found that it was caused by the fact that AMD OpenCL.dll does not have the functionality introduced in OpenCL 2.1. Gohlke has only OpenCL 2.1 and 1.2, and AMD drivers support 2.0.

Since I needed 2.0, an easy fix was to manually replace AMD System32 / OpenCL.dll using the Intel SDK with experimental support for 2.1.

+2
source

I am afraid that there is not a single correct answer to this problem. Each case is different. It depends on what is installed in the OS. To track such issues, I usually use Dependency Walker .

In this particular case, I would open _cl.pyd (usually in C:\Python27\Lib\site-packages\pyopencl ) in the Dependency Walker to check if there are any missing dependencies, or if, for example, OpenCL.dll - actually the one that should be used. OpenCL.dll can be installed by other programs and their path added to PATH . Also, OpenCL.dll in System32 may be too old. In principle, the trial version and the error of renaming all but one OpenCL.dll to OpenCL.dll.bak and / or deleting paths from PATH can lead you there.

+1
source

Try using versions 1.2 and 2.1, which I tried to work with later, and got this problem. Turned on whl and it works, but uses an Intel GPU. NVidia OpenCL.dll 2.0 and it does not work.

Just checked the cl.get_platforms array and found them 0. Intel 1. NVidia

  • pyopencl.Platform Intel (R) OpenCL and pyopencl.Device Intel (R) Core (TM) ... Intel (R) OpenCL
  • pyopencl.Platform NVIDIA CUDA and pyopencl.Device Quadro ... NVIDIA CUDA
0
source

All Articles