Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory

Tags:

cuda

gpu

pycuda

when I install pycuda by this instruction:

pip install pycuda

but there is an error:

src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory

but I have installed the cuda toolkit.this is the result of nvcc -V

[root@localhost include]# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:07:04_CDT_2018
Cuda compilation tools, release 9.2, V9.2.148

this is the result of install rpm downloaded in https://developer.nvidia.com/cuda-downloads

[root@localhost include]# sudo dnf install cuda
Last metadata expiration check: 0:05:09 ago on Wed 05 Sep 2018 10:08:35 PM EDT.
Package cuda-1:9.2.148.1-2.fc28.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
like image 906
kaikai_sk Avatar asked Sep 06 '18 02:09

kaikai_sk


People also ask

How do I install Cuda H?

You can install it by typing: sudo apt install nvidia-cuda-toolkit. You'll need to add the CUDA bin directory to your PATH environment variable. These instructions are contained in the install guide I linked.

How do I download Cuda?

The NVIDIA CUDA Toolkit is available at https://developer.nvidia.com/cuda-downloads. Choose the platform you are using and one of the following installer formats: Network Installer: A minimal installer which later downloads packages required for installation.


2 Answers

In my case I met both issues:

-lcurand not found

and

src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory

And exporting C_INCLUDE_PATH didn't helped me. Instead I needed to export general version of C_INCLUDE_PATH -- CPATH:

export CPATH=$CPATH:/usr/local/cuda/include
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64
like image 141
Ivan Talalaev Avatar answered Oct 17 '22 06:10

Ivan Talalaev


This is how I solved the problem on Jetson NANO:

sudo pip3 install --global-option=build_ext --global-option="-I/usr/local/cuda-10.0/targets/aarch64-linux/include/" --global-option="-L/usr/local/cuda-10.0/targets/aarch64-linux/lib/" pycuda
like image 45
Stepan Yakovenko Avatar answered Oct 17 '22 05:10

Stepan Yakovenko