Fail to install pycuda

I want to install pycuda but get failed. My jetpack is 5.1.3. The cuda version is 11.4. I already added path:

export PATH=/usr/local/cuda-11.4/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64/{LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

I tried to install pycuda via the source codes by:

python3 configure.py --cuda-root=/usr/local/cuda-11.4
sudo python3 setup.py install

The results show the following which implies pycuda is installed:

Installed /usr/lib/python3.8/site-packages/pycuda-2024.1-py3.8-linux-aarch64.egg
Processing dependencies for pycuda==2024.1
Searching for Mako==1.1.0
Best match: Mako 1.1.0
Adding Mako 1.1.0 to easy-install.pth file
Installing mako-render script to /usr/bin

Using /usr/lib/python3/dist-packages
Searching for appdirs==1.4.4
Best match: appdirs 1.4.4
Processing appdirs-1.4.4-py3.8.egg
Adding appdirs 1.4.4 to easy-install.pth file

Using /usr/lib/python3.8/site-packages/appdirs-1.4.4-py3.8.egg
Searching for pytools==2024.1.1
Best match: pytools 2024.1.1
Processing pytools-2024.1.1-py3.8.egg
Adding pytools 2024.1.1 to easy-install.pth file

Using /usr/lib/python3.8/site-packages/pytools-2024.1.1-py3.8.egg
Searching for typing-extensions==4.10.0
Best match: typing-extensions 4.10.0
Adding typing-extensions 4.10.0 to easy-install.pth file

Using /usr/local/lib/python3.8/dist-packages
Searching for platformdirs==4.2.0
Best match: platformdirs 4.2.0
Processing platformdirs-4.2.0-py3.8.egg
Adding platformdirs 4.2.0 to easy-install.pth file

Using /usr/lib/python3.8/site-packages/platformdirs-4.2.0-py3.8.egg
Finished processing dependencies for pycuda==2024.1

But if I cd to test folder and run the test_driver.py, the shell tells

Traceback (most recent call last):
  File "test_driver.py", line 8, in <module>
    from pycuda.tools import mark_cuda_test, dtype_to_ctype
ModuleNotFoundError: No module named 'pycuda'

and I can’t find pycuda in pip list. Can you help me fix this?

Hi,

Sorry for the late update.
Could you try to add the folder to PYTHONPATH and try it again?

For example:

$ echo 'export PYTHONPATH=/usr/lib/python3.8/site-packages/:$PYTHONPATH' >> ~/.bashrc
$ source ~/.bashrc

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.