Determining Your Installed NVIDIA CUDA Version
Importance of Identifying Your CUDA Version
Identifying the exact CUDA toolkit version installed on a system is critical for several reasons. Deep learning frameworks and GPU-accelerated libraries often have strict version requirements, and mismatched environments lead to runtime crashes or compilation failures. Furthermore, newer CUDA releases introduce hardware-specific optimizations and APIs that can significantly accelerate computational workloads. When diagnosing GPU-related issues, knowing the exact CUDA version helps narrow down driver compatibility problems.
Checking the CUDA Version via NVCC
The most direct way to determine the installed CUDA toolkit version is by querying the NVIDIA CUDA compiler, nvcc. Open a terminal and execute:
nvcc --version
The terminal output reveals the compiler build details and the release version. For instance:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Feb_14_21:12:58_PST_2023
Cuda compilation tools, release 12.1, V12.1.66
In this output, the installed toolkit version corresponds to release 12.1.
Checking the CUDA Version via NVIDIA-SMI
The NVIDIA System Management Interface (nvidia-smi) provides a snapshot of the GPU driver state and the maximum supported CUDA version for that driver. Run the following command:
nvidia-smi
This command renders a detailed status table. The top right corner displays the active driver version alongside the supported CUDA version.
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.12 Driver Version: 525.85.12 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:07:00.0 Off | 0 |
| N/A 28C P0 52W / 400W | 4MiB / 81959MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
Here, the installed driver supports up to CUDA Version 12.0. Note the distinction: nvidia-smi reports the maximum CUDA toolkit version the installed driver can support, whereas nvcc reports the currently installed CUDA toolkit version.