Skip to main content

Installing NVIDIA drivers on Linux

In this guide, you’ll learn how to install proprietary NVIDIA drivers on Ubuntu, Debian, Fedora, RHEL, Rocky Linux, AlmaLinux and Arch Linux. It also explains how to verify the installation, configure NVIDIA for Wayland and troubleshoot common errors.

Nouveau or the proprietary NVIDIA driver?

By default, Linux often uses the open-source Nouveau driver. This is integrated into the kernel and requires no additional configuration. Nouveau is sufficient for simple 2D graphics.

However, you will need the proprietary NVIDIA driver for the following functions:

  • CUDA
  • Vulkan
  • NVENC and NVDEC
  • Hardware video decoding
  • Modern power management
  • Wayland compositing in GNOME 46+ and KDE Plasma 6

For graphics cards from the GTX 900 series onwards, or the Maxwell generation, you should use the proprietary NVIDIA driver.

Check the requirements

First, identify the model of the NVIDIA graphics card installed:

lspci -nn | grep -i nvidia

Next, check the kernel version being used:

uname -r

You will need this information to select the correct driver branch.

Info

For most graphics cards from the GTX 900 series onwards, the 550.x branch is recommended. This information is correct as of mid-2025. Kepler-generation graphics cards, such as the GTX 600 and GTX 700, require the 470.xx legacy driver. Even older graphics cards may require the 390.xx branch.


Installing NVIDIA drivers on Ubuntu

The following steps apply to Ubuntu 22.04 and Ubuntu 24.04.

1. Update package sources

sudo apt update
sudo ubuntu-drivers install

Ubuntu detects the graphics card that is installed and installs the recommended driver.

3. View available drivers

To view all available driver packages, run the following command:

ubuntu-drivers list

4. Install a specific driver version

For example, to install the 550 series of drivers, use:

sudo apt install nvidia-driver-550

For a Kepler-generation graphics card, install driver 470:

sudo apt install nvidia-driver-470

5. Restart the system

sudo reboot

Installing NVIDIA drivers on Debian 12

On Debian, the package sources contrib, non-free and non-free-firmware must be enabled.

1. Configuring package sources

Open the file /etc/apt/sources.list.

The relevant line should look like this:

deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware

2. Update package sources

sudo apt update

3. Install the NVIDIA drivers and kernel headers

sudo apt install nvidia-driver firmware-misc-nonfree linux-headers-$(uname -r)

The required DKMS module is created during installation.

4. Restart the system

sudo reboot

Installing NVIDIA drivers on Fedora

The following steps apply to Fedora 39 and Fedora 40. The NVIDIA drivers are installed via the RPM Fusion repository.

Hinweis

Do not use the .run file from the NVIDIA website. This bypasses the package manager and may cause problems following kernel updates.

1. Enable RPM Fusion

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

2. Install the NVIDIA driver

sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda

3. Wait for the kernel module to be created

Please wait two to five minutes after installation. The akmods service is creating the NVIDIA kernel module in the background.

Achtung

Do not restart the system too soon. Otherwise, the NVIDIA module may be missing the next time the system is started.

4. Restart the system

sudo reboot

For Kepler-generation graphics cards, use the akmod-nvidia-470xx package via RPM Fusion.


Installing NVIDIA drivers on RHEL 9, Rocky Linux 9 and AlmaLinux 9

1. Enable RPM Fusion

sudo dnf install https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm

2. Install the NVIDIA driver

sudo dnf install akmod-nvidia

3. Restart the system

Info

Before restarting, wait until the kernel module has been loaded.

sudo reboot

Installing NVIDIA drivers on Arch Linux

Arch Linux provides NVIDIA packages directly via the extra repository.

1. Install the NVIDIA driver

For the latest graphics cards, install the following packages:

sudo pacman -S nvidia nvidia-utils lib32-nvidia-utils

For older Kepler graphics cards, use the nvidia-470xx-dkms package from the AUR.

2. Install the DKMS variant for alternative kernels

If you are using a custom kernel or an LTS kernel such as linux-lts, install the DKMS variant:

sudo pacman -S nvidia-dkms nvidia-utils lib32-nvidia-utils

This means that the kernel module is automatically rebuilt whenever the kernel is updated.

3. Rebuild the initramfs

sudo mkinitcpio -P

4. Restart the system

sudo reboot

Check the installation

Info

After restarting, check whether the proprietary NVIDIA driver has been loaded.

1. View driver information

nvidia-smi

The output should include the following information, amongst other things:

  • Name of the graphics card
  • Installed driver version
  • Supported CUDA version

If the command cannot be found or an error message appears, the NVIDIA module may not have been loaded.

2. Check which NVIDIA modules are loaded

lsmod | grep nvidia

The following modules should appear in this issue:

nvidia
nvidia_modeset
nvidia_drm
nvidia_uvm

3. Check the Wayland session

echo $XDG_SESSION_TYPE

When a Wayland session is active, the command returns wayland.


Configuring the NVIDIA under Wayland

Wayland Support has been significantly improved since NVIDIA driver 495 and kernel 6.2. According to the information provided, GNOME and KDE Plasma work reliably under Wayland from driver 550 and kernel 6.6 onwards.

Check DRM kernel mode setting

For Wayland, the nvidia-drm.modeset=1 parameter must be enabled. Most distribution packages apply this setting automatically.

Check the current value:

cat /sys/module/nvidia_drm/parameters/modeset

The output should read as follows:

Y

Setting kernel parameters in Arch Linux or during a manual installation

Open the file /etc/default/grub and add the following parameter within GRUB_CMDLINE_LINUX_DEFAULT:

nvidia-drm.modeset=1

Next, reconfigure GRUB:

sudo grub-mkconfig -o /boot/grub/grub.cfg

From driver version 555 onwards, explicit synchronisation can also be enabled:

nvidia-drm.explicit_sync=1

This setting may resolve tearing issues in some Wayland compositors.

Managing hybrid graphics on laptops

For laptops with NVIDIA Optimus, use the following tools, depending on your distribution:

  • Ubuntu and Debian: nvidia-prime
  • Fedora: switcheroo-control
  • Arch Linux: optimus-manager from the AUR

Troubleshooting

Black screen after restarting

Use the following keyboard shortcut to switch to a TTY console:

Strg + Alt + F3

Next, check the system log for NVIDIA errors:

sudo journalctl -b -p err | grep -i nvidia
Info

info

On Fedora, this error often occurs if the system has been restarted before akmods has finished loading the kernel module.

:::

Rebuild the module:

sudo akmods --force

Then restart the system:

sudo reboot

NVIDIA module fails to load following a kernel update

DKMS packages should automatically rebuild the kernel module following kernel updates.

On Debian or Ubuntu, you can reconfigure the NVIDIA DKMS package:

sudo dpkg-reconfigure nvidia-dkms-550

On Arch Linux, run the following command:

sudo dkms autoinstall

Secure Boot blocks the NVIDIA module

Under Secure Boot, the NVIDIA kernel module must be signed with a key stored in the UEFI MOK database.

Ubuntu automatically carries out the MOK registration during installation.

Info

With other distributions, you must either Register a Machine Owner Key with mokutil or disable Secure Boot in the UEFI firmware settings.

Nouveau causes a driver conflict

Nouveau is not compatible with the proprietary NVIDIA driver. The distribution’s installation packages usually blacklist Nouveau automatically.

Check whether the relevant configuration is in place:

cat /etc/modprobe.d/blacklist-nouveau.conf

If the file is missing, please create it:

echo -e 'blacklist nouveau\noptions nouveau modeset=0' | sudo tee /etc/modprobe.d/blacklist-nouveau.conf

Next, rebuild the Initramfs.

On Debian and Ubuntu:

sudo update-initramfs -u

On Fedora and RHEL:

sudo dracut --force

Restart the system afterwards:

sudo reboot

Frequently Asked Questions

Should you use the .run installation programme from NVIDIA?

On the distributions described, you should preferably use the packages provided by the respective distribution.

The .run file from the NVIDIA website bypasses the package manager, is not compatible with DKMS and may cause errors following kernel updates.

Does the proprietary NVIDIA driver work with Wayland?

According to the information provided, the driver works reliably from version 550 onwards with kernel 6.6+ under GNOME and KDE Plasma.

The nvidia-drm.modeset=1 parameter must be enabled. From driver version 555 onwards, explicit synchronisation is also available.

Which driver do GTX 600 and GTX 700 series graphics cards require?

Graphics cards from this Kepler generation require the 470.xx legacy branch.

Depending on your distribution, use the following packages:

  • Ubuntu: nvidia-driver-470
  • Fedora: akmod-nvidia-470xx
  • Arch Linux: nvidia-470xx-dkms from the AUR

What can you do if the system fails to start after installation?

Use Strg + Alt + F3 to switch to a TTY console, or use the recovery console.

Next, check for system errors:

sudo journalctl -b -p err

On Fedora, you can rebuild the NVIDIA kernel module:

sudo akmods --force

Restart the system afterwards. If the error persists, uninstall the driver pack and reinstall it.