How to get and check the CUDA version? Is there a quick command or script to check the installed version of CUDA?
I found a manual for version 4.0 in the installation directory, but I’m not sure if it corresponds to the actual installed version.
How to get and check the CUDA version? Is there a quick command or script to check the installed version of CUDA?
I found a manual for version 4.0 in the installation directory, but I’m not sure if it corresponds to the actual installed version.
Hey Ariya,
You can check the CUDA version from the command line using:
nvcc --version
(or /usr/local/cuda/bin/nvcc --version
) which gives the CUDA compiler version that matches the toolkit version.
From the application code, you can query the runtime API version with:
cudaRuntimeGetVersion()
or the driver API version with:
cudaDriverGetVersion()
deviceQuery
is an SDK sample app that queries the above information and device capabilities.
As others note, you can also check the contents of the version.txt (or version.json in recent CUDA versions) using:
cat /usr/local/cuda/version.txt
on Mac or Linux. However, if there is another version of the CUDA toolkit installed other than the one symlinked from /usr/local/cuda, this may report an inaccurate version if another version is earlier in your PATH, so use this method with caution.
Hope this helps
Hey Richa
On Ubuntu, you may need to install the nvidia-cuda-toolkit
package to use the command mentioned. You can do this by running:
sudo apt install nvidia-cuda-toolkit
Hey Shipla,
I think you can check CUDA version:
nvcc --version
or
nvidia-smi
To check the cuDNN version:
For Linux:
Find the path for cuDNN:
whereis cuda This will output something like:
cuda: /usr/local/cuda
Then get the version from the header file:
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
For Windows:
Find the path for cuDNN: where cudnn*
This will output something like:
C:\Program Files\cuDNN7\cuda\bin\cudnn64_7.dll
Then get the version from the header file:
type "%PROGRAMFILES%\cuDNN7\cuda\include\cudnn.h" | findstr CUDNN_MAJOR