| Tested on | Ubuntu 22.04 LTS (Jammy Jellyfish), x86_64 — NVIDIA ubuntu2204 repository and apt package layout (no CUDA-capable GPU on lab host) |
|---|---|
| Package | NVIDIA repo cuda-toolkit 13.4.3-1 (ubuntu2204)Ubuntu multiverse nvidia-cuda-toolkit (~11.5.x) |
| Applies to | Ubuntu 22.04 LTS (amd64 and arm64 SBSA use the matching repo arch) |
| Privilege | sudo for drivers and packages |
| Scope | Install CUDA Toolkit on Ubuntu 22.04 from NVIDIA’s network repository, verify or install a compatible NVIDIA driver, set PATH for nvcc, and run basic checks. Covers Turing-and-newer GPUs for CUDA 13.x; Maxwell/Pascal/Volta need CUDA 12.x. Native Ubuntu only—not WSL2, Jetson, or runfile-only installs. |
| Related guides | Install CUDA on Ubuntu 26.04 Install CUDA on Ubuntu 24.04 Install NVIDIA drivers on Ubuntu Check Ubuntu version |
CUDA on Ubuntu 22.04 follows the same two-layer model as other LTS releases: a proprietary NVIDIA driver and the CUDA Toolkit for building GPU code. NVIDIA lists 22.04 in the CUDA Linux installation guide with repository codename ubuntu2204.
Jammy’s multiverse nvidia-cuda-toolkit package is much older (roughly 11.5.x) than what most ML stacks expect today. For CUDA 13, add NVIDIA’s network repository as below instead of relying on the distro package alone.
Before you begin
Check Ubuntu version shows 22.04 before you use ubuntu2204 URLs. You need a CUDA-capable NVIDIA GPU for runtime tests; toolkit-only installs on CPU hosts are mainly for cross-compilation.
Install headers for DKMS driver builds:
sudo apt install linux-headers-$(uname -r)WSL2: Follow NVIDIA’s CUDA on WSL—the Windows host carries the driver.
Quick answer
On amd64, download NVIDIA’s keyring for Jammy:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.debRegister the repository signing key:
sudo dpkg -i cuda-keyring_1.1-1_all.debRefresh indexes so apt sees developer.download.nvidia.com:
sudo apt updateInstall the toolkit meta-package:
sudo apt install -y cuda-toolkitAdd export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} to ~/.bashrc, reload the shell, then run nvcc --version and nvidia-smi.
GPU and CUDA 13 compatibility
CUDA 13 does not target Maxwell, Pascal, or Volta for offline compilation. Use CUDA 12.x from the toolkit archive when those GPUs must remain in scope.
lspci | grep -i nvidiaCheck or install the NVIDIA driver
cuda-toolkit on CUDA 13.4-style packages does not install a driver. Test the stack:
nvidia-smiIf the command is missing, refresh apt:
sudo apt updateList driver candidates:
ubuntu-drivers devicesInstall the recommended package:
sudo ubuntu-drivers installReboot when you install a driver for the first time:
sudo rebootInstall CUDA from NVIDIA’s ubuntu2204 repository
Check CPU architecture for the download URL:
dpkg --print-architecturedpkg output |
NVIDIA repo path segment |
|---|---|
amd64 |
x86_64 |
arm64 |
sbsa |
Download the keyring (amd64 example):
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.debInstall the keyring:
sudo dpkg -i cuda-keyring_1.1-1_all.debRefresh package lists:
sudo apt updateInstall the toolkit:
sudo apt install -y cuda-toolkitInspect the candidate version:
apt-cache policy cuda-toolkitPin 13.4 when needed:
sudo apt install -y cuda-toolkit-13-4Optional nvidia-cuda-toolkit from Ubuntu
22.04 multiverse still ships nvidia-cuda-toolkit (~11.5.x on typical mirrors). Treat it as a legacy distro toolchain—not a substitute for NVIDIA’s CUDA 13 repository unless you have a deliberate compatibility requirement.
Set PATH and verify
Add /usr/local/cuda/bin to PATH in ~/.bashrc, source ~/.bashrc, then:
nvcc --versionCompare with:
nvidia-smiUpdate and uninstall
Refresh indexes before you pin or upgrade:
sudo apt updateMove to the 13.4 meta-package when you need that minor:
sudo apt install cuda-toolkit-13-4Remove the toolkit:
sudo apt purge -y cuda-toolkitRemove the repository keyring when finished:
sudo apt purge -y cuda-keyringTroubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Keyring download fails | Wrong LTS in URL | Use ubuntu2204 on 22.04 |
nvcc not found |
PATH |
Export /usr/local/cuda/bin |
| Driver too old for toolkit | Version skew | Upgrade nvidia-driver-* |
| Old GPU + CUDA 13 | Architecture limit | CUDA 12.x toolkit |
nvidia-smi fails after install |
nouveau / Secure Boot | See NVIDIA drivers on Ubuntu |
Summary
Ubuntu 22.04 gets a current CUDA 13 toolchain from NVIDIA’s ubuntu2204 repository after you install cuda-keyring and cuda-toolkit. Confirm the driver with nvidia-smi before you trust GPU builds—toolkit packages no longer bundle the driver on CUDA 13.4-style meta-packages.
Avoid Jammy’s old nvidia-cuda-toolkit unless you need that pinned generation. For 24.04 or 26.04 paths, use the sibling articles in the intro table.
References
Frequently Asked Questions
What is the best way to install CUDA on Ubuntu 22.04?
Add NVIDIA’s ubuntu2204 cuda-keyring, then sudo apt install cuda-toolkit. That matches how current ranking guides and NVIDIA’s own network-repository steps describe Jammy.
Is nvidia-cuda-toolkit enough for PyTorch or TensorFlow?
Usually no—those stacks expect a recent CUDA 13 (or vendor-pinned) toolkit from NVIDIA’s repository, not the 11.5-era nvidia-cuda-toolkit alone.
Does this work on Ubuntu 22.04 ARM64?
Yes with the sbsa repository path on SBSA hardware—replace x86_64 in the keyring URL after dpkg --print-architecture.
What does nvidia-smi CUDA Version mean?
It is the maximum CUDA version the installed driver supports, not the nvcc toolkit version.

