I am trying to install pycuda in computer with Windows 10 64bits, I installed the GPU Toolkit 9.1 and Anaconda 4.2 with python 3.5 64bits. I installed pycuda using the precompiled package:
pycuda‑2017.1.1+cuda9185‑cp35‑cp35m‑win_amd64.whl
The installation in my Anaconda installation didn't mark any error, but when I try to run a simple example I have problems with the import:
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycuda.driver as cuda
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
ImportError: numpy.core.multiarray failed to import
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Anaconda3\lib\site-packages\pycuda\driver.py", line 5, in <module>
from pycuda._driver import * # noqa
SystemError: <class 'ImportError'> returned a result with an error set
Any idea??
UPDATE:
I resolve my first problem adding the lib directory of the cuda library to my path:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib
But now I have this error:
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycuda.driver as cuda
>>> import pycuda.autoinit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Anaconda3\lib\site-packages\pycuda\autoinit.py", line 5, in <module>
cuda.init()
pycuda._driver.Error: cuInit failed: unknown error
SOLVED
I try installing Cudatoolkit 9.2, plus adding the
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\lib
to path, update my nvidia driver, and install the pycuda pycuda‑2018.1+cuda92148‑cp35‑cp35m‑win_amd64.whl
Now my cuda codes function correctly.