| Tested on | Ubuntu 24.04 LTS (Noble Numbat), x86_64 — NVIDIA ubuntu2404 repository and apt package layout (no CUDA-capable GPU on lab host) |
|---|---|
| Package | NVIDIA repo cuda-toolkit 13.4.3-1 (ubuntu2404)Ubuntu multiverse nvidia-cuda-toolkit (~12.0.x) |
| Applies to | Ubuntu 24.04 LTS (amd64 and arm64 SBSA use the matching repo arch) |
| Privilege | sudo for drivers and packages |
| Scope | Install CUDA Toolkit on Ubuntu 24.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 22.04 Install NVIDIA drivers on Ubuntu Check Ubuntu version |
cuda-toolkit meta-package that 26.04 adds in multiverse. On 26.04, see Install CUDA on Ubuntu 26.04 for Ubuntu-managed and NVIDIA-repository options.
CUDA is NVIDIA’s platform for GPU computing. On Ubuntu 24.04 you need a working proprietary NVIDIA driver plus the CUDA Toolkit (nvcc, headers, and libraries). NVIDIA qualifies 24.04 in the CUDA Linux installation guide under the repository codename ubuntu2404.
This page walks through NVIDIA’s recommended network repository install (cuda-keyring + cuda-toolkit). Ubuntu’s older multiverse package nvidia-cuda-toolkit remains if you deliberately want a distro-pinned 12.0-era toolchain instead of current CUDA 13.
Before you begin
Confirm the release with check Ubuntu version — you should see 24.04 before you download ubuntu2404 packages. You need a CUDA-capable NVIDIA GPU on bare metal or supported passthrough; CPU-only hosts can install toolkit packages for cross-builds, but nvidia-smi and device kernels need hardware.
Install kernel headers before driver DKMS builds:
sudo apt install linux-headers-$(uname -r)WSL2: Use NVIDIA’s CUDA on WSL guide—install the Windows driver on the host, not inside the Linux guest alone.
Quick answer
Add NVIDIA’s CUDA repository, install cuda-toolkit, and put /usr/local/cuda/bin on your PATH:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.debRegister the keyring:
sudo dpkg -i cuda-keyring_1.1-1_all.debRefresh indexes:
sudo apt updateInstall the toolkit meta-package:
sudo apt install -y cuda-toolkitAdd export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} to ~/.bashrc, run source ~/.bashrc, then check nvcc --version and nvidia-smi.
Does your GPU support CUDA 13?
CUDA 13 dropped offline compilation support for Maxwell, Pascal, and Volta. Turing and newer (RTX 20xx and later, recent data-center GPUs) fit the CUDA 13 workflow on this page. Older silicon should use CUDA 12.x from NVIDIA’s toolkit archive.
List visible NVIDIA devices:
lspci | grep -i nvidiaNo output usually means the OS does not see an NVIDIA PCI device.
Check or install the NVIDIA driver
From CUDA 13.4 packaging, cuda-toolkit does not install the NVIDIA driver. Verify the driver first:
nvidia-smiWhen this prints GPU name, driver version, and a process table, skip driver reinstall unless you need a newer branch for your toolkit.
If nvidia-smi is missing, refresh apt and list recommendations:
sudo apt updateUbuntu’s driver helper lists recommended branches for your hardware:
ubuntu-drivers devicesInstall Ubuntu’s recommended branch (example output may show nvidia-driver-580):
sudo ubuntu-drivers installReboot after a first driver install:
sudo reboot| Source | Meaning |
|---|---|
nvidia-smi → CUDA Version |
Highest CUDA version the driver supports—not the installed toolkit |
nvcc --version |
Installed CUDA Toolkit compiler version |
Install CUDA from NVIDIA’s ubuntu2404 repository
NVIDIA documents network repository setup in the CUDA installation guide — Ubuntu. Map architecture before you download the keyring:
dpkg --print-architecturedpkg output |
NVIDIA repo path segment |
|---|---|
amd64 |
x86_64 |
arm64 |
sbsa |
On amd64, fetch the keyring with the wget command:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.debInstall it with dpkg:
sudo dpkg -i cuda-keyring_1.1-1_all.debUpdate apt:
sudo apt updateInstall the rolling toolkit meta-package:
sudo apt install -y cuda-toolkitSee which version apt will take:
apt-cache policy cuda-toolkitCandidate: 13.4.3-1
13.4.3-1 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64 PackagesPin CUDA 13.4 when frameworks expect that minor:
sudo apt install -y cuda-toolkit-13-4NVIDIA installs under /usr/local/cuda-<version>/ with a symlink at /usr/local/cuda.
Optional Ubuntu multiverse nvidia-cuda-toolkit
Ubuntu 24.04 still publishes nvidia-cuda-toolkit in multiverse (roughly 12.0.x—check apt-cache policy nvidia-cuda-toolkit on your host). Use it only when you need Ubuntu’s pinned distro build instead of NVIDIA’s CUDA 13 line. Do not mix conflicting meta-packages without a deliberate purge plan.
Set the CUDA PATH
Append toolkit binaries to your user PATH:
echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrcReload the shell:
source ~/.bashrcConfirm the default symlink:
ls -l /usr/local/cudaVerify the CUDA toolkit
Print the compiler version:
nvcc --versionnvcc: NVIDIA (R) Cuda compiler driver
Cuda compilation tools, release 13.4, V13.4.xxxExact V13.4.* build strings change with package updates.
Compare driver support:
nvidia-smiThe CUDA version line in nvidia-smi should meet the minimum for your toolkit major—see CUDA release notes.
Compile a small CUDA test (GPU required)
Install a C++ toolchain:
sudo apt install -y build-essentialSave a minimal vector_add.cu (same pattern as NVIDIA’s getting-started samples), compile with nvcc -o vector_add vector_add.cu, and run ./vector_add on a host where nvidia-smi already works. Expect output similar to Sample z[0] = 3.000000 when the driver and toolkit align.
Update, pin, or remove CUDA
Refresh and upgrade the meta-package you use:
sudo apt updateMove to the 13.4 meta-package when you need that minor:
sudo apt install cuda-toolkit-13-4List installed CUDA packages:
dpkg -l | grep -E '^ii\s+cuda'Remove the toolkit meta-package when uninstalling:
sudo apt purge -y cuda-toolkitPurge cuda-keyring if you no longer want NVIDIA’s repository:
sudo apt purge -y cuda-keyringPurging cuda-toolkit does not remove nvidia-driver-* on CUDA 13.4-style packaging.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
cuda-keyring 404 |
Wrong release in URL | Use ubuntu2404, not ubuntu2204 or ubuntu2604 |
| Wrong architecture in URL | arm64 vs amd64 | dpkg --print-architecture → sbsa vs x86_64 |
nvcc: command not found |
PATH |
Add /usr/local/cuda/bin; open a new shell |
nvidia-smi OK, no nvcc |
Toolkit missing | sudo apt install cuda-toolkit |
| Driver CUDA below toolkit needs | Old driver | Upgrade via ubuntu-drivers |
| CUDA 13 build on old GPU | Maxwell/Pascal/Volta | Install CUDA 12.x generation |
| VM with no GPU | No device | Bare metal or GPU instance |
Summary
Ubuntu 24.04 installs current CUDA 13 through NVIDIA’s ubuntu2404 network repository: cuda-keyring, sudo apt install cuda-toolkit, then set PATH and verify with nvcc --version. Install or confirm the NVIDIA driver separately—cuda-toolkit does not pull a driver on CUDA 13.4-style packages.
Use cuda-toolkit-13-4 when you need a fixed 13.4 minor; use Ubuntu’s nvidia-cuda-toolkit only when you intentionally want the older multiverse toolchain. For 26.04 archive installs or 22.04 repo paths, see the sibling guides linked in the intro table.
References
- CUDA Installation Guide for Linux
- CUDA downloads (Ubuntu 24.04 selector)
- CUDA-supported GPUs
- CUDA toolkit archive
Frequently Asked Questions
How do I install CUDA on Ubuntu 24.04?
Add NVIDIA’s ubuntu2404 cuda-keyring, run sudo apt update, then sudo apt install cuda-toolkit. Set PATH to include /usr/local/cuda/bin.
Should I use nvidia-cuda-toolkit or cuda-toolkit on 24.04?
Use NVIDIA’s cuda-toolkit from the ubuntu2404 repository for CUDA 13. Use Ubuntu nvidia-cuda-toolkit only when you need the distro’s older multiverse build.
Does CUDA 13 work on Ubuntu 22.04?
Yes. NVIDIA publishes a ubuntu2204 repository for Jammy. This article is 24.04 only—the intro table links the 22.04 guide.
What is the difference between nvidia-smi and nvcc?
nvidia-smi reports driver and GPU status plus the highest CUDA version the driver supports. nvcc reports the installed toolkit compiler version.

