How to Check CUDA Version on Linux

How to Check CUDA Version on Linux
Published on Aug 14, 2025 Updated on Nov 7, 2025

The introduction of GPUs marked a significant turning point in the field of computing. GPUs substantially boost performance across numerous disciplines, not just in graphics rendering. They are optimized for parallel computing, enabling the massive acceleration of tasks and applications through thousands of cores designed to execute multiple concurrent tasks simultaneously. They have revolutionized gaming through realistic and visually rich images. Additionally, they play a crucial role in deep learning, AI, and other resource-intensive tasks thanks to their exceptional processing capabilities.

NVIDIA developed CUDA as an alternative to platforms such as OpenGL. It runs purely on NVIDIA GPUs and enables developers to harness its massive processing capabilities in developing general-purpose code

This tutorial presents various avenues of checking the CUDA version on Linux.

#Prerequisites

First, ensure that you have the following in place before beginning.

  • NVIDIA GPU on your PC

  • CUDA toolkit installed. Check out how to install CUDA on Ubuntu.

Deploy and scale your projects with Cherry Servers' cost-efficient dedicated or virtual servers. Get seamless scaling, hourly pricing, and premium 24/7 support.

#How to Check CUDA Version on Linux

There are multiple ways of checking the version of CUDA on your system. Let’s check them out.

#Method 1: Using the nvcc command

NVCC, short for NVIDIA CUDA Compiler, is NVIDIA's compiler used to compile CUDA and C/C++ applications. You can easily leverage the nvcc command to check the CUDA version

Simply invoke the nvcc command as shown.

Command Line
nvcc --version

OR

Command Line
nvcc -V

The command prints the version of CUDA currently being used by your Linux system. It also includes the NVIDIA copyright information and build date of the CUDA compiler driver. The output reports that we are running CUDA 12.6.

check-cuda-version-with-nvcc-command

#Method 2: Using the apt package manager

The apt package manager (for Debian/Ubuntu users) is a decent tool for checking the CUDA version. To reveal the version, run:

Command Line
apt info cuda

On the output, you get attributes including CUDA's version, download, and installed size.

Alternatively, you can run the apt list command as follows.

Command Line
apt list --installed | grep cuda

This provides more comprehensive output that includes all the installed CUDA packages, toolkit, libraries, and documentation.

#Method 3: Using the dpkg package manager

If you prefer using the dpkg package manager, you can reveal CUDA's installed version as follows.

Command Line
dpkg -l | grep cuda-toolkit
Outputii  cuda-toolkit-12-6                     12.6.1-1          amd64      CUDA Toolkit 12.6 meta-package
ii  cuda-toolkit-12-6-config-common       12.6.68-1         all        Common config package for CUDA Toolkit 12.6.

#Method 4: Check CUDA version from Pytorch

If you are leveraging Pytorch, you can check CUDA version using just a few lines of code.

Command Line
import torch
print(torch.version.cuda)

check-cuda-version-using-torch

#Error when checking CUDA version

Have you, by any chance, encountered the nvcc is not installed! error? If yes, fret not. This is usually due to the $PATH variable for CUDA and its libraries not being defined.

To fix the matter, append the following lines in the ~/.bashrc file.

Command Line
export PATH=/usr/local/cuda-12.6/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.6/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Save the changes and exit the file. Then apply the changes by running:

Command Line
source  ~/.bashrc

And that’s it. You should now check the CUDA version without running into any errors.

Also read: How to Install Xrdp on Ubuntu 24.04

#Conclusion

We have outlined various methods for checking the CUDA version on your preferred Linux distribution. You have also learned how to debug the nvcc is not installed error, which is usually a result of CUDA not being installed or its $PATH variable not being specified.

Cloud VPS Hosting

Starting at just $3.24 / month, get virtual servers with top-tier performance.

Share this article

Related Articles

Published on Feb 11, 2026 Updated on Feb 11, 2026

How to Install Coolify on Ubuntu Server (Step-by-Step Guide)

Learn how to install and configure Coolify on an Ubuntu server, set up DNS and HTTPS, configure firewall rules, and deploy your first app with this step-by-step guide.

Read More
Published on Jan 27, 2026 Updated on Jan 27, 2026

Linux Networking Basics for Server Administration

Learn Linux networking basics for server admins: interfaces, IPs, routing, DNS, firewalls, key commands, Netplan config, and troubleshooting issues.

Read More
Published on Jan 23, 2026 Updated on Feb 13, 2026

How to Install Redis on Ubuntu 24.04: Step-by-Step

Learn how to install, configure, and secure Redis on Ubuntu 24.04 with this step-by-step guide for fast caching, sessions, and high-performance apps.

Read More
No results found for ""
Recent Searches
Navigate
Go
ESC
Exit
We use cookies to ensure seamless user experience for our website. Required cookies - technical, functional and analytical - are set automatically. Please accept the use of targeted cookies to ensure the best marketing experience for your user journey. You may revoke your consent at any time through our Cookie Policy.
build: d0764a5c6.1646