Installing nVidia drivers on Fedora

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

First, you will need to download the proper drivers for your nVidia graphics card.  For myself, I picked the 600 Series and the 660 Graphics drivers for Linux. 

Download the required drivers for your system.

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.

run dnf update
# 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

nVidia kernel screen

Installing 32-bit Compatibility Libraries

nVidia 32 bit driver option

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

nVidia drivers being installed on Fedora

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.

Share

Ivan Windon

Ivan Windon is a Site Reliability Engineer at IBM. Ivan is actively engaged in Cloud Technologies with AWS, Google, and Azure. Ivan has extensive experience with Linux and Windows administration, DNS, Networking, IDM, and Security. In his free time, he enjoys being with his wife and two children. The family enjoys hiking, and traveling when able. His favorite locations are Yosemite NPS, and San Francisco, California.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.