Rebuilding NVIDIA Drivers on Fedora After Updates
If you’re running Fedora with NVIDIA proprietary drivers, you’ve probably run into this situation: screen does not work properly.
The fix is simple, but easy to forget. This post is here so future-you (and others) don’t waste time rediscovering it.
The Command You’re Looking For
sudo akmods --rebuild --force
That’s it.
This command forces a rebuild of kernel modules managed by akmods, including NVIDIA drivers.
When Should You Run It?
Typically, you’ll need this after:
- A kernel upgrade
-
An update of one of these packages:
-
akmod-nvidia -
xorg-x11-drv-nvidia-cuda
-
Why? Because NVIDIA drivers are built as kernel modules, and they must match your currently running kernel. When Fedora updates the kernel, the modules may not yet be compiled for it — or something may have gone wrong during automatic build.
What’s Happening Under the Hood
Fedora uses akmods (Automatic Kernel Module Build Service) to compile kernel modules on your machine.
In theory, this happens automatically in the background after updates. In practice:
- The build may fail silently
- You may reboot too quickly before the build completes
- Dependencies may not be fully ready
Running the command manually ensures everything is rebuilt correctly for your current kernel.
Typical Recovery Workflow
When things are weird after an update:
- Boot into your system (even if degraded)
- Open a terminal
-
Run:
sudo akmods --rebuild --force - Wait for the build to complete
-
Reboot:
sudo reboot