How to Install NVIDIA Drivers on Ubuntu 24.04

How to Install NVIDIA Drivers on Ubuntu 24.04


What you should know first

  • There are two main kinds of NVIDIA driver packages:
    1. Unified Driver Architecture (UDA) โ€” more โ€œgeneral purposeโ€, used for desktops/gaming.
    2. Enterprise Ready Drivers (ERD) / โ€œ-serverโ€ suffix โ€” optimized for servers / compute workloads.
  • If Secure Boot is enabled, youโ€™ll need signed kernel modules or enroll a Machine Owner Key (MOK).
  • Always check which kernel youโ€™re running and make sure kernel headers for that version are installed. Without matching headers, driver modules may fail to compile.

๐Ÿ”ง Installation Methods

Here are the common ways to install, with pros & cons.

MethodProsCaveats
Using ubuntu-drivers tool (recommended Route)Easy, handles dependencies; works well with Secure Boot; automatically picks a compatible driver. (Ubuntu Documentation)Less control over specific version if you need something non-standard.
Manual install via APT packages (nvidia-driver-..., kernel modules, etc.)More control; can pick server vs non-server branch; good for fine-tuning. More steps; risk of mismatch; need kernel headers; Secure Boot handling can be trickier.
run script from NVIDIA websiteSometimes only way to get latest drivers or support for very new/edge hardware.More risk: clashes with packages; you must manage updates yourself; more manual work; not always recommended.

๐Ÿ›  Step-by-Step (Ubuntuโ€™s Recommended Route)

Hereโ€™s a streamlined version using Ubuntuโ€™s ubuntu-drivers tool and APT.

Update system

sudo apt update

Check current driver version (if any) (if you haven’t installed a driver, you can skip this!)

cat /proc/driver/nvidia/version

List drivers available for your hardware (Optional)

For generic desktop/gaming: sudo ubuntu-drivers list

For server / GPGPU / compute workloads: sudo ubuntu-drivers list --gpgpuYouโ€™ll see something like nvidia-driver-535, nvidia-driver-535-server, etc.

Install the driver

sudo ubuntu-drivers install

Reboot.

sudo reboot

After the system has rebooted, the drivers should now be installed and running. Try the nvidia-smi command.

Additional steps for power users. (Optional)

  1. Install additional utils (optional/if needed)
    Especially for server drivers, you might want things like nvidia-utils-<version>, or for special hardware nvidia-fabricmanager or libnvidia-nscq. (Ubuntu Documentation)
  2. Verify installation
    Use commands like: nvidia-smi to check GPU is recognized, see driver version, etc.

Removing / Switching Drivers

If things go wrong, or you want to switch versions:

  1. Purge existing NVIDIA drivers ( sudo apt --purge remove '*nvidia*' sudo apt autoremove )
  2. Then install the new one via above methods.

How useful was this article?

Click on a star to rate it!

We are sorry that this article was not useful for you!

Let us improve this article!

Tell us how we can improve this post?