How to get the CUDA version?
Is there any quick command or script to check for the version of CUDA installed?
I found the manual of 4.0 under the installation directory but I’m not sure whether it is of the actual installed version or not.
31 Answers 31
As Jared mentions in a comment, from the command line:
(or /usr/local/cuda/bin/nvcc —version ) gives the CUDA compiler version (which matches the toolkit version).
From application code, you can query the runtime API version with
or the driver API version with
As Daniel points out, deviceQuery is an SDK sample app that queries the above, along with device capabilities.
As others note, you can also check the contents of the version.txt ( .json in recent CUDA versions) using (e.g., 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 than the above, so use with caution.
![]()
[Edited answer. Thanks for everyone who corrected it]
You should find the CUDA Version *highest CUDA version the installed driver supports on the top right corner of the comand’s output. At least I found that output for CUDA version 10.0 e.g., 
Note that this does not mean that CUDA 10.0 is installed. It may or may not be.
You can check via nvcc —version command if CUDA is really installed.
Note — Sometimes installing CUDA via some methods (.run file) by default also installs an NVIDIA driver or replaces the existing installed driver, and many people get confused regarding this. However, installing a driver via CUDA installation may not get you the most updated or suitable driver for your GPU. This is a more complex topic.
![]()
![]()
On Ubuntu Cuda V8:
You can also get some insights into which CUDA versions are installed with:
which will give you something like this:
Given a sane PATH, the version cuda points to should be the active one (10.2 in this case).
NOTE: 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 e.g. for distributions with CUDA integrated as a package). Ref: comment from @einpoklum.
![]()
![]()
For CUDA version:
For cuDNN version:
Use following to find path for cuDNN:
Then use this to get version from header file,
Use following to find path for cuDNN:
Then use this to dump version from header file,
If you’re getting two different versions for CUDA on Windows — Different CUDA versions shown by nvcc and NVIDIA-smi
![]()
Other respondents have already described which commands can be used to check the CUDA version. Here, I’ll describe how to turn the output of those commands into an environment variable of the form "10.2", "11.0", etc.
To recap, you can use
to find out the CUDA version. I think this should be your first port of call. If you have multiple versions of CUDA installed, this command should print out the version for the copy which is highest on your PATH.
The output looks like this:
We can pass this output through sed to pick out just the MAJOR.MINOR release version number.
If nvcc isn’t on your path, you should be able to run it by specifying the full path to the default location of nvcc instead.
The output of which is the same as above, and it can be parsed in the same way.
Alternatively, you can find the CUDA version from the version.txt file.
The output of which
can be parsed using sed to pick out just the MAJOR.MINOR release version number.
Note that sometimes the version.txt file refers to a different CUDA installation than the nvcc —version . In this scenario, the nvcc version should be the version you’re actually using.
We can combine these three methods together in order to robustly get the CUDA version as follows:
This environment variable is useful for downstream installations, such as when pip installing a copy of pytorch that was compiled for the correct CUDA version.
Similarly, you could install the CPU version of pytorch when CUDA is not installed.
But be careful with this because you can accidentally install a CPU-only version when you meant to have GPU support. For example, if you run the install script on a server’s login node which doesn’t have GPUs and your jobs will be deployed onto nodes which do have GPUs. In this case, the login node will typically not have CUDA installed.
Как узнать версию cuda
CUDA is generally installed under the path /usr/local/cuda/, there is a version.txt file under this path, which records the version information of CUDA
How to check the CUDA version of windows
What is CUDA?
CUDA (Compute Unified Device Architecture) is a graphics card manufacturerNVIDIAIntroduced computing platform. CUDA is a universalParallel ComputingArchitecture that enablesGPUAble to solve complex calculation problems. It contains CUDAInstruction set architecture(ISA) And the parallel computing engine inside the GPU. (The above explanation comes from Baidu entry)
Knowing what CUDA is, what is my CUDA version number?
(1) Open the control panel and click the NVIDIA control panel:
Click Help on the NVIDIA control panel, and click System Information in the lower left corner:
Click on the component: Your CUDA information is displayed here! ! !
(2) The second way is:
Open CMD, enter nvcc —version
If it is reported that nvcc is not an internal or external command, nor an executable program or batch file, then the path is not added to the path. The path of the general file is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
How To Check Cuda Version Windows With Code Examples
In this tutorial, we will try to find the solution to How To Check Cuda Version Windows through programming. The following code illustrates this.
We were able to fix the How To Check Cuda Version Windows problemcode by looking at a number of different examples.
How do I know my CUDA version?
Finding the NVIDIA cuda version
- Open the terminal application on Linux or Unix.
- Then type the nvcc –version command to view the version on screen:
- To check CUDA version use the nvidia-smi command:
How do I change the CUDA version in Windows?
Swap CUDA Toolkit Versions on Windows
- Step 0: Check CUDA Version. Check what version of CUDA you have.
- Step 1: Locate System Environment Variables. Open up your environment variables.
- Step 2: Change System Variables.
- Step 3: Change System Paths.
- Step 4: Check if succeed.
How do I know if my GPU is CUDA enabled?
To check if your computer has an NVIDA GPU and if it is CUDA enabled: Right click on the Windows desktop. If you see “NVIDIA Control Panel” or “NVIDIA Display” in the pop up dialogue, the computer has an NVIDIA GPU. Click on “NVIDIA Control Panel” or “NVIDIA Display” in the pop up dialogue.30-Aug-2021
How do I know where CUDA is installed?
By default, the CUDA SDK Toolkit is installed under /usr/local/cuda/. The nvcc compiler driver is installed in /usr/local/cuda/bin, and the CUDA 64-bit runtime libraries are installed in /usr/local/cuda/lib64. Add /usr/local/cuda/bin to your PATH environment variable.
Where is CUDA installed Windows?
Most probably it will be installed on C:\Program Files\NVIDIA GPU Computing Toolkit file path. ( It depends on the location you installed). As I previously installed CUDA version 9.0 on my laptop the CUDA files are existed in this following path location.14-Dec-2019
How do I install CUDA on Windows 10?
- Step 1: Check the software you will need to install.
- Step 2: Download Visual Studio Express.
- Step 3: Download CUDA Toolkit for Windows 10.
- Step 4: Download Windows 10 CUDA patches.
- Step 5: Download and Install cuDNN.
- Step 6: Install Python (if you don’t already have it)
- Step 7: Install Tensorflow with GPU support.
How do I use CUDA in Windows?
Does CUDA 11.2 work on Windows 11?
This works as well with Windows 11.
Is GTX 1650 CUDA enabled?
Right at the moment, GTX 1650 is a very new GPU, and so any driver that works with GTX 1650 will work with any currently available CUDA toolkit version.02-Sept-2019
How do I enable Nvidia Cuda?
Enable CUDA optimization by going to the system menu, and select Edit > Preferences. Click on the Editing tab and then select the "Enable NVIDIA CUDA /ATI Stream technology to speed up video effect preview/render" check box within the GPU acceleration area. Click on the OK button to save your changes.
How to Get the CUDA Version
- Open the terminal application on Linux or Unix.
- Then type the nvcc –version command to view the version on the screen.

- To check the CUDA version, use the “nvidia-smi” command:

(Both images might have different versions because I have added an image months later)
This command displays the system information for NVIDIA GPUs, including the CUDA version.
Using the nvidia-smi command to display the CUDA version
The nvidia-smi command provides monitoring and management capabilities for each of the following NVIDIA cards:
- Tesla
- Quadro
- GRID
- GeForce GPU from Fermi and higher architecture
- Titan series GPU.
How to know which version of CUDA I have installed?
On Ubuntu Cuda V8
Type the below command to get the cuda version on Ubuntu.
You can also get some insights into which CUDA versions are installed with:
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.