Tutorials

Install the official driver from nvidia in Fedora

In this little guide I will show how you are able to install the official nVidia.com drivers in Fedora.

Why would you want to install this well I assume when you are reading this you already know the answer to this.

For me I personally I get much better performances with the nVidia.com driver then the Nouveau driver that comes with Fedora.

Well lets start!

Step 1: Check what nVidia card you have, if you already know please skip this and go to Step 2.
$ lspci |grep -i VGA

For me this shows
01:00.0 VGA compatible controller: nVidia Corporation GF460 [GeForce GTX 460] (rev a1)

You need this to confirm the nVidia.com driver will support your card.

Step 2: Go to nVidia.com and download the linux driver for the card you have as seen in Step 1.
Now that we have the driver we need to prepare Fedora so it will no longer use the Nouveau driver, the easiest and most lazy way is to simply blacklist the Nouveau driver so it will no longer start with the system.

Step 3: open /etc/default/grub with your favorith editor I will use VI for the purpose of this guide.
$ vi /etc/default/grub

Now you have this file open you see a line that starts with “GRUB_CMDLINE_LINUX” this is the line we need.

Step 4: Add to the end of the line “GRUB_CMDLINE_LINUX” the following.
rdblacklist=nouveau nouveau.modeset=0

So for me the whole line does look like this now:
GRUB_CMDLINE_LINUX="rd.md=0 rd.dm=0 KEYTABLE=us quiet rhgb rd.lvm.lv=vg_jungle/lv_swap rd.luks=0 rd.lvm.lv=vg_jungle/lv_root LANG=en_US.UTF-8 rdblacklist=nouveau nouveau.modeset=0"

Now do NOT copy my line into your grub file as your sytem wil not boot anymore then I just show it as a example! Your line might look very different but just make sure you add “rdblacklist=nouveau nouveau.modeset=0“.

Step 5: Recreate the grub config file.
$ grub2-mkconfig -o /boot/grub2/grub.cfg

Now we have to restart the pc, normally you should get into gnome with a low resolution however if graphical mode does no longer work do not worry as the following part has to be done all in terminal anyway.

Step 6: Reboot your system
$ Reboot

I am going to assume your system did boot correctly still into graphical mode if not and you are stuck simpely press CTRL+ALT+F2 to open a terminal window.

Step 7: Go into a terminal and SU to root. (only if you use gnome if you use CTRL+ALT+F2 you can directly login as root)
$ su

Step 8: Go to init 3
$ init 3

Step 9: Run the nVidia installer
$ sh NVIDIA-Linux-x86_64-290.10.run

Not sure why but alternative sometimes you have to start it with “./NVIDIA-Linux-x86_64-290.10.run” or “bash NVIDIA-Linux-x86_64-290.10.run”.

Now that you are in the installer answer “yes” to “all” questions this is very important.

Go to Step 10 if you successfully completed the installation.

Step 10: reboot the system
$ reboot

Now when the system starts you should have the graphical desktop run on the official nVidia.com drivers.

How to see if 3D acceleration is working?

Step 11: Open a terminal

Step 12: Check if you have direct rendering
$ glxinfo | grep rendering

The outcome has to be: direct rendering: Yes

For me it does show the following:
Direct rendering: yes
GL_NV_Parameter_buffer_onbject2, GL_NV_path_renedering,

This means your 3D acceleration is working! Congratulations.

Step 13: Test your frame rate
$ glxgears

When you start this it will come up with some wheels spinning around and after a while it will show your fps in the terminal window.

For me it does show the following:
54291 frames in 5.0 seconds = 10858.140 FPS

For me with the nouveau driver the “10858.140 FPS” part was only around “500 FPS” so a big increase.

Well that is it and as always if you have any feedback to improve the guide please let me know and I will update it!

Related posts

Install XenForo 1.4 using Nginx and HHVM on Fedora 21

Sjir Bagmeijer

How to install Elastic Stack 5.4 on Windows Server 2016

Sjir Bagmeijer

logstash-forwarder and grok examples

Sjir Bagmeijer