Installing NVIDIA Drivers on AlmaLinux 9: A Practical How‑to
If you’ve got an NVIDIA GPU in your AlmaLinux 9 machine and want the full performance boost, this guide walks through installing the official driver stack step by step. We’ll cover repository setup, kernel module handling, and a quick sanity test so you know everything’s wired up properly.
1. Check Your Kernel Version
uname -r
Why it matters: The NVIDIA driver ships a pre‑compiled module for a specific kernel series. If your kernel is older or too new, the module may not load and you’ll end up with a black screen. On AlmaLinux 9 the default kernel is 6.1.x, which the latest drivers support out of the box. If you see something like 4.18 or 5.10, it’s time to update your system first.
2. Enable RPM Fusion Repositories
sudo dnf install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm \
https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm
Why it matters: RPM Fusion hosts the akmod-nvidia package that builds the driver kernel module on your machine. Without these repos you’ll be stuck with an old driver or no NVIDIA support at all. I’ve seen users try to pull drivers from third‑party sites and end up with a broken X session—skip it.
3. Install the Driver Package
sudo dnf install akmod-nvidia kmod-nvidia xorg-x11-drv-nvidia xorg-x11-server-Xorg
Why it matters: akmod‑nvidia automatically compiles the driver against your current kernel, while kmod‑nvidia provides precompiled modules for common kernels. Installing both ensures you’re covered if you update or downgrade your kernel later. The X server package is needed to start a graphical session with NVIDIA acceleration.
4. Disable Nouveau and Reboot
Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following lines:
blacklist nouveau options nouveau modeset=0
Then run:
sudo dracut --force sudo reboot
Why it matters: Nouveau, the open‑source NVIDIA driver, conflicts with the official binary. Leaving it enabled will prevent your new driver from loading and you’ll be stuck on a black screen or Xorg error logs. The dracut step rebuilds the initramfs so the blacklist takes effect before the kernel boots.
5. Verify Installation with nvidia‑smi
nvidia-smi
You should see something like:
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 535.86 Driver Version: 535.86 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ ...
If you get an error, double‑check that Nouveau is blacklisted and that the kernel module /lib/modules/$(uname -r)/updates/dkms/nvidia.ko exists.
That’s it. Your AlmaLinux 9 machine should now be running the official NVIDIA driver with full acceleration. Give it a whirl and drop me a comment if you hit any hiccups!