Guide

Install the NVIDIA driver and CUDA on Ubuntu 24.04

Last updated: 1 December 2026

A new GPU server needs the NVIDIA driver before anything can use the card. On Ubuntu this takes a few commands.

Instant VPS from $7.99 a month

See Instant VPS plansHow ordering works

Install the driver

Let Ubuntu pick the recommended driver for your card, then reboot:

sudo apt update
sudo apt install -y ubuntu-drivers-common
ubuntu-drivers devices
sudo ubuntu-drivers install
sudo reboot

Check it works

After the reboot, nvidia-smi should list your GPU. The CUDA toolkit from the Ubuntu repository gives you the compiler:

nvidia-smi
sudo apt install -y nvidia-cuda-toolkit
nvcc --version

Newer CUDA versions

Ubuntu's toolkit package is convenient but not always the newest. If your software needs a specific CUDA version, follow NVIDIA's own repository instructions for your system.

If something goes wrong

Need a GPU server?

See our GPU servers: NVIDIA T4 to H200, built to order, no ID documents, pay with Monero or Bitcoin. Use them within our acceptable use policy.

Questions and answers

Which driver does it choose?
The one Ubuntu marks as recommended for your GPU.

Do I need CUDA for PyTorch?
No. The PyTorch packages bring their own CUDA libraries; you only need the driver.

Can I update the driver later?
Yes, with apt, followed by a reboot.

Does it work on Debian?
The steps differ; this guide is for Ubuntu 24.04.

Related guides

Ready to try it? Instant VPS from $7.99 a month

See Instant VPS plansHow ordering works