Error during installation of pycuda from pip. Getting error while building wheel for pycuda

Hi,

I am new to Jetson orin nano. Installed cuda 12.5 and trying to install pycuda. Getting the below error when the pip trying to build the wheel for pycuda. Tried all the steps mentioned in the other threads and nothing worked. Any inputs or suggestions would be really helpful as I got stuck here for long time.

ntrol reaches end of non-void function [-Wreturn-type]
379 | }
| ^
aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -I/tmp/pip-build-env-9qsu0g4u/overlay/local/lib/python3.10/dist-packages/numpy/core/include -I/usr/include/python3.10 -c src/cpp/bitlog.cpp -o build/temp.linux-aarch64-cpython-310/src/cpp/bitlog.o
aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -I/tmp/pip-build-env-9qsu0g4u/overlay/local/lib/python3.10/dist-packages/numpy/core/include -I/usr/include/python3.10 -c src/cpp/cuda.cpp -o build/temp.linux-aarch64-cpython-310/src/cpp/cuda.o
In file included from src/cpp/cuda.cpp:4:
src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory
14 | include <cuda.h>
| ^~~~~~~~
compilation terminated.
error: command ‘/usr/bin/aarch64-linux-gnu-gcc’ failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycuda
Failed to build pycuda
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pycuda)

Hi,

Have you set up the CUDA path first?

Edit ~/.bashrc by adding below two lines:

export PATH=/usr/local/[CUDA ver]/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/[CUDA ver]/lib64:$LD_LIBRARY_PATH
$ source ~/.bashrc

If the above command doesn’t help, please also update the CPATH.

export CPATH=$CPATH:/usr/local/[CUDA ver]/include

Thanks.

1 Like

@AastaLLL
It worked after updating CPATH command. Thank you so much.

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