cc1plus: fatal error: cuda_runtime.h: No such file or directory compilation terminated

I have got into a problem when I tried nvcc command, as following:

(base) wayne@amax:~$ nvcc build/test.cu
cc1plus: fatal error: cuda_runtime.h: No such file or directory
compilation terminated.

I know this is a frequent asked question, but I have tried many available solutions and neither of them solved my problem.

Giving more details (solutions I have tried):

(base) wayne@amax:~$ sudo ln -s /usr/local/cuda-9.0 /usr/local/cuda
[sudo] password for wayne:
ln: failed to create symbolic link '/usr/local/cuda/cuda-9.0': File exists
(base) wayne@amax:~$ which nvcc
/usr/local/cuda/bin/nvcc
(base) wayne@amax:~$ tail -3 ~/.bashrc
export PYTHONPATH=~/caffe-rc5/python
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/lib

You can see I do change the ~/.bashrc, link the cuda folder, but it still has the problem… :(

as indicated in your cross posting on SO, you have a broken CUDA install.

Start over with a fresh OS image, and follow the steps carefully to install CUDA.

You won’t run into this problem if you do that.

Hi, I am also facing this issue. When I compile as 64-bit binary, there is no error. But if I compile alongwith -m32 flag, it throws above error. Please help