Website Vidya
Linux & ServersStep-by-Step Guide

How to Install Nvidia Drivers on Ubuntu 24.04 LTS

Step-by-step guide to install Nvidia drivers on Ubuntu 24.04 LTS using ubuntu-drivers, official PPA, Secure Boot MOK enrollment, and nvidia-smi.

RR
Rajesh RayLead Systems Educator
Published:
6 min read
PDF Cheat Sheet
How to Install Nvidia Drivers on Ubuntu 24.04 LTS
AI Executive SummaryWebsiteVidya AI

6 min read

Step-by-step guide to install Nvidia drivers on Ubuntu 24.04 LTS using ubuntu-drivers, official PPA, Secure Boot MOK enrollment, and nvidia-smi.

Key Highlights
  • Prerequisites and Supported Releases
  • Step 1: Identifying Your Nvidia GPU Model and Current Active Driver
  • Step 2: Preparing System Packages and Installing Build Tools
Grounded in full engineering runbookWebsiteVidya AI Engine

Whether configuring an AI machine learning workstation, high-performance video editing suite, or dedicated Linux gaming rig, knowing how to install nvidia drivers on ubuntu 24.04 is crucial for unlocking your hardware's full computing power. Ubuntu installs the open-source Nouveau display driver by default, which provides basic 2D display functionality but lacks modern 3D graphics acceleration, clock speed management, and CUDA compute framework support.

Ubuntu 24.04 LTS streamlines proprietary driver deployment through automated driver detection utilities, kernel Dynamic Kernel Module Support (DKMS), and tight integration with UEFI Secure Boot. This guide covers automated installation via standard repositories, bleeding-edge driver deployment through the official graphics PPA, Secure Boot key enrollment, and GPU performance verification.

Prerequisites and Supported Releases

This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat) & Ubuntu 22.04 LTS. The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.

Advertisement

Before proceeding, ensure you have the following requirements satisfied:

  • A desktop, workstation, or server equipped with an Nvidia GeForce, Quadro, RTX, or Tesla graphics card.
  • An active installation of Ubuntu 24.04 LTS with administrative sudo privileges.
  • An active Internet connection to download driver packages and kernel modules.
  • Access to system reboot and physical display (or IPMI/KVM console for headless servers).

Step 1: Identifying Your Nvidia GPU Model and Current Active Driver

If the output indicates Kernel driver in use: nouveau, your system is running the reverse-engineered open-source driver. If no driver is listed or an existing Nvidia driver requires updating, proceed to system preparation.

# Identify your graphics controller and currently loaded driver module
lspci -k | grep -EA3 'VGA|3D'

# Example output on an Nvidia RTX system:
# 01:00.0 VGA compatible controller: NVIDIA Corporation AD106 [GeForce RTX 4060 Ti] (rev a1)
# 	Subsystem: ZOTAC International (MCO) Ltd. Device 2670
# 	Kernel driver in use: nouveau
# 	Kernel modules: nvidiafb, nouveau

Step 2: Preparing System Packages and Installing Build Tools

Proprietary Nvidia drivers compile kernel interface modules directly against your running Linux kernel headers. Missing compiler dependencies or outdated kernel headers can lead to failed driver installations or broken boot configurations.

Update your package index and install build-essential, dkms, and matching kernel headers.

Advertisement
# Update repository cache and upgrade existing packages
sudo apt update && sudo apt upgrade -y

# Install compilation prerequisites and dynamic kernel module support
sudo apt install -y build-essential dkms linux-headers-$(uname -r)

The utility outputs a list of candidate packages, such as nvidia-driver-535, nvidia-driver-550, or open-kernel variations, clearly tagging the tested option with the label recommended.

# Scan hardware and list recommended proprietary driver packages
ubuntu-drivers devices

For maximum stability and guaranteed compatibility with Ubuntu kernel security updates, install the recommended driver identified by Canonical.

You can allow ubuntu-drivers to automatically install the optimal package, or install your preferred driver branch explicitly using APT.

# Option A: Automatically install the recommended driver package
sudo ubuntu-drivers install

# Option B: Or install a specific driver branch explicitly (e.g., driver 550)
sudo apt install -y nvidia-driver-550 nvidia-utils-550

Proprietary vs Nvidia Open-Kernel Drivers

On newer Turing, Ampere, Ada Lovelace, and Hopper architectures (RTX 2000 series and newer), Nvidia provides open-source kernel modules designated with the -open suffix (e.g., nvidia-driver-550-open).

Advertisement

For consumer desktop gaming and workstation applications, both standard proprietary and open-kernel variants perform identically. If you operate enterprise data center GPUs or prefer open-source kernel components, choose the open-kernel branch.

Step 5: Method 2 — Installing Cutting-Edge Drivers via Graphics PPA

Once you identify the target version (such as nvidia-driver-555 or nvidia-driver-560), install the driver and utility package using apt install.

# Add the official Graphics Drivers PPA
sudo add-apt-repository ppa:graphics-drivers/ppa -y

# Refresh package index
sudo apt update

# Inspect the latest driver branches available in the PPA
apt-cache search '^nvidia-driver-[0-9]+$' | sort -V

Step 6: Handling UEFI Secure Boot and Enrolling the MOK Key

After confirming the password on the blue MOK management screen, choose Reboot. Ubuntu will boot normally, and the kernel will securely load the verified Nvidia drivers.

StageUser ActionTechnical Operation
1. Debconf PromptEnter a temporary passwordCreates a local private/public MOK certificate pair and signs the compiled nvidia.ko module.
2. Confirm PasswordRetype temporary passwordStores the certificate in NVRAM ready for firmware validation upon the next reboot.
3. Reboot ComputerExecute sudo rebootTransfers execution to the blue UEFI Shim / MOK management screen.
4. Blue Shim MenuSelect 'Enroll MOK' > 'Continue'Validates the certificate signature with your temporary password.

Step 7: Verifying Driver Installation with nvidia-smi

The output table displays your Driver Version, supported CUDA Version, active GPU model, running processes, current temperature, and VRAM utilization. If this table renders without errors, your driver is operational.

# Query the GPU status and driver version
nvidia-smi

Step 8: Configuring Hybrid Graphics on Laptops with prime-select

Laptops equipped with dual GPUs (integrated Intel/AMD processor graphics and discrete Nvidia GPU) use Ubuntu's PRIME display multiplexing framework to balance battery life against performance.

You can query and toggle graphics modes using the prime-select command.

# Check current graphics profile
prime-select query

# Set to on-demand mode (uses integrated GPU normally, offloads heavy 3D apps to Nvidia)
sudo prime-select on-demand

# Force full-time discrete Nvidia GPU (maximum performance)
sudo prime-select nvidia

# Force integrated power-saving GPU (maximum battery life)
sudo prime-select intel

Troubleshooting and Common Errors

When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:

Black screen or blinking cursor after rebooting.

Cause: Nouveau driver conflict or Wayland display manager compatibility issue on older hardware.

Resolution: Switch to a TTY virtual console by pressing Ctrl+Alt+F3, log in, ensure Nouveau is blacklisted, and switch GDM to X11 mode by editing /etc/gdm3/custom.conf.

sudo sed -i 's/#WaylandEnable=false/WaylandEnable=false/' /etc/gdm3/custom.conf

nvidia-smi outputs: 'NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver'.

Cause: Kernel modules were not loaded, often caused by missed Secure Boot MOK enrollment or missing kernel headers.

Resolution: Check Secure Boot status via mokutil --sb-state and rebuild the DKMS modules for your current kernel.

sudo dkms autoinstall

System resolution is locked at low 640x480 or 1024x768 resolution.

Cause: Kernel modesetting (DRM KMS) is disabled or the driver fell back to standard VESA software rendering.

Resolution: Enable Nvidia DRM modesetting in your GRUB default configuration and update GRUB.

echo 'options nvidia-drm modeset=1' | sudo tee /etc/modprobe.d/nvidia-graphics-drivers.conf && sudo update-initramfs -u

Security Best Practices and Hardening

Always install graphics drivers through official Ubuntu repositories or verified Launchpad PPAs.

Do not execute .run installer shell binaries downloaded directly from the web, as manual .run scripts bypass package managers and break silently during kernel updates.

Deepen your Linux system administration skills with our related production-tested guides:

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

4 FAQs
No. Installing via the manual .run file is strongly discouraged on Ubuntu. It overwrites system OpenGL libraries, lacks DKMS kernel tracking by default, and frequently breaks your graphical desktop whenever an automated kernel security update is applied. Always use ubuntu-drivers or APT packages.
Yes. Ubuntu 24.04 LTS defaults to Wayland with modern Nvidia 535+ and 550+ drivers. With recent driver branches, explicit sync protocols ensure smooth, tear-free rendering on Wayland desktop environments.
Execute sudo apt purge '*nvidia*' followed by sudo apt install --reinstall xserver-xorg-video-nouveau and reboot your computer.
The proprietary Nvidia driver package installs the necessary CUDA user-space driver libraries (libcuda.so). However, if you need the full CUDA development toolkit (including nvcc), you can install it via sudo apt install -y nvidia-cuda-toolkit.
RR
Written byVerified Author

Rajesh Ray

I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout