PYCUDA Installation

Hi,

I am facing errors in installing and using PYCUDA for my project.

Below are my environment details-

OS - RHEL LINUX 7.5
CUDA - V9.0.176
CUDNN - v7.3.1.20
TensorRT - 5.1
Python - 2.7 and 3.6

All the above software are already installed.
I am following below link to install PYCUDA -

https://wiki.tiker.net/PyCuda/Installation/Linux

while following the steps on this link, I was facing problems in step 2 of the installation process. After making some fixes and escaping step 2 , we directly ran step 3.
The “make” file ran successfully and it looked like PYCUDA is installed. But when we import pycuda with below command-
import pycuda.autoinit
it throws below error-

import pycuda.autoinit
Traceback (most recent call last):
File “”, line 1, in
File “pycuda/autoinit.py”, line 2, in
import pycuda.driver as cuda
File “pycuda/driver.py”, line 5, in
from pycuda._driver import * # noqa
ImportError: No module named _driver

Please have a look and suggest.

Thanks,
Ark

Hi,

I understand that this doesn’t answer your question but may I know if there’s any specific reason you’re not using pip or conda to install pycuda?

Please try this:

If you try to import any of the pycuda files while you are in the directory that you extracted the pycuda tar.gz file then, it will fail with the above error.

Try running the python shell in another directory and then importing pycuda.