How to install Nvidia drivers in CentOS 7 - Tutorial

Discussion in 'all things UNIX' started by Mrkvonic, Sep 6, 2014.

  1. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    More CentOS goodness: this is an important tutorial explaining how to install the Nvidia proprietary drivers in CentOS 7, covering manual download, installation of build essential tools (kernel sources, headers, gcc, make), blacklisting of Nouveau driver in three different ways, GRUB2 menu update, runlevels, Nvidia command-line wizard, testing, and more. Have fun.

    http://www.dedoimedo.com/computers/centos-7-nvidia.html


    Cheers,
    Mrk
     
  2. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    Hi, downloading it right now.
    Is it possible to install easyLife on CentOS just like in Fedora?
     
  3. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    You can try, but I would not advise it. Try the repos and manual installs like I wrote in the desktop guide.
    Mrk
     
  4. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    easyLife does not install on CentOS7.

    I tried following your guide with the Gnome desktop, but I can't even get the two repos added as instructed, yum reports errors and the install fails :(
    # rpm -Uvh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
    Retrieving http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
    curl: (22) The requested URL returned error: 404 Not Found
    error: skipping http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm - transfer failed

    After long and lonely hours, I finally managed to install some repos [nux] using the software interface in the System Tools section.

    Then I downloaded the appropriate Nvidia driver, but even though I added "blacklist nouveau" without quotes in the /etc/modprobe.d/blacklist.conf, Nouveau still loads at startup, so the Nvidia install fails. Boy, CentOS is not very user-friendly to say the least. BTW, chmod +x <mycard>.run does not launch any process at init 3, only ./<mycard>.run does. But to no avail until I remove Nouveau.

    And one more note: Clonezilla fails to backup my CentOS partitions! "extfsclone.c: bitmap error at 1 group"
    I have to resort to dd to back these up. Never had any problem with Windows, openSUSE, Ubuntu and Fedora backup creation, why CentOS?! ext4 partitions, one for / and the other for /home, as usual. Neither works with partclone. Amazing. Repairing the source partitions with Clonezilla does not help.
     
    Last edited: Sep 6, 2014
  5. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    Managed to solve the Clonezilla problem, using Garted from PartedMagic to check/repair partitions. Will never know what went wrong in the first place, but I'm glad now partclone is working on these too. NVIDIA problem still bugging me, though. Thanks for any suggestions on that tough nut.

    Anyone trying to ride CentOS7 besides me!? How does it do?
     
  6. mattdocs12345

    mattdocs12345 Registered Member

    Joined:
    Mar 23, 2013
    Posts:
    1,892
    Location:
    US
    Does it come in xfce?
     
  7. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    Just tried the other approach -- editing the Grub2 default option.
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="vconsole.font=latarcyrheb-sun16 vconsole.keymap=be-latin1 crashkernel=auto rhgb quiet rdblacklist=nouveau"
    GRUB_DISABLE_RECOVERY="true"
    I then recreated the grub.cfg file. All went well... but after reboot, Nouveau is still active. I just can't get Nvidia to install on CentOS7. Worse, I don't understand why it doesn't work.
     
  8. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    Managed to neutralize Nouveau but had to use GrubCustomizer to install the grub.cfg on sda.
    Now back to init 3, but Nvidia install again fails: "NVIDIA-Linux-x86_64-340.32.run Unable to find the kernel source tree for currently running kernel."
    All this despite the fact that kernel and kernel-devel are installed and updated as advised in the guide.
    Can't get it to run on a simple Intel Quad-Core desktop with 8800 GT. Very disappointing.

    I'm sorry to say I do not recommend CentOS for the time being. If you feel adventurous and wanna try for yourself, please make sure to report here. Thanks.
     
  9. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    Maybe you should follow instructions in the guide and then it will work fine.
    Mrk
     
  10. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    Hi Mrkvonic. With all due respect to you and your tutorials -- which I'm in the habit of following with success and much gratitude --, I can't see what's "fullproof" about this specific one. Now, it's highly possible that a newbie like myself managed to make a mistake -- or several -- in following the tuto, in which case I'd be more than happy to correct myself provided I'd be shown where I went south.
    Mattdocs, I know you tried to install CentOS in the past. Did you try again with version 7? Did you manage to go all the way ? I'm stuck with the Nvidia step.
     
  11. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    You could have installed sources FIRST, and then you would get no warning about kernel sources. As written in the tutorial. You could have blacklisted the drivers with blacklist.conf, and as you can see, I did manage all the way. I never write stuff for the fun of it, it's always tested and proven, and screenshots show it. You did not make mistakes - you didn't do certain steps.
    Mrk
     
  12. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    I know that and never doubted you.

    I went through the whole process again with a fresh install.
    Blacklisting nouveau in the blacklist.conf again was not sufficient. I had to blacklist it that way AND also with the grub.cfg. Only then was I able to get nouveau not to load at start-up.

    I double-checked with "uname -r" and with "yum -y upgrade kernel kernel-devel", both versions shown are the same: 3.10.0-123.6.3.el7.x86_64
    But during the Nvidia install, the installer returns this error message: "Your kernel headers for kernel 3.10.0-123.el7.x86_64 cannot be found at /lib/modules/3.10.0-123.el7.x86_64/build or /source"
    There's a "6.3." difference between what NVIDIA looks for and what the system has.
     
  13. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    And this?

    yum install kernel-devel kernel-headers gcc make

    Mrk
     
  14. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    I did it right before double-checking with "uname -r" and with "yum -y upgrade kernel kernel-devel", just as instructed.
     
  15. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    205
    Hi, I kept failing at the Nvidia step. Since Stella is based on CentOS but with additional software already installed, I decided to take a look at it, I noticed that STELLA uses the ElRepo rpm to install the Nvidia drivers and take care of the nouveau removal.

    I went to http://elrepo.org/tiki/tiki-index.php and installed:

    rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

    rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

    Then: yum update

    Then: yum install kmod-nvidia
    Followed by: nvidia-xconfig

    Next, I removed the x.org glamor library in the Software section of CentOS

    Then: Reboot

    The Nvidia card was finally up and running. After two difficult days to get to this point, I know why a graphics card is called a piece of HARDware. Now I can start and enjoy CentOS 7.

    Thanks for the support and kindness MRK. Without your tutorials I'd probably never dare [or think of] and try installing so many new Linux distros on my box. Although I made a small detour this time, nevertheless, it's because you show in your writings that it is possible that I don't get discouraged.

    Regards.
     
  16. peccavi

    peccavi Registered Member

    Joined:
    Jan 20, 2015
    Posts:
    1
    I'm somewhat noobish, so bear with me. I have two machines (laptop and server).

    Laptop:
    (1) On the laptop, I tried this tutorial a few months ago and it worked as advertised. (2) I updated the kernel this past December, which meant I had to reinstall the Nvidia driver again, which I did. After a reboot, the system was hanging before the login screen -- although I could login fine with init 3 appended on the grub, but I never got init 5 to work. So I uninstalled the Nvidia driver, and init 5 was up and running again after a reboot. (3) Today, I updated the kernel again. Just for fun, tried to install the Nvidia driver again, and it worked.

    Server:
    I have never gotten the server to boot to init 5 correctly after installing a downloaded Nvidia driver, or even with yum install kmod-nvidia. Same deal; it hangs after grub executes.

    --> Any ideas as to what could make the system not be able to go into init 5 after installing the latest Nvidia driver?
     
  17. SAustn2

    SAustn2 Registered Member

    Joined:
    Oct 12, 2010
    Posts:
    72
    Location:
    Northeast Texas
    @Mrkvonic In a lot of your Distribution reviews I see that you usually install proprietary graphics drivers. What benefits do you get from those instead of using X.Org X server?
     
  18. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    Performance, speed, everything :)
    Mrk
     
  19. SAustn2

    SAustn2 Registered Member

    Joined:
    Oct 12, 2010
    Posts:
    72
    Location:
    Northeast Texas
    Well maybe Nvidia drivers are better than AMD drivers. I tried installing the fglrx driver and then In Chrome looking at chrome://gpu noticed that a lot of things that used to be hardware accelerated with the X.Org driver where then software rendered with the ati driver. I would have thought the proprietary driver would have better performance but not according to the chrome://gpu readout.

    I ended up uninstalling fglrx and reinstalling X.Org.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.