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 Mar 12, 2026 Updated on Mar 13, 2026

How to Install n8n on Ubuntu 24.04 Using Docker

Learn how to self-host n8n on Ubuntu 24.04 with Docker, PostgreSQL, and Caddy for secure, automated workflows. Get full control with Cherry Servers.

Read More
Published on Mar 8, 2026 Updated on Mar 9, 2026

Linux Tee Command Explained: Syntax, Examples & Use Cases

Learn the Linux tee command with practical examples. Save command output to files while displaying it in the terminal for logging, automation, and DevOps workflows.

Read More
Published on Mar 5, 2026 Updated on Mar 9, 2026

10 Best Linux Server Management Tools

Explore the best Linux server management tools to monitor, automate, and secure servers. Compare top solutions like Ansible, Puppet, Zabbix, and more.

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: 6a7a45688.1707