How to Fix Black Screen After Installing NVIDIA Drivers on Fedora

Fix Fedora black screen after NVIDIA driver install by reinstalling drivers and regenerating initramfs.

You installed the NVIDIA drivers and the screen stayed black

You installed the NVIDIA drivers from RPM Fusion, rebooted, and the screen stayed black. The fans are spinning, the login manager never appears, and you are staring at a dark monitor. You might be able to switch to a text console with Ctrl+Alt+F3, or you might be completely locked out. This scenario usually happens after a kernel update or a fresh driver installation where the proprietary module failed to compile or was not included in the boot image.

What's actually happening

Fedora updates the kernel frequently. The NVIDIA driver is a kernel module that must match the running kernel exactly. When the kernel changes, the module becomes invalid until it is recompiled. The akmod-nvidia package is designed to handle this automatically using the kmodgen service. This service watches for kernel updates and triggers a build of the driver. However, the build can fail due to missing kernel headers, race conditions during dnf transactions, or Secure Boot restrictions. If the build fails, the module is missing. If the module is missing, the display server cannot start. The result is a black screen.

Think of the kernel as a power socket and the driver as a plug. Fedora changes the shape of the socket every few weeks. The akmod system is a universal adapter that reshapes the plug automatically. If the adapter breaks or runs out of power, the plug no longer fits the socket, and the display gets no power.

The initramfs is the initial ramdisk that loads before the root filesystem. It must contain the NVIDIA module if the root filesystem is encrypted or if the display manager starts early in the boot process. The dracut tool builds this image. If dracut does not run after the module is built, the new driver is not available at boot time. This causes the black screen even if the module exists on disk.

The fix

Here's how to reset the driver stack and force a clean rebuild. Run these commands from a TTY or recovery shell. If you cannot access a TTY, boot into rescue mode or use a live USB to chroot into your system.

# Remove all NVIDIA packages to clear conflicting files and broken build artifacts
sudo dnf remove akmod-nvidia xorg-x11-drv-nvidia-cuda
# Install the akmod package. This triggers a background build of the kernel module
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia
# Rebuild the initramfs to ensure the new module is available during early boot
sudo dracut --force
# Restart the system to load the fresh kernel and driver
sudo reboot

The akmod build runs asynchronously. If you reboot immediately after installation, the build might not have finished. Wait for the kmodgen service to complete before proceeding.

# Check the status of the kernel module generator service
sudo systemctl status kmodgen
# Wait until the service shows "inactive (dead)" or "active (exited)" with no errors

Reboot before you debug. Half the time the symptom is gone after a clean rebuild.

Verify it worked

Verify the driver is loaded. Check the kernel modules and the journal logs.

# Confirm the nvidia module is loaded in the kernel
lsmod | grep nvidia
# Check the journal for driver initialization messages
journalctl -xe | grep -i nvidia

The lsmod command should show nvidia, nvidia_uvm, and nvidia_drm modules. The journal should show messages like NVRM: loading NVIDIA UNIX x86_64 Kernel Module. If you see NVRM: failed to load, the driver did not initialize. Check the pitfalls section below.

Run lsmod before you panic. If the module is there, the display manager is the problem, not the GPU.

Common pitfalls and what the error looks like

Secure Boot blocks unsigned kernel modules. Fedora's akmod system attempts to sign the module using a Machine Owner Key (MOK). If the MOK is not enrolled in the firmware, the kernel rejects the module. This is the most common cause of black screens on systems with Secure Boot enabled.

kernel: NVRM: The NVIDIA kernel module is not loaded.
kernel: NVRM: This can occur when the kernel is updated and the module has not been rebuilt.
kernel: NVRM: The NVIDIA kernel module is not loaded because Secure Boot is enabled.

Check the Secure Boot status and enrolled keys.

# Check if Secure Boot is active in the current boot
mokutil --sb-state
# List enrolled MOK keys to see if the akmod signing key is present
mokutil --list-enrolled

If Secure Boot is enabled and the key is missing, you must enroll the MOK. The enrollment process usually triggers during the first akmod installation. If it was skipped or failed, run sudo mokutil --import /var/lib/shim-signed/mok/MOK.der and follow the prompts to set a password. Reboot and enroll the key in the MOK manager screen.

The open-source nouveau driver can conflict with the proprietary NVIDIA driver. If nouveau loads, it locks the GPU and prevents the NVIDIA module from attaching. The akmod package should blacklist nouveau automatically, but the configuration file can be missing or malformed.

journalctl -xe | grep -i nouveau
kernel: nouveau 0000:01:00.0: enabling device (0000 -> 0003)
Xorg.0.log: (II) modeset(0): using drv /dev/dri/card0

Verify the blacklist configuration. Convention aside: config files in /etc/ are user-modified. Files in /usr/lib/ ship with the package. Edit /etc/modprobe.d/blacklist-nouveau.conf. Never edit /usr/lib/modprobe.d/. Package updates overwrite /usr/lib/ and destroy manual edits.

# Check if the blacklist file exists and contains the correct directives
cat /etc/modprobe.d/blacklist-nouveau.conf
# Verify nouveau is not currently loaded
lsmod | grep nouveau

The file should contain blacklist nouveau and options nouveau modeset=0. If the file is missing, create it with those lines and run sudo dracut --force.

Missing kernel headers can cause the akmod build to fail silently. The kmodgen service logs errors to the journal. Check for build failures.

# Check the kmodgen logs for compilation errors
journalctl -u kmodgen
# Look for "make: *** [nvidia.ko] Error 1" or "kernel headers not found"

If headers are missing, install the kernel-devel package matching the running kernel.

# Install headers for the current kernel version
sudo dnf install kernel-devel-$(uname -r)
# Retry the akmod build
sudo dnf reinstall akmod-nvidia

Convention aside: journalctl -xe reads better than journalctl alone. The x flag adds explanatory text and the e flag jumps to the end. Most sysadmins type journalctl -xeu <unit> muscle-memory style. Use that pattern to isolate service logs quickly.

Convention aside: dnf upgrade --refresh is the normal weekly maintenance command. dnf system-upgrade is for crossing major Fedora releases. They are different commands. Don't conflate them. Running dnf upgrade --refresh ensures metadata is fresh and reduces dependency resolution errors.

Check Secure Boot status in BIOS. If it is enabled, the driver cannot load without a signed MOK. Disable Secure Boot or enroll the key.

When to use this vs alternatives

Use akmod-nvidia when you want the driver to rebuild automatically after kernel updates. Use kmod-nvidia when you need a pre-built binary for a specific kernel version and cannot compile on the target machine. Use the open-source nouveau driver when you need out-of-the-box compatibility and do not require 3D acceleration or CUDA. Use the proprietary driver when you are gaming or running GPU compute workloads. Stay on the upstream Workstation defaults if you only deviate from the defaults occasionally.

Where to go next