5

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.

wovano
  • 4,543
  • 5
  • 22
  • 49
iDom
  • 115
  • 1
  • 7

1 Answers1

8

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.

Panos Kalatzantonakis
  • 12,525
  • 8
  • 64
  • 85
talonmies
  • 70,661
  • 34
  • 192
  • 269
  • Big Thx! I find reason of this problem. I build pycuda in MinGW and recive exception message. In pycuda sources exist one error in path to CUDA toolkit. I can't take incorrect file and line of code at this moment. I can describe this bug later if you are intrested. – iDom Jan 29 '13 at 18:17
  • @iDom: I don't think you can use MinGW with CUDA or PyCUDA - the CUDA libraries require the Microsoft C++ runtime and won't work with any other toolchain on Windows AFAIK. – talonmies Jan 29 '13 at 18:22
  • I understand it, I use MinGW for build pyCUDA, but CUDA sources compiled by Microsoft Visual C++ (MSVS2010). – iDom Jan 30 '13 at 20:02
  • MingW and MSVC Dll's can interoperate - http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs with the right name mangling. – whatnick Oct 09 '13 at 03:50
  • 3
    The _driver.dll may be called _driver.pyd in your install, if this is the case rename it to .dll and use depwalker to check dependencies. – whatnick Oct 09 '13 at 03:56