pycuda ImportError in pycuda.driver

北慕城南 提交于 2020-01-03 12:35:31

问题


I'm trying to compile some sources for working with my GPU. I use pycuda for this. When I compile source code, I receive some errors from Python:

C:\Users\Dmitriy\wcm>python ws_gpu.py test.dcm
Traceback (most recent call last):
  File "ws_gpu.py", line 2, in <module>
    import pycuda.gpuarray as gpu
  File "C:\Python27\lib\site-packages\pycuda\gpuarray.py", line 3, in <module>
    import pycuda.elementwise as elementwise
  File "C:\Python27\lib\site-packages\pycuda\elementwise.py", line 33, in <module>
    from pycuda.tools import context_dependent_memoize
  File "C:\Python27\lib\site-packages\pycuda\tools.py", line 30, in <module>
    import pycuda.driver as cuda
  File "C:\Python27\lib\site-packages\pycuda\driver.py", line 2, in <module>
    from pycuda._driver import *
ImportError: DLL load failed: ═х эрщфхэ єърчрээ√щ ьюфєы№.

Has anyone encountered a similar problem? How can I solve this? I use Windows 7 64-bit, last driver for my GPU (NVIDIA GT520M) and CUDA Toolkit v.5.0.


回答1:


This sort of error is almost always because of a broken PyCUDA installation. There is a library file called _driver.dll which provides bindings to the CUDA driver API. The error message is coming because that dll can either not be found or the libraries it depends on (ie. CUDA) can't be loaded. I can't say more because I can't read the cryllic error text you posted.

One way of diagnosing this sort of problem is to try the following in an interactive python shell:

import pycuda
pycuda.__file__

The second command will tell you where the root path for the active PyCUDA installation is (taken from a mailing list post). Searching in that path will find you the locate of the _driver.dll and running a dependency diagnostic tool on the dll file will show what can or cannot be found. If that doesn't work I recommend taking your question to the PyCUDA mailing list.



来源:https://stackoverflow.com/questions/14487761/pycuda-importerror-in-pycuda-driver

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