CUDA: nvcc cannot be detected though installed

Yiqun Liu picture Yiqun Liu · Nov 15, 2015 · Viewed 23.1k times · Source

I successfully installed CUDA 7.0 on ubuntu(ami instance), but when I typed 'nvcc -version', it told me that

The program 'nvcc' is currently not installed. You can install it by typing:
apt-get install nvidia-cuda-toolkit
You will have to enable the component called 'multiverse'

That's weird since the installation was successful in /usr/local and I've added CUDA 7.0 to my path. I've also tried rebooting my instance then typing in the same command and it didn't work. I'm also sure that the driver for my GPU is correctly. (same error occurs when I use theano to run nvcc test)

Answer

Yiqun Liu picture Yiqun Liu · Nov 18, 2015

Actually, it's the case that I set environment variable in a wrong way. Instead of using

$ export PATH=/usr/local/cuda-7.0/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH

as it's recommended, I choose to edit /etc/profile, which is not recommended.