cffi load failure when trying to import PyOpenCL

2019-05-31 18:07发布

问题:

Here's the error that I get when I try to import pyopencl:

Traceback (most recent call last):
    File "PyOpenCLTest.py", line 6, in <module>
        import pyopencl as cl
    File "C:\Python36\lib\site-packages\pyopencl\__init__.py", line 37, in <module>
        import pyopencl.cffi_cl as _cl
    File "C:\Python36\lib\site-packages\pyopencl\cffi_cl.py", line 39, in <module>
        from pyopencl._cffi import ffi as _ffi
ImportError: DLL load failed: The specified procedure could not be found.

My OS is Windows 7 (64-bit), and I'm currently using Python version 3.6.2.

My current graphics driver (AMD Radeon HD 7800) has the following specs:

  • Radeon Settings Version 2017.0720.1902.3246
  • OpenCL Version 22.19.662.4
  • OpenGL version 6.14.10.13491
  • Vulkan Driver Version 1.6.0
  • Vulkan API Version 1.0.51
  • AMD Mantle Version 9.1.10.0220
  • AMD Mantle API Version 102400
  • 2D Driver Version 8.1.1.1614
  • Direct3D Version 9.14.10.01292

I have tried to import PyOpenCL after trying out a few different things:

  • Repairing Visual Studio 2015
  • Updating AMD driver
  • Updating Intel driver (already up to date according to Intel Driver Update Utility)
  • Getting Intel OpenCL SDK (Not sure if it's even being used)
  • Installing PyOpenCL via easy_install
  • Installing PyOpenCL via this wheel file
  • Installing cffi via easy_install
  • Installing cffi via this wheel file

In addition, I'm having trouble running a cffi example from the cffi overview page (I get a CompileError), but that is its own can of worms.