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)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. (Ubuntu Documentation)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.

  1. Update system sudo apt update sudo apt upgrade
  2. Check current driver version (if any) cat /proc/driver/nvidia/version
  3. List drivers available for your hardware
    • For generic desktop/gaming: sudo ubuntu-drivers list
    • For server / GPGPU / compute workloads: sudo ubuntu-drivers list --gpgpu
    You’ll see something like nvidia-driver-535, nvidia-driver-535-server, etc.
  4. Install the driver
    • To let Ubuntu pick the best match (desktop/gaming): sudo ubuntu-drivers install
    • To install a specific version: sudo ubuntu-drivers install nvidia:535
    • For server / compute: sudo ubuntu-drivers install --gpgpu or specify version + -server: sudo ubuntu-drivers install --gpgpu nvidia:535-server
  5. 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)
  6. Reboot
    After installation, reboot to ensure the driver modules get loaded. sudo reboot
  7. Verify installation
    Use commands like: nvidia-smi to check GPU is recognized, see driver version, etc.

⚠️ Handling Secure Boot

If Secure Boot is active:

  • The kernel module you install must be signed. Ubuntu’s packaged drivers usually handle this.
  • If using manual / external installers or if you build your own modules (via DKMS), you’ll likely need to enroll a MOK (Machine Owner Key).

🧹 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. Optionally clean up configs or leftover kernel modules.
  3. 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?