Installing PyCUDA on Jetson TX2

I am following these instructions: Installing PyCUDA on Linux - Andreas Klöckner's Former Wiki

Using the standard built in Python where I already have Numpy installed, so directly onto step 3. Here is my cuda library location:

nvidia@tegra-ubuntu:~/Downloads/pycuda-2017.1.1$ echo %LD_LIBRARY_PATH
%LD_LIBRARY_PATH
nvidia@tegra-ubuntu:~/Downloads/pycuda-2017.1.1$ python configure.py --cuda-root=/usr/local/cuda-8.0
nvidia@tegra-ubuntu:~/Downloads/pycuda-2017.1.1$

All good. However su -c “make install” gives me an authentication error, so I do “sudo make install” instead. Seems to build okay, taking several minutes, although at the beginning it gives me a warning that "nvcc is not in path:

***************************************************************
*** WARNING: nvcc not in path.
*** May need to set CUDA_INC_DIR for installation to succeed.
***************************************************************

So I export CUDA_INC_DIR to the location of nvcc (which WAS in the path but anyway).

But then when I try the test, namely Step 4:

nvidia@tegra-ubuntu:~/Downloads/pycuda-2017.1.1/test$ python test_driver.py 
Traceback (most recent call last):
  File "test_driver.py", line 964, in <module>
    from py.test.cmdline import main
ImportError: No module named cmdline

Even though cmdline IS installed. Anybody successfully built pyCuda for TX2 and have it working? The pip install version doesn’t have aarch64 it seems.

Actually ignore. It does seem to be working now even though the test doesn’t work. The tutorial Tutorial - pycuda 2022.1 documentation does seem to work.

I get the same errors as above during pycuda installation. When I run the demo.py, I get error as No module named pycuda.tools. Am I missing a step?

I have flash my Tx2 with jetpack4.2. when I use pip3 to install pycuda that have a error.as follows:

In file included from src/cpp/cuda.cpp:1:0:
    src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory
     #include <cuda.h>
              ^~~~~~~~
    compilation terminated.
    error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

what should i do?
Thanks

Hi,

Could you try if you can install pyCUDA with the steps shared in this comment?
[url]https://devtalk.nvidia.com/default/topic/1013387/jetson-tx2/is-the-memory-management-method-of-tx1-and--dtx2ifferent-/post/5167500/#5167500[/url]

Thanks.

Installing pycuda

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

Download latest pycuda
https://pypi.org/project/pycuda/#files

cd pycuda-VERSION
python configure.py --cuda-root=/where/ever/you/installed/cuda

to find cuda on your system

use

find / -type d -name cuda 2>/dev/null

Mine was

/usr/local/cuda-10.0

Run
for python2

python configure.py --cuda-root=/usr/local/cuda-10.0

for python3

python3 configure.py --cuda-root=/usr/local/cuda-10.0

Ignore nvcc error

sudo make install

Testing the installtion inside test directory using python/python3 using

python3 test_driver.py

I get this

============================================================== warnings summary ==============================================================
/home/rlpl123/.virtualenvs/test_tensorrt/lib/python3.6/site-packages/_pytest/mark/structures.py:337
/home/rlpl123/.virtualenvs/test_tensorrt/lib/python3.6/site-packages/_pytest/mark/structures.py:337: PytestUnknownMarkWarning: Unknown pytest.mark.cuda - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
============================================== 23 failed, 6 passed, 1 warnings in 25.77 seconds ==============================================

I have raised this issue on github https://github.com/inducer/pycuda/issues/208, if anyone has better method to install pycuda do share