How To Install NVIDIA Drivers on Fedora 45

Install NVIDIA Drivers on Fedora 45

Fedora ships with Nouveau, the open-source driver, and it is fine for a login screen. It is not fine for a game running at 144 Hz, a CUDA job, or a dual-monitor workstation that needs working power management. A new Fedora release is a good moment to fix this. The fix is simple, but a few details decide whether you get a working desktop or a black screen after reboot.

The tricky part is rarely the install command. It is the ordering. Secure Boot keys have to exist before the kernel module is built. The system has to be fully updated before the driver is added. The build has to finish before you restart. Skip one of those and the machine boots to a blinking cursor, which is a poor way to spend a Friday afternoon.

This guide covers the method that fits Fedora best: RPM Fusion’s akmod-nvidia package. It rebuilds the kernel module on your machine whenever a new kernel arrives, so routine updates do not break the graphics stack. It also covers Secure Boot enrollment, CUDA and video acceleration, verification, tuning for Wayland, and troubleshooting. Servers and workstations get the same treatment, because the failure modes are mostly the same.

Fedora’s own documentation points to RPM Fusion for this job. RPM Fusion’s NVIDIA page states that with Secure Boot enabled you must sign the kmod, and that this has to happen before installing it, or the driver is disabled and you get a blank screen.

Before You Start: Check Your Hardware and State

Spend two minutes here. It saves an hour later.

Identify the GPU generation

The driver branch depends on the card. Current RPM Fusion packages cover GeForce 16 series, RTX 20 series and newer. GeForce 800, 900 and 10 series cards need the older 580xx branch, and anything older needs a legacy driver. Check what you have:

sudo dnf install -y pciutils
lspci -nn | grep -i nvidia

Look at the model name and the PCI ID in brackets. If the card is Pascal or Maxwell, stop and read the legacy section near the end before running the standard commands.

Check Secure Boot

mokutil --sb-state

If it says SecureBoot enabled, follow the signing steps below. If disabled, skip them. Many laptops and nearly every OEM desktop ship with Secure Boot on, so do not assume.

Update everything first

sudo dnf upgrade --refresh -y
sudo systemctl reboot

The reboot matters. RPM Fusion’s guidance is to update and reboot if you are not on the latest kernel. Building a module against a kernel you are no longer running is a classic source of confusion later.

Step 1: Enable the RPM Fusion Repositories

NVIDIA’s proprietary driver cannot be shipped in Fedora’s own repositories, so it lives in RPM Fusion Nonfree. The command below uses rpm -E %fedora to fill in the release number, so it works on Fedora 45 and on the next release too:

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

Confirm the repos are active:

dnf repolist | grep -i rpmfusion

You want to see the nonfree repository and the nonfree updates repository. The updates repo matters more than it looks. A recent Fedora forum thread about a failing NVIDIA module build was resolved by making sure rpmfusion-nonfree-updates was available, which supplied driver 620.70.06 compatible with the newer kernel. New kernels sometimes land before the driver in the stable repo catches up, and the updates repo is where the fix appears first.

Step 2: Secure Boot Signing (Skip If Disabled)

Secure Boot refuses to load unsigned kernel modules. The NVIDIA module is built locally, so it has no vendor signature. The solution is to create your own key, enroll it in firmware, and let akmods sign every build with it.

Install the signing tools

sudo dnf install kmodtool akmods mokutil openssl

Generate the key

sudo kmodgenca -a

This creates a certificate and private key under /etc/pki/akmods/. Treat the private key like any other credential. Do not copy it into a repo or a shared backup bucket.

Enroll the public key

sudo mokutil --import /etc/pki/akmods/certs/public_key.der

You will be asked for a one-time password. It can be short, because it only lives until the next boot. Write it down for the next two minutes.

Reboot into the MOK manager

sudo systemctl reboot

A blue screen appears. Choose Enroll MOK, then Continue, then Yes, and type the password. The machine then boots normally.

On a headless box or a remote machine, this step is the reason to plan ahead. The MOK screen needs someone at the console or a working IPMI/KVM session. Enrolling a key over SSH alone is not possible.

Verify after boot:

mokutil --list-enrolled | grep -i -A3 "akmods\|Issuer"

Step 3: Install the NVIDIA Driver

Now the main event.

sudo dnf install akmod-nvidia

For CUDA, NVDEC and NVENC support, add the CUDA user-space package:

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

Both are documented in RPM Fusion’s guide. A more complete one-liner, used in several community guides, also pulls in the toolchain, 32-bit libraries for Steam and Wine, and the VA-API bridge:

sudo dnf install gcc kernel-headers kernel-devel akmod-nvidia \
xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs.{i686,x86_64} \
libva-nvidia-driver.{i686,x86_64} xorg-x11-drv-nvidia-cuda

Wait for the module build

This is where people get burned. The package installs quickly, but the kernel module compiles in the background afterward. Fedora’s docs say plainly that you should wait a few minutes before rebooting. Check progress:

modinfo -F version nvidia

If this prints a version number, the module exists. If it errors with “Module nvidia not found”, the build is still running or has failed. You can also watch for the compiler:

pgrep -a "akmods|cc1|make"

When nothing is running and modinfo returns a version, you are safe to restart.

Force a build if you want certainty

sudo akmods --force
sudo dracut --force

The first command rebuilds the module for the running kernel. The second regenerates the initramfs so the new module and the Nouveau blacklist are included. This pair is cheap insurance, and it is the first thing worth trying when something looks off.

Step 4: Reboot and Verify

sudo systemctl reboot

After login, run:

nvidia-smi

You should see a table with the driver version, CUDA version, GPU name, temperature, and running processes. Then confirm that the kernel module is loaded and Nouveau is not:

lsmod | grep -E "nvidia|nouveau"

Expect nvidia, nvidia_modeset, nvidia_drm and nvidia_uvm. Nouveau should be absent.

On a hybrid laptop, check which GPU renders what:

glxinfo -B | grep -i "renderer"

Install mesa-demos if the command is missing. Then try the offload variable:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo -B | grep -i renderer

Wayland, DRM Modeset and Display Tuning

Fedora’s default session is Wayland, and NVIDIA’s support there depends on DRM kernel mode setting. Current RPM Fusion packages enable it by default in recent releases, but verifying costs nothing:

cat /sys/module/nvidia_drm/parameters/modeset

Y means it is on. If it prints N, add the argument through GRUB tooling:

sudo grubby --update-kernel=ALL --args="nvidia-drm.modeset=1"

Immutable variants such as Silverblue use rpm-ostree kargs instead, with Nouveau blacklisted too:

sudo rpm-ostree kargs --append=rd.driver.blacklist=nouveau --append=modprobe.blacklist=nouveau --append=nvidia-drm.modeset=1

Suspend and resume

Laptops and desktops that sleep often can lose the GPU state on resume. The NVIDIA services for suspend, hibernate and resume are normally installed with the driver. Check them:

systemctl status nvidia-suspend.service nvidia-resume.service nvidia-hibernate.service

If they are missing or disabled, enable them. A flickering screen after wake is usually this.

Video acceleration

Browsers and media players can decode on the GPU through VA-API using the NVIDIA bridge:

sudo dnf install libva-nvidia-driver

That package is the one RPM Fusion’s codec instructions use as well. Test with vainfo after installing libva-utils.

CUDA and Compute Workloads

xorg-x11-drv-nvidia-cuda provides what nvidia-smi and many applications need, such as NVDEC and NVENC. It is not the full toolkit. If you compile CUDA code with nvcc, RPM Fusion’s documentation says to get the toolkit from NVIDIA’s own repository. Mixing toolkit versions with a driver that is too old is a frequent source of “CUDA driver version is insufficient” errors, so check compatibility:

nvidia-smi | head -4
nvcc --version

The CUDA version in the nvidia-smi header is the maximum the driver supports. The toolkit must not exceed it.

For containers, the usual route is NVIDIA Container Toolkit with Podman. Fedora’s SELinux policy is strict about device access, so expect to add the right labels or use CDI device specs instead of disabling SELinux. Disabling it to make a GPU container work is a shortcut that rarely survives a security review.

Troubleshooting Common Problems

Black screen or no login after reboot

Most often the module was not built, or Secure Boot rejected it. Switch to a TTY with Ctrl+Alt+F3 and run:

modinfo -F version nvidia
sudo journalctl -b | grep -i "nvidia\|module verification"
mokutil --sb-state

Messages about “required key not available” mean the signing key was not enrolled. Redo Step 2. If the module is missing, run sudo akmods --force && sudo dracut --force, then reboot.

nvidia-smi: couldn’t communicate with the driver

The kernel module is not loaded. Compare the running kernel to the module:

uname -r
modinfo nvidia | grep vermagic

If they differ, the module was built for another kernel. Rebuild.

Kernel module fails to build after an update

This happens when a brand-new kernel arrives before the stable driver supports it. The cause is often an API change in the kernel. Confirm the updates repo is enabled, then refresh and update. That approach resolved a recent case on the Fedora forum:

sudo dnf --refresh update
sudo akmods --force

If it still fails, boot the previous kernel from the GRUB menu and hold the kernel back until a new driver lands:

sudo dnf versionlock add kernel kernel-core kernel-modules kernel-devel

Remove the lock with sudo dnf versionlock clear later. Remember it is a temporary measure.

Nouveau still loading

Rebuild the initramfs and confirm the blacklist:

sudo dracut --force
lsmod | grep nouveau

Stuck at a blinking cursor with Secure Boot on

Disable Secure Boot briefly in firmware, boot, and fix signing. Alternatively, boot with nomodeset appended from GRUB to reach a console.

Wrong driver for an older card

If akmod-nvidia installs and the GPU still is not recognized, you likely have a Pascal, Maxwell or older card. The 800, 900 and 10 series need the 580xx package, as noted in current Fedora 45 setup guides:

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

Check RPM Fusion’s page for the exact package names before running this, since legacy branch naming can change.

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.

Related Posts