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?

8
  • 1
    What's your GPU ? Did you have cuda previously installed? Commented Jan 18, 2017 at 8:48
  • I have GTX970 GPU. No I didn't installed cuda previously in my system. Commented Jan 18, 2017 at 8:54
  • How did you install cuda ? Commented Jan 18, 2017 at 9:01
  • I downloaded the package from "developer.nvidia.com/compute/cuda/8.0/prod/local_installers/…" and I followed the installation instructions. Commented Jan 18, 2017 at 9:53
  • 4
    What path did you install CUDA 8.0 to? What is the output of which nvcc? Commented Jan 18, 2017 at 11:35

4 Answers 4

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

Sign up to request clarification or add additional context in comments.

2 Comments

/usr/local/cuda is a symlink to the version you have installed. You can install cuda without the symlink and then this will not work.
For me it was : cat /usr/local/cuda/version.json
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.

Comments

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.

1 Comment

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.
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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.