How to Get the CUDA Version

To check the version of CUDA installed on your system, you can use this command: nvcc –version. This command will display the version of the CUDA Toolkit that is currently installed on your system.

Alternatively, you can also check the version of CUDA using the NVIDIA System Management Interface command: nvidia-smi. This command displays the system information for NVIDIA GPUs, including the CUDA version.

On Ubuntu Cuda V8

Type the below command to get the cuda version on Ubuntu.

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

You can also get some insights into which CUDA versions are installed with:

$ ls -l /usr/local | grep cuda

This only works if you are willing to assume CUDA is installed under /usr/local/cuda (which is true for the independent installer with the default location but not true.

For cuDNN version

For Linux:

Use the following command to find a path for cuDNN:

$ whereis cuda

It returns cuda: /usr/local/cuda output.

Then use this to get the version from the header file,

$ cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

For Windows:

Use the following to find a path for cuDNN:

C:\>where cudnn*

C:\Program Files\cuDNN7\cuda\bin\cudnn64_7.dll

Then use this to dump the version from the header file,

type "%PROGRAMFILES%\cuDNN7\cuda\include\cudnn.h" | findstr CUDNN_MAJOR

That’s it.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.