I have installed cuda 10.0. I followed the procedure provided by this link but when I type the command nvcc --version it says nvcc is not installed!

Command 'nvcc' not found, but can be installed with:

sudo apt install nvidia-cuda-toolkit

I was wondering if you could help me. It has been quite a while I am struggling with having Cuda up and running. It has been failed for 4 times. I really got frustrated.

My system info is:

  • Ubuntu 18.04.2 LTS
  • GeForce GTX 1060/PCIe/SSE2

Please advise!


2 Answers 2


Check if nvcc is in the folder /usr/local/cuda-10.0/bin. If it is, something went wrong when you added the folder to your path, which is described in your linked manual as followed:

echo "export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}" >> ~/.profile
source ~/.profile

As the manual states, after that, echo $PATH should return some folders including the one above.

If the path and nvcc do not even exist, your installation failed. I found the installation via the .deb file very error prone and alwas suggest to install cuda from the sources, which worked for me every time on 6 different computers and Ubuntu versions without any hassle.

Use the installation guide provided here by eromod:

sudo add-apt-repository ppa:graphics-drivers/ppa

sudo apt update

sudo ubuntu-drivers autoinstall


sudo apt install nvidia-cuda-toolkit gcc-6

nvcc --version

As Turtle10000 mentioned in here, you may already have a folder at "/usr/local/". If it is, something may go side way during installation. I want to suggest adding these lines in your hidden "bashrc" file in root directory:

# <<< conda initialize <<<

# Different user could use different CUDA version
# export CUDA_HOME=/usr/local/cuda-10.2
export CUDA_HOME=/usr/local/cuda-11.3
export PATH=/usr/local/bin:${CUDA_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:${CUDA_HOME}/lib64:${CUDA_HOME}/extras/CUPTI/lib64:${LD_LIBRARY_PATH}

Please, modify "cuda-10.2" for what you have in your machine. To be safe, you may check the existence of folders in the above lines (if some missing, your installation could be partial).

and then run source ~/.bashrc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.