LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 03-15-2018, 09:49 AM   #1
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: CentOS at the time of this writing, but some others over the years too...
Posts: 2,487

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
HOWTO: Building and Installing The Very Latest Version Of The Proprietary NVIDIA Driver On CentOS 7.4


The following post is a HOWTO guide that describes how to install the NVIDIA proprietary graphics driver on CentOS 7.4

I followed another HOWTO guide but run into some problems, so I decided to write this HOWTO, as the nouveau open source NVIDIA driver does not like my machine anymore in CentOS 7.4 (and borked my system in 7.3, when I updated it) I figured that given I installed the most up-to-date kernel from the "elrepo" site, I may as well have the most recent driver binary blob from NVIDIA. So far, so good too - no more of my kernel log being flooded with error messages from the open source driver.

Some Notes Before You Start:
  • I have *only* tested this on CentOS 7.4 and have not tested this guide on any previous versions of CentOS, or any other Linux distributions. I dare say it will probably work on all CentOS 7.x versions. I would think that a lot of the steps below would be very similar/same on other Linux distributions.
  • This HOWTO guide may not cover all NVIDIA graphics hardware configurations. This guide has been written based on only NVIDIA hardware being used. (eg. just NVIDIA hardware (GPU) - like the GeForce GTX * series, etc) That is fully supported by the NVIDIA driver, that has been downloaded from NVIDIA's website. NVIDIA + Intel graphics/Nvidia optimus/etc graphics configurations require more steps than this guide lists, for that hardware configuration to work under Linux. See this to check which drivers you need, and do this first.
  • If you are new to Linux, you may wish to use a different Linux distro instead of CentOS. As, the following guide assumes you have at least some command-line/terminal experience. You can also install the proprietary driver from NVIDIA themselves via the packages in the "elrepo" repository - the only catch is that it might not be the very latest version.
  • This guide assumes that you wish to use the latest version of the Linux kernel on CentOS, I have not tested it with the default kernel that ships with CentOS. (kernel version 3.x - at the time of this post)
  • This guide also assumes that you have NOT already installed the kernel-ml* packages yet. If you have installed any kernel-ml* packages from the "elrepo" repository, un-install them.
  • You should also update your system before attempting this guide.
  • Remember that you will have to repeat the process below, if you update your kernel version to a newer version. As, the following guide will build the module for the kernel version it's been built against and therefore it will not work with a different version of the Linux kernel.

Preparing Your System:

You need the following packages installed on your system, so that the NVIDIA kernel module can be built; gcc make kernel-devel kernel-headers
You would need to install the kernel-ml-devel kernel-ml-headers packages, instead of the kernel-devel kernel-headers packages if you're using the latest version of the Linux kernel, downloaded from the "elrepo" site.

The versions the kernel*, kernel-devel* and the kernel-headers* packages must be the same, or the driver will not build.

1) Download the latest driver from the NVIDIA website's drivers page. It should have the .run file extension.

2) If you want the latest version of the Linux kernel and haven't installed the "elrepo" repository yet, visit the following site: http://elrepo.org/tiki/tiki-index.php

Have a look under the "Get started" section and follow the directions for your version of CentOS.

3) To install the kernel-ml* packages you need to use the following command:

Code:
yum --enablerepo=elrepo-kernel install kernel-ml*
You can either replace kernel-ml* with the actual package names or just run the above as-is.

If you get package conflicts in yum when trying to install any kernel-ml* packages, run the following command to remove the default version(s) that ship with/are in the CentOS default repositories:

Code:
rpm -e --nodeps package_name
Replace package_name with the actual package name, that yum is saying is conflicting with kernel-ml*.

4) Then as root, give the downloaded file "execute" permission, so you can run it later on and NOT before.

Navigate to where you downloaded the driver from NVIDIA's website and run the following command:

Code:
chmod +x file_name
Replace file_name with the actual name of the .run file you downloaded before.

You can also add the following to your /etc/modprobe.d/blacklist.conf file (if it exists - didn't in my install) as root, but this may not stop the nouveau driver from being loaded at system start-up. (as explained later on in this guide)

Code:
blacklist nouveau
Restart the system.

You can use the GUI to do this or run the following command:

Code:
shutdown -r now
Install The NVIDIA Driver:

5) At the GRUB screen, make sure the menu option to start the kernel you are going to build the driver against, is selected and then press "e". Use the keyboard's arrow keys to go to to the end of the kernel's command-line and type "rdblacklist=nouveau", then press CTRL+X to start the system with that kernel parameter.

You'll see something similar to what's written below:

Code:
linux16 /boot/vmlinuz-4.15.9-1.el7.elrepo.x86_64 root=UUID=14ea7d36-8c7a-4269-a1f1-cb2ec439addb ro
(there maybe different version numbers and/or more kernel parameters for your machine)

It needs to look something like below, with "rdblacklist=nouveau" at the end of the kernel command-line:

Code:
linux16 /boot/vmlinuz-4.15.9-1.el7.elrepo.x86_64 root=UUID=14ea7d36-8c7a-4269-a1f1-cb2ec439addb ro rdblacklist=nouveau
6) Press CTRL+ALT+F2 to enter a virtual console/tty and then login as root. Then run the following command:

Code:
init 3
If the system freezes on you, just goto another virtual console/tty and continue.

7) Navigate to where you have downloaded the driver from NVIDIA's website and then, run the driver's installer program from the ".run" file you downloaded before.

For example;

Code:
./NVIDIA-Linux-x86_64-390.42.run
(the version in the file name above, will probably be different for you)

8) You must run the following command, as if you don't, the system may still load the nouveau open source driver as well. This will cause a conflict with the proprietary NVIDIA driver and thus your GUI will fail to start.

Code:
dracut -f
The above command will rebuild the "initrd" and therefore will hopefully stop the nouveau driver from being loaded.

Then restart you're machine and that should be it!

NOTE: Assuming the above guide has worked for you, don't worry if the splash screen changes to what looks like a "fallback" screen. As, it does not mean that the installation has not worked. You can press ESC to check for any error messages from the kernel, as you're system is starting up.

Let me know if I've missed anything or if there is any problems.
 
Old 05-11-2018, 06:50 AM   #2
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 275
Blog Entries: 1

Rep: Reputation: 124Reputation: 124
Hi jsbjsb001,

I have upgraded to CentOS 7.5 only yesterday, and if you remember, I was having trouble with Nvidia drivers a few days ago.

While I did not follow your guide (stumbled across this today), I did *almost* same steps (minus kernel-ml from elrepo) and can say that this would work on 7.5 too
 
1 members found this post helpful.
Old 05-13-2018, 06:18 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: CentOS at the time of this writing, but some others over the years too...
Posts: 2,487

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Thanks for the information Abe.

It's really just a matter of prepairing your system for building the driver and then getting it into runlevel 3 (SYSVINIT - everything except the GUI), and then building and installing it.

Your reply got me thinking though and I think I can eliminate at least one step (step 6) from the above guide and expand another one. You could also pass the "3" as a kernel parameter after blacklisting the open driver in step 5, and therefore you would already be in init/runlevel 3 once your system has finished systemd's init.

So something like below with "rdblacklist=nouveau" followed by "3" at the end of your kernel parameter/command line;

Code:
linux16 /boot/vmlinuz-4.15.9-1.el7.elrepo.x86_64 root=UUID=14ea7d36-8c7a-4269-a1f1-cb2ec439addb ro rdblacklist=nouveau 3
BTW, I'm glad you got your NVIDIA graphics sorted.
 
  


Reply

Tags
centos, graphics, hardware, nvidia, video


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nVidia proprietary driver error: version.h missing joakim12 Linux From Scratch 10 08-06-2017 01:35 PM
Nvidia wrong resolution after installing proprietary driver huskarl21 Slackware 4 08-01-2014 07:29 AM
[SOLVED] Latest Nvidia driver not working . . . need an older version? Lufbery Slackware 10 09-22-2013 06:17 PM
[SOLVED] Proprietary Nvidia driver not building under 3.10.6 (current fogpipe Slackware 9 08-17-2013 11:51 AM
HOWTO: Install the proprietary nVidia graphics driver in Fedora 13, 14 AwesomeMachine LinuxAnswers Discussion 1 04-02-2011 06:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration