How to Install NVIDIA Drivers on Ubuntu

Install NVIDIA Drivers on Ubuntu

Installing NVIDIA drivers on Ubuntu can feel like navigating a maze, especially if you’re coming from Windows. But here’s the thing – it doesn’t have to be complicated. Whether you’re a gamer looking to squeeze every frame out of your GPU, a data scientist running CUDA applications, or just someone who wants their system to perform at its best, this guide will walk you through every method to get your NVIDIA drivers up and running.

I’ve been helping people with Linux installations for years, and NVIDIA driver installation is probably the most common question I encounter. The good news? Ubuntu has made this process much more straightforward than it used to be. Let’s dive in and get your graphics card working properly.

Understanding NVIDIA Drivers on Ubuntu

What Are NVIDIA Drivers?

Think of drivers as translators between your operating system and your graphics card. Without the right driver, your expensive NVIDIA GPU is like a sports car without an engine – it looks good but doesn’t perform.

NVIDIA graphics processing units (GPUs) are used for gaming and professional use in offices, data centers, visualization, automobile industry, and artificial intelligence. Your Ubuntu system needs specific software to communicate effectively with this hardware.

Nouveau vs. Proprietary NVIDIA Drivers

By default, Ubuntu uses the nouveau driver – an open-source alternative that works out of the box. However, the nouveau driver generally provides inferior performance to NVIDIA’s proprietary graphics device drivers for gaming and other professional use.

Here’s the key difference:

  • Nouveau drivers: Free, open-source, basic functionality
  • Proprietary NVIDIA drivers: Better performance, full feature support, regular updates

Why You Need NVIDIA Drivers

Installing proper NVIDIA drivers is crucial for users who want to optimize their system’s performance, especially for gaming, 3D rendering, or CUDA-based computations. Without them, you’re missing out on:

  • Gaming performance improvements (often 200-300% better frame rates)
  • CUDA support for machine learning and scientific computing
  • Hardware acceleration for video encoding/decoding
  • Multiple monitor support with advanced features

Prerequisites Before Installation

System Requirements

Before we begin, make sure you have:

  • Ubuntu 16.04, 18.04, 20.04, 22.04, or 24.04 LTS
  • Administrative (sudo) privileges
  • Stable internet connection
  • At least 1GB of free disk space

Checking Your Graphics Card

First, let’s identify what NVIDIA card you have. Open your terminal (Ctrl+Alt+T) and run:

ubuntu-drivers devices

This command will show you your graphics card model and available drivers. You’ll see output similar to:

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002206sv00001458sd0000403Fbc03sc00i00
vendor   : NVIDIA Corporation  
model    : GA102 [GeForce RTX 3080]
driver   : nvidia-driver-470 - distro non-free recommended

The “recommended” tag shows which driver Ubuntu suggests for your hardware.

Internet Connection Requirements

You’ll need a stable internet connection to download drivers. Driver packages can be 200-500MB, so ensure your connection is reliable during installation.

Method 1: Install NVIDIA Drivers Using Ubuntu’s Built-in Tool (Recommended)

This is the easiest and most reliable method. Ubuntu’s ubuntu-drivers tool automatically detects your hardware and installs compatible drivers.

Using the ubuntu-drivers Command

The ubuntu-drivers tool is Ubuntu’s recommended approach because it handles dependencies automatically and ensures compatibility.

Automatic Installation Process

Here’s the complete process:

Step-by-Step Command Line Instructions

  1. Update your system first:
    sudo apt update && sudo apt upgrade -y
  2. Check available drivers:
    ubuntu-drivers devices
  3. Install recommended drivers automatically:
    sudo ubuntu-drivers autoinstall

This command installs all recommended drivers for your system. The process typically takes 3-5 minutes depending on your internet speed.

  1. Reboot your system:
    sudo reboot

That’s it! After reboot, your NVIDIA drivers should be active.

Method 2: Install NVIDIA Drivers via GUI (Beginner-Friendly)

If you prefer a visual approach, Ubuntu’s graphical interface makes driver installation straightforward.

Opening Additional Drivers

The Additional Drivers application is Ubuntu’s built-in driver manager, similar to Windows Device Manager.

  1. Press the Super key (Windows key) on your keyboard
  2. Search for “Additional Drivers” or “Software & Updates”
  3. Click on the application to open it

Alternatively, you can:

  • Open the application menu
  • Navigate to “Settings” → “Software & Updates”
  • Click on the “Additional Drivers” tab

Selecting the Right Driver

In the Additional Drivers window, you’ll see a list of available NVIDIA drivers. The interface shows:

  • Driver versions (like nvidia-driver-535, nvidia-driver-545)
  • Recommended drivers (marked clearly)
  • Open-source alternatives (usually nouveau)

Applying Changes and Restart

  1. Select your preferred driver (usually the recommended one)
  2. Click “Apply Changes”
  3. Enter your password when prompted
  4. Wait for installation to complete (2-3 minutes typically)
  5. Restart your system

The GUI method is perfect if you’re not comfortable with command lines but want the same reliable results.

Method 3: Manual Installation from NVIDIA Website

Sometimes you need a specific driver version or have legacy hardware not supported by Ubuntu repositories.

When to Use This Method

Use manual installation when:

  • You need beta drivers for new games
  • Your GPU is very new or very old
  • You want cutting-edge features
  • Ubuntu repositories don’t have your driver

Downloading the Correct Driver

  1. Visit the NVIDIA Driver Downloads page
  2. Select your GPU model and operating system
  3. Download the .run file (like NVIDIA-Linux-x86_64-550.144.03.run)

System Preparation and Installation

Warning: This method requires more technical knowledge and can potentially cause issues if not done correctly.

Prepare Your System

First, disable the nouveau driver to prevent conflicts:

echo "blacklist nouveau" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
echo "options nouveau modeset=0" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
sudo reboot

Post-Installation Steps

  1. Navigate to your download directory
  2. Make the file executable:
    chmod +x NVIDIA-Linux-x86_64-550.144.03.run
  3. Run the installer:
    sudo ./NVIDIA-Linux-x86_64-550.144.03.run
  4. Follow the installation wizard
  5. Reboot when complete

Method 4: Installing via APT Package Manager

For users who want more control over the installation process, direct APT installation offers flexibility.

Direct APT Installation

If you know exactly which driver you want, you can install it directly:

sudo apt update
sudo apt install nvidia-driver-535

Replace “535” with your desired driver version.

Choosing Specific Driver Versions

Common driver versions include:

  • nvidia-driver-550 (latest as of 2025)
  • nvidia-driver-545 (stable long-term)
  • nvidia-driver-535 (widely compatible)
  • nvidia-driver-525 (older hardware)

You can search for available versions:

apt search nvidia-driver

Method 5: Using Graphics Drivers PPA

Personal Package Archives (PPAs) often have the latest drivers before they reach official Ubuntu repositories.

Adding the PPA Repository

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Installing Latest Drivers

After adding the PPA:

ubuntu-drivers devices
sudo ubuntu-drivers autoinstall

Note: PPAs can be less stable than official repositories, so use them carefully on production systems.

Verifying Your NVIDIA Driver Installation

Using nvidia-smi Command

The nvidia-smi (System Management Interface) command is the standard way to verify your installation:

nvidia-smi

Successful installation shows:

  • GPU model and driver version
  • Memory usage
  • GPU utilization
  • Temperature information

NVIDIA Settings Application

For a graphical interface:

nvidia-settings

This opens the NVIDIA Control Panel where you can:

  • Monitor GPU performance
  • Adjust display settings
  • Configure multiple monitors
  • Check driver version

Performance Testing

Test your installation with:

glxinfo | grep "OpenGL version"

This should show your NVIDIA GPU instead of software rendering.

Troubleshooting Common Issues

Driver Not Loading

If your driver isn’t working after installation:

  1. Check if it’s actually installed:
    lsmod | grep nvidia
  2. Verify in system settings:
    ubuntu-drivers devices
  3. Try regenerating initramfs:
    sudo update-initramfs -u

Black Screen Problems

Black screen issues often relate to driver conflicts:

  1. Boot into recovery mode
  2. Remove conflicting drivers:
    sudo apt purge nvidia* --autoremove
  3. Reinstall using Method 1

Resolving Conflicts

If you have mixed installations causing problems:

sudo /usr/bin/nvidia-uninstall  # For runfile installations
sudo apt autoremove nvidia* --purge  # For APT installations

Uninstalling NVIDIA Drivers

Complete Removal Process

To completely remove NVIDIA drivers and return to nouveau:

sudo apt autoremove nvidia* --purge
sudo apt install xserver-xorg-video-nouveau
sudo reboot

Switching Back to Nouveau

If you need to revert to open-source drivers:

  1. Remove NVIDIA packages:
    sudo apt --purge remove '*nvidia*'
  2. Remove blacklist files:
    sudo rm /etc/modprobe.d/blacklist-nouveau.conf
  3. Update initramfs:
    sudo update-initramfs -u
  4. Reboot

Best Practices and Tips

Keeping Drivers Updated

NVIDIA regularly releases driver updates with:

  • Performance improvements
  • Bug fixes
  • New game optimizations
  • Security patches

Update your drivers monthly using:

sudo apt update && sudo apt upgrade

System Backup Recommendations

Before major driver changes:

  1. Create a system backup using Timeshift
  2. Note your current working driver version
  3. Keep installation media handy for recovery

Pro tip: Always test new drivers with your most important applications before committing to them long-term.

Frequently Asked Questions (FAQs)

Q1: Which NVIDIA driver version should I choose for my Ubuntu system?

A: Use the “recommended” driver shown by the ubuntu-drivers devices command. This is typically the most stable version tested with your specific hardware and Ubuntu version. For gaming, you might want newer versions, but for stability, stick with recommended drivers.

Q2: Can I install NVIDIA drivers on Ubuntu without an internet connection?

A: While possible using downloaded .deb packages or .run files, it’s not recommended for beginners. The ubuntu-drivers tool requires internet access to download dependencies and ensure proper installation. If you must install offline, use the manual NVIDIA .run file method.

Q3: What should I do if my system boots to a black screen after installing NVIDIA drivers?

A: Boot into recovery mode and remove the problematic drivers using sudo apt purge nvidia* --autoremove. Then reinstall using the ubuntu-drivers method. This usually happens due to conflicts between nouveau and NVIDIA drivers or incorrect installation.

Q4: How do I know if my NVIDIA drivers are working correctly?

A: Run nvidia-smi in the terminal. You should see your GPU information, driver version, and memory usage. You can also run nvidia-settings for a graphical interface or check glxinfo | grep "OpenGL version" to verify hardware acceleration is working.

Q5: Is it safe to use the latest NVIDIA drivers from PPAs instead of Ubuntu’s official repositories?

A: PPAs often have newer drivers but may be less stable than official Ubuntu repositories. Use PPAs if you need specific features or better game support, but for production systems or if stability is crucial, stick with Ubuntu’s tested drivers from the official repositories.

Meta Description for WordPress:

Marshall Anthony is a professional Linux DevOps writer with a passion for technology and innovation. With over 8 years of experience in the industry, he has become a go-to expert for anyone looking to learn more about Linux.

Related Posts