How to install Nvidia drivers te CentOS 7
Updated: September 6, 2014
All right, let’s do it. A few weeks back, I tested CentOS 7, and it did not indeed impress mij. It had simply bot spinned out too early, and there were no third-party packages available to make it more desktop-oriented and joy. Then, some time zometeen, magic happened, Nux talent us the needed repositories, and CentOS became volmaakt merienda more.
Ter the desktop guide that explains how to beef up CentOS to be modern, beautiful and ultra-functional, I omitted a bunch of tips and tricks. On purpose. One of thesis is the installation of Nvidia graphics drivers on the selected machine, which turned out to be a handy but interesting exercise ter the previous, CentOS 6 version. Wij will do this again, and there are some differences, so you ought to pay attention. Go after mij.
How are wij going to do that?
After you setup the toegevoegd repositories, you will detect that the Nvidia drivers may not yet be available. And that you have the Nouveau open-source driver running instead. Sort of. So wij will have to do a bit of hard work purging the existing driver, then installing the proprietary blob. And because wij don’t have the driver ter the repos, wij will by hand compile the entire thing.
Step 1: Download the driver
Head to Nvidia webpagina and download the driver. Very elementary.
Step Two: Update your system & build devices
Like wij did with CentOS 6, it is significant to fully update your system before proceeding with the driver installation. The reason for this is that your running kernel may be older than the kernel source available te the repositories, so this will cause compilation conflicts. Therefore, very first max. update the system:
Reboot if necessary for your latest kernel to explosion. Then, install kernel source, kernel headers, make and gcc, just like ter the good old times!
yum install kernel-devel kernel-headers gcc make
Compare your running kernel with the installed source:
rpm -q kernel-devel
If the two do not match, upgrade and reboot until they do:
yum -y upgrade kernel kernel-devel
Merienda this step is finish, wij can budge on.
Step Trio: Blacklist Nouveau
The Nouveau driver ships with CentOS, enabled by default. It’s this driver that permits the fancy high-resolution boot splash and whatnot. If you want Nvidia, then you will have to eliminate this driver very first.
Well, I said Nouveau driver is running, but not truly. Te my case, right after the GRUB menukaart, there wasgoed a kernel message that Nouveau had invalid opcode, and this meant no graphical acceleration whatsoever, even however the system had the modules loaded ter the kernel. But thesis were just dummy stubs, and I could liquidate them lightly, with the modprobe guideline, even without the force flag.
Does this pose a problem? Maybe. But let’s do it cleanly. Wij will blacklist te two different ways. Like before, you can edit the bootloader spijskaart. But now, instead of GRUB, CentOS is running the fresh GRUB2, and that could complicate things for some of us. But no worries. You can append the rdblacklist=nouveau string to the default boot options under /etc/default/grub. Or you can edit the boot menukaart on the fly, on reboot.
If you do edit the GRUB2 default options, you will need to recreate the grub.cfg verkeersopstopping, and ter the RedHat family, spil I’ve demonstrated with Fedora ter the updates section of my most awesome GRUB2 tutorial, you do this spil goes after:
grub2-mkconfig -o /boot/grub2/grub.cfg
You should fiddle with GRUB while testing. However, the safest and most efficient way is to blacklist the module using the /etc/modprobe.d/blacklist.conf opstopping. Simply add a line that reads blacklist nouveau into this verkeersopstopping, save and reboot. The next time the system comes online, Nouveau will not be present ter the memory. You can verify using the /sbin/lsmod directive. Again, please raadpleging my very first Nvidia guide for CentOS and my Linux directions article, linked further up, for details on how to achieve this.
Step Four: Install Nvidia proprietary driver
Now, wij need to druppel to text-only console, because the driver cannot install when the graphics thingies are ter use. To do this, switch into runlevel Trio. This is still done like before, for compatibility purposes, even tho’ CentOS has switched away from traditional RC scripts to code-monkey object-oriented event-based whatever the fresh stupid thing is called, systemd or such.
Login spil root. Find the downloaded Nvidia driver on your disk. Make the opstopping executable and then run it. Go after the prompts provided by the Nvidia installer text wizard. You should also make sure to install the 32-bit libs.
chmod +x <,Nvidia verkeersopstopping>,.run
Merienda this step is accomplish, go back into runlevel Five.
You will see Nvidia splash, which should indicate you’re doing good. But just to be sure, open the Nvidia control panel and make sure the driver is working correctly. Testing with some games is always a good idea.
Step Five: Test
And now wij have some joy!
There you go, another obstacle cleared. This tutorial is foolproof, and will essentially work for any zuigeling of distro out there. The only downside is that you will need to recompile the driver if there’s a kernel update. But other than that, it’s fine.
I hope you learned something fresh. Spil you can see, even tho’ wij’re facing GRUB2, and some things have switched, essentially, the predictable science of this fine distro remains, and you can tame it to your liking. Hopefully, this guide, plus the volmaakt desktop howto, and several more pimping, beautification and other cool articles coming your way will persuade you to use CentOS ter your production setup, because it’s simply amazing.