How to Install NVIDIA CUDA on Ubuntu 26.04

Deepak Prasad
Tested on Ubuntu 26.04 LTS (Resolute Raccoon), x86_64 — apt package layout (no CUDA-capable GPU on lab host)
Package Ubuntu multiverse cuda-toolkit 13.1.1-0ubuntu1
NVIDIA repo cuda-toolkit 13.4.3-1 (ubuntu2604)
Applies to Ubuntu 26.04 LTS
Privilege sudo for drivers and packages
Scope Install CUDA on Ubuntu 26.04 from Ubuntu multiverse or NVIDIA’s ubuntu2604 repository, verify or install the NVIDIA driver, set PATH for nvcc, and compile a small test program. Covers Turing-and-newer for CUDA 13.x; Maxwell/Pascal/Volta need CUDA 12.x. Native Ubuntu—not WSL2 or Jetson.
Related guides Install CUDA on Ubuntu 24.04
Install CUDA on Ubuntu 22.04
Install NVIDIA drivers on Ubuntu
Install OpenCV on Ubuntu
NOTE
Ubuntu 24.04 or 22.04? Those releases use NVIDIA’s ubuntu2404 or ubuntu2204 repositories—see Install CUDA on Ubuntu 24.04 and Install CUDA on Ubuntu 22.04.
Short on time?Beta Get the gist of this 5-minute read in seconds, then ask follow-up questions

CUDA is NVIDIA’s platform for GPU-accelerated computing. On Ubuntu 26.04, Canonical added a cuda-toolkit meta-package to multiverse, so you can install a Ubuntu-managed 13.1.x toolchain without NVIDIA’s APT source first. When you need NVIDIA’s rolling 13.4 branch, add the ubuntu2604 network repository instead.

Either way you still need a proprietary NVIDIA driver that matches your GPU—the toolkit does not replace nvidia-smi.


Before you begin

Check Ubuntu version should show 26.04 before you enable multiverse or download ubuntu2604 packages. GPU-accelerated OpenCV builds that use -D WITH_CUDA=ON assume this stack—see install OpenCV on Ubuntu after nvcc works.

WSL2: This guide targets native Ubuntu. On WSL2, install the NVIDIA driver on Windows and follow CUDA on WSL.


Quick answer

Goal Command path
Simplest on 26.04 sudo apt install cuda-toolkit from multiverse (Ubuntu 13.1.1 today)
Latest NVIDIA branch cuda-keyring for ubuntu2604, then sudo apt install cuda-toolkit (13.4.x)
Fixed minor sudo apt install cuda-toolkit-13-4
Maxwell / Pascal / Volta CUDA 12.x, not 13.x

Add export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} to ~/.bashrc, then run nvcc --version.


Does your GPU support CUDA 13?

CUDA 13 dropped offline compilation for Maxwell, Pascal, and Volta. Turing and newer fit this page. Older GPUs need CUDA 12.x from the toolkit archive.

IMPORTANT
Do not install CUDA 13.x for development targeting Maxwell, Pascal, or Volta silicon.
bash
lspci | grep -i nvidia

Check or install the NVIDIA driver

cuda-toolkit does not install the driver on CUDA 13.4-style packaging.

bash
nvidia-smi

When this works, do not reinstall the driver unless you need a newer branch.

If nvidia-smi is missing, refresh apt:

bash
sudo apt update

See recommended drivers:

bash
ubuntu-drivers devices

Install the recommended branch:

bash
sudo ubuntu-drivers install

Install headers when DKMS builds a module:

bash
sudo apt install -y linux-headers-$(uname -r)

Reboot after a first driver install:

bash
sudo reboot
Source Meaning
nvidia-smi CUDA Version Driver capability—not installed toolkit
nvcc --version Installed toolkit compiler

Method 1 — Ubuntu multiverse cuda-toolkit

Enable multiverse when apt cannot find the package:

bash
sudo add-apt-repository multiverse

Refresh indexes:

bash
sudo apt update

Install Ubuntu’s meta-package:

bash
sudo apt install -y cuda-toolkit

Check the candidate:

bash
apt-cache policy cuda-toolkit
output
Candidate: 13.1.1-0ubuntu1
 13.1.1-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu resolute/multiverse amd64 Packages

If NVIDIA’s repository is also enabled, APT may prefer 13.4.x. Pin Ubuntu’s build:

bash
sudo apt install -y cuda-toolkit=13.1.1-0ubuntu1

Method 2 — NVIDIA ubuntu2604 repository

Use this for CUDA 13.4.x or version pins. Map architecture:

bash
dpkg --print-architecture
dpkg output NVIDIA URL segment
amd64 x86_64
arm64 sbsa

Download the keyring with wget:

bash
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2604/x86_64/cuda-keyring_1.1-1_all.deb

Install it:

bash
sudo dpkg -i cuda-keyring_1.1-1_all.deb

Update apt:

bash
sudo apt update

Install the toolkit meta-package from NVIDIA’s repo:

bash
sudo apt install -y cuda-toolkit

Confirm apt selects the NVIDIA build:

bash
apt-cache policy cuda-toolkit
output
Candidate: 13.4.3-1
 13.4.3-1 600
        600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2604/x86_64  Packages

Pin 13.4 when frameworks require that minor:

bash
sudo apt install -y cuda-toolkit-13-4

Set the CUDA PATH

Append toolkit binaries to your user PATH:

bash
echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc

Reload:

bash
source ~/.bashrc

The /usr/local/cuda symlink should point at the version you installed:

bash
ls -l /usr/local/cuda

Verify the toolkit

Ask the compiler for its release string:

bash
nvcc --version
output
nvcc: NVIDIA (R) Cuda compiler driver
Cuda compilation tools, release 13.4, V13.4.xxx

On a GPU host, the driver line in nvidia-smi should meet the toolkit’s minimum:

bash
nvidia-smi

Compile a CUDA test program

Install build tools:

bash
sudo apt install -y build-essential

Create vector_add.cu with a simple __global__ kernel and cudaMalloc/cudaMemcpy (see NVIDIA CUDA samples for full examples). Compile on a GPU host:

bash
nvcc -o vector_add vector_add.cu

Run:

bash
./vector_add
output
Sample z[0] = 3.000000 (expect 3.0)

Update, pin, or uninstall

Refresh indexes:

bash
sudo apt update

Pin or upgrade the 13.4 line:

bash
sudo apt install cuda-toolkit-13-4

Remove toolkit packages:

bash
sudo apt purge -y cuda-toolkit

Drop NVIDIA’s CUDA apt source when you no longer need updates from it:

bash
sudo apt purge -y cuda-keyring

Run apt-cache policy cuda-toolkit when both Ubuntu and NVIDIA sources are enabled so you know which origin wins.


Troubleshooting

Symptom Likely cause Fix
No cuda-toolkit on 26.04 Multiverse off sudo add-apt-repository multiverse; apt update
Wrong keyring URL Release mismatch Use ubuntu2604 on 26.04
nvcc not found PATH /usr/local/cuda/bin in ~/.bashrc
Driver CUDA < toolkit Old driver Upgrade via ubuntu-drivers
CUDA 13 on old GPU Architecture CUDA 12.x
Unexpected toolkit version Two apt origins apt-cache policy cuda-toolkit; pin version

Summary

Ubuntu 26.04 can install cuda-toolkit from multiverse for a Ubuntu-managed 13.1 line, or add NVIDIA’s ubuntu2604 repository for 13.4.x. Install or verify the NVIDIA driver with nvidia-smi separately, set PATH, and confirm with nvcc --version.

Match GPU generation to toolkit major (CUDA 13 for Turing and newer). For 24.04 or 22.04, use the dedicated LTS guides in the intro table.


References


Frequently Asked Questions

Does Ubuntu 26.04 include CUDA in the archive?

Yes. Install cuda-toolkit from multiverse (tested candidate 13.1.1). Add NVIDIA’s ubuntu2604 repo when you need 13.4.x.

Should I use cuda-toolkit or nvidia-cuda-toolkit on 26.04?

Prefer cuda-toolkit for the current Ubuntu-managed line. nvidia-cuda-toolkit is the older multiverse name (~12.4.x).

Does this page cover Ubuntu 24.04 or 22.04?

No. Open the 24.04 or 22.04 install guide from the article intro table—those pages use ubuntu2404 or ubuntu2204 keyring URLs.

What is the difference between nvidia-smi and nvcc?

nvidia-smi reflects the driver; nvcc reflects the installed toolkit.

Finished reading?Beta Get the key takeaways in seconds, then ask follow-up questions
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on OpenStack, KVM, Proxmox, and VMware.

  • Debian
  • Ubuntu
  • Linux
  • Red Hat Enterprise Linux
  • Shell Script
  • System Administration