cudagpupycuda

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


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!

Solution

  • You probably need to specify path to CUDA:

    export C_INCLUDE_PATH=${CUDA_HOME}/include:${C_INCLUDE_PATH}
    export LIBRARY_PATH=${CUDA_HOME}/lib64:$LIBRARY_PATH
    

    Please make sure that echo ${CUDA_HOME} does provide some sensible output.