30

I installed cuda 8.0 in my ubuntu 16.04 machine and checked the cuda version using the command "nvcc --version". it shows version as 7.5!!!.How Can I be sure that it is accurate? Are there other commands that I can also use to verify my result?

Naseer
  • 4,041
  • 9
  • 36
  • 72
Sowmya Dhanapal
  • 471
  • 1
  • 4
  • 9
  • 1
    What's your GPU ? Did you have `cuda` previously installed? – pSoLT Jan 18 '17 at 08:48
  • I have GTX970 GPU. No I didn't installed cuda previously in my system. – Sowmya Dhanapal Jan 18 '17 at 08:54
  • How did you install `cuda` ? – pSoLT Jan 18 '17 at 09:01
  • I downloaded the package from "https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb" and I followed the installation instructions. – Sowmya Dhanapal Jan 18 '17 at 09:53
  • Instead of the package, please provide a link to the **instructions** you followed. – Taro Jan 18 '17 at 09:55
  • I followed the instructions in the following link http://www.r-tutor.com/gpu-computing/cuda-installation/cuda7.5-ubuntu but instead of 7.5, I replaced with 8.0. – Sowmya Dhanapal Jan 18 '17 at 10:21
  • 4
    What path did you install CUDA 8.0 to? What is the output of `which nvcc`? – tera Jan 18 '17 at 11:35
  • If you are looking for the actual version digits as a string you can use a mix of `nvidia-smi` to get the version, `grep` to identify the line, and `sed` to remove the unnecessary characters: `nvidia-smi | grep -o 'CUDA Version: [0-9].\.[0-9]' | sed 's/.*: //'` – Eduardo Pignatelli Feb 16 '21 at 20:24

4 Answers4

49

[edited 2022]

For CUDA 11:

$ cat /usr/local/cuda/version.json

For cuda-8.0 on Ubuntu16.04, you should be able to read

$ cat /usr/local/cuda/version.txt
CUDA Version 8.0.44

I agree with Robert Crovella, you might need to check your PATH

user3076252
  • 1,919
  • 13
  • 13
10

Starting from CUDA 8.0, it's possible to have multiple CUDA versions installed. You can then activate different values for $PATH environment variable that will present you with different CUDA version.

Command to immediately obtain the CUDA version:

$ nvcc --version | grep "release" | awk '{print $6}' | cut -c2-

You can confirm the result by checking the install status of CUDA libraries:

$ dpkg -l | grep cuda

For installing multiple versions of CUDA, you can refer to this article.

Sanyam Mehra
  • 299
  • 2
  • 14
mikaelfs
  • 399
  • 3
  • 4
4

Thank you all... Previously I tried to install cuda8.0 using run file from https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run. After that I tried to check "nvcc --version", but it shows the following error "The program 'nvcc' is currently not installed. You can install it by typing: sudo apt-get install nvidia-cuda-toolkit". So I tried the above command. It gave the cuda7.5 version.

Later I tried to install cuda using debian package which by default contained nvcc. Now I am getting correct version.

Sowmya Dhanapal
  • 471
  • 1
  • 4
  • 9
  • 3
    Follow the directions in the linux getting started guide. When you use a runfile installer, you must update your `PATH` environment variable. If you don't do that, you will get the message about `nvcc` not being installed. – Robert Crovella Jan 21 '17 at 04:37
3

It may be due to the fact that you have both v7.5 and v8.0 installed. So instead of changing path, try uninstalling v7.5 first

Sagar Chand
  • 260
  • 7
  • 18