Nvcc --version returns nothing despite correct install

I properly installed CUDA 10.1 as per NVIDIA website instructions. However, I noticed two discrepancies. First, nvcc --version returns the following:

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

sudo apt install nvidia-cuda-toolkit

Also, nvidia-smi indicates that I have CUDA 10.2:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100      Driver Version: 440.100      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   51C    P0    N/A /  N/A |    406MiB /  4040MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2133      G   /usr/lib/xorg/Xorg                           194MiB |
|    0      2386      G   /usr/bin/gnome-shell                         157MiB |
|    0      2998      G   /usr/lib/firefox/firefox                       1MiB |
|    0      3940      G   ...quest-channel-token=7304133193382227385    41MiB |
|    0      5805      G   /usr/lib/firefox/firefox                       1MiB |
|    0      6930      G   /usr/lib/firefox/firefox                       1MiB |
|    0      7073      G   /usr/lib/firefox/firefox                       1MiB |
|    0      7153      G   /usr/lib/firefox/firefox                       1MiB |
+-----------------------------------------------------------------------------+

Should I be worried about this? If so, any solutions to fix it?

EDIT: The solution below is correct, but I got it to work by simply entering the export commands into terminal, rather than editing the /.bashrc file.

Hi @ajayp1

  1. Open terminal and write this command,

nano /home/username/.bashrc OR nano /home/$USER/.bashrc

  1. Inside there add the following: (dont forget to change your CUDA version)

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

1 Like

Great, thanks. Should I be concerned at all that nvcc --version and nvidia-smi indicate two different versions of CUDA?

You can follow this link:

1 Like