Installing PyCUDA on Jetson TX2

I am following these instructions:

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
nvidia@tegra-ubuntu:~/Downloads/pycuda-2017.1.1$ python --cuda-root=/usr/local/cuda-8.0

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 
Traceback (most recent call last):
  File "", 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 does seem to work.

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

I have flash my Tx2 with jetpack4.2. when I use pip3 to install pycuda that have a 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?


Could you try if you can install pyCUDA with the steps shared in this comment?–dtx2ifferent-/post/5167500/#5167500


Installing pycuda


Download latest pycuda

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

to find cuda on your system


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

Mine was


for python2

python --cuda-root=/usr/local/cuda-10.0

for python3

python3 --cuda-root=/usr/local/cuda-10.0

Ignore nvcc error

sudo make install

Testing the installtion inside test directory using python/python3 using


I get this

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

-- Docs:
============================================== 23 failed, 6 passed, 1 warnings in 25.77 seconds ==============================================

I have raised this issue on github, if anyone has better method to install pycuda do share