nVidia and Fedora
When you install a fresh copy of Fedora it will not come by default with nVidia drivers, and you need to do a few things in order to get the correct resolution on your system. This article covers downloading the drivers, and the needed changes to get a working system.
Note: This article is taken from a previous post I made on another blog a number of years back. So the screenshots shown are from Fedora 23. The process involved still applies though.
Downloading the Nvidia Graphic Drivers
Once the package has been downloaded you will need to make it executable with the command:
# chmod +x /path/to/NVIDIA-Linux-*.run.
Next change to root with the su – command for the rest of the steps. Run dnf update to make sure everything is up to date on the OS. There are some dependencies that will be needed, so we will need to install those first.
# dnf install kernel-devel kernel-headers gcc dkms acpid
The next step is to disable nouveau by editing the /etc/modprobe.d/blacklist.conf and appending blacklist nouveau. Use the command:
# echo \"blacklist nouveau\" >> /etc/modprobe.d/blacklist.conf
Next, we will edit /etc/sysconfig/grub and append rd.driver.blacklist=nouveau to the end of the GRUB_CMDLINE_LINUX=…
GRUB_CMDLINE_LINUX=\"rd.lvm.lv=fedora/swap rd.lvm.lv=fedora/root rhgb quiet rd.driver.blacklist=nouveau\"
Update grub2 conf with the command
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Now we can remove xorg-x11-drv-nouveau with the command
# dnf remove xorg-x11-drv-nouveau
Next, we generate the initramfs with the following commands:
# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img # dracut /boot/initramfs-$(uname -r).img $(uname -r)
We are now ready to install the nVidia drivers, so we can set Fedora to runlevel 3.
# systemctl set-default multi-user.target # reboot
The GUI will not load this time, so just log in as your user account, and then switch to root once you are logged in. Change to the directory where you stored the nVidia installation file and run it with ./NVIDIA-Linux-*.run
First we accept the License agreement
Nvidia Installer Registered the Kernel Source Modules with DKMS
Installing 32-bit Compatibility Libraries
This will depend on your own situation, I picked yes in order to support any 32-bit application I might be running on my system.
Drivers being installed
The last two screens are the Xorg backup and the completion screen. Choose yes for the backup as this will allow the nVidia drivers to be loaded after reboot, and the previous configuration to be backed up. Once this is done you’ll receive the completion page, at which point you will be finished with the driver installation.
You will need to change the runlevel back and reboot again.
# systemctl set-default graphical.target # reboot
You can install VDPAU / VAAPI support if you have Gforce 8 or higher. To do so, run the command:
# dnf install vdpauinfo libva-vdpau-driver libva-utils
After you are logged back into the system you will notice that the resolution is now properly set, and you’ll have an nVidia control panel in which you can make adjustments if needed.
This process again is not overly difficult, however, it does take time to properly go through the steps to ensure a successful installation. So take your time and all should work out for you.
A side note: I noticed that when you update the kernel over time the gui will no longer load. To resolve the problem you will need to use wget to pull down the latest driver version from nVidia, and then re-run the installation process. If you plan ahead you can download the newest drivers before running the dnf update process.