Keep in mind, this is not the recommended way to install NVIDIA drivers (99.9% of the time the repository provided drivers will work and they are a better choice in near every way possible), it also involves a little bit more general legwork and unexpected issues might arise in specific scenarios. Generally recommended that you know what you’re doing
If you have an issue with the repo drivers (for example at the moment it breaks Wayland on some setups like in my use case) or you want more control over the driver version, you can follow through this little guide. It’s preferred that you have a fresh installation of OM ROME (and without any nvidia stuff installed prior)
-
Update the system with
sudo dnf dsync --refresh
then reboot -
Download https://www.nvidia.com/en-us/drivers/details/237587 (or other version, I’ll be going with 565.77 for this post), set it as executable in file properties or by running chmod +x command
-
Open OM welcome, go to Applications tab > Development > install C/C++ Compilers Suite
-
Open terminal and enter these comments one by one in this exact order
sudo dnf install kernel-desktop-devel
sudo dnf install dkms
(make sure it isn’t trying to install an another kernel, this is a little quirk with the dkms package at the moment of writing this post)
sudo dnf install acpid libglvnd-devel pkgconfig egl-wayland
systemctl set-default multi-user.target
Reboot -
You’ll boot to console mode, login then enter root by
sudo su
. Navigate to the location of downloaded driver (example cd /home/user/Downloads) then run./NVIDIA-Linux-x86_64-565.77.run
When the installer opens, there’ll be some prompts
- If it asks about nouveau, allow it to blacklist the module but skip rebuilding initramfs so it lets you install
- Select Yes if you need 32-bit compatibility libraries
- If it asks about registering with DKMS, select yes (so the driver automatically rebuilds with every new kernel version)
- Select Rebuild initramfs, it’ll fail but ignore that
- Select yes for nvidia-xconfig utility
-
After it’s done, run these commands one by one
echo "options nvidia-drm modeset=1 fbdev=1" >> /etc/modprobe.d/nvidia.conf
dracut --regenerate-all --force
(updates initramfs)
grub2-mkconfig -o /boot/grub2/grub.cfg
systemctl set-default graphical.target
reboot
That’s it, you should be able to login to desktop -
If you want working suspend/sleep, enter these in terminal
sudo su
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1" >> /etc/modprobe.d/nvidia.conf
systemctl enable nvidia-suspend.service
systemctl enable nvidia-hibernate.service
systemctl enable nvidia-resume.service
Reboot
To install a newer driver version you’ll need to
- Download it’s run file
- Enter
systemctl set-default multi-user.target
in terminal then reboot - Run the installer and go through the steps as described before
- Run the dracut and grub-mkconfig commands as described before (every time you install a newer version)
- Enter
systemctl set-default graphical.target
in terminal then reboot
This probably works on Rock as well but I didn’t verify. Feel free to point out anything wrong or left out