For those who seek help in different areas of software and hardware platform.

How To Install Latest NVIDIA Driver on CentOS/RHEL 6/7/8

This guide will walk you through the steps to install latest NVIDIA driver on a CentOS/RHEL machine. For this guide, we have a laptop with dual graphics adapter (one intel HD 4000 and other NVIDIA GTX 960) and we are running CentOS 7.7 x86_64bit operating system.


Before performing the following steps, you must disable "Secure Boot" option if exists on your system from the BIOS.

 

Install ELRepo Repository

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
To install ELRepo for RHEL-7, SL-7 or CentOS-7:
sudo rpm -ivh https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
To install ELRepo for RHEL-8 or CentOS-8:
sudo rpm -ivh https://www.elrepo.org/elrepo-release-8.0-2.el8.elrepo.noarch.rpm
sudo yum -y update
Reboot your machine to take changes into effect:
reboot

Uninstall Generic (nouveau) Driver

Switch to single user console mode by pressing key combination of Ctrl + Alt + F2 at the login prompt screen and perform the following steps: First you need to make sure whether nouveau driver is installed with below command:

rpm -qa |grep *nouveau*
If it is installed, you can simply remove nouveau driver with the below command:
yum -y autoremove xorg-x11-drv-nouveau
After removing the nouveau driver from your machine, you must reinstall following packages to make your touch-pad working if you are working on a laptop:
yum -y install xorg-x11-drv-evdev xorg-x11-drv-synaptics
At this point, you need to reboot your machine to take the changes into effect:
reboot

Install Latest NVIDIA Driver 

Switch to single user console mode by pressing key combination of Ctrl + Alt + F2 at the login prompt screen and perform the following steps:

yum -y install nvidia-detect
yum -y install kmod-nvidia
Once the installation done, reboot your machine:
reboot

Install bumblebee Package 

Switch to single user console mode by pressing key combination of Ctrl + Alt + F2 at the login prompt screen and perform the following steps:

yum -y install bumblebee
usermod –aG bumblebee root
usermod –aG bumblebee your_username

Edit bumblebee.conf file with any of your favorite text editor:

vi /etc/bumblebee/bumblebee.conf
Make the following highlighted changes:
[bumblebeed]
VirtualDisplay=:8
KeepUnusedXServer=false
ServerGroup=bumblebee
TurnCardOffAtExit=false
NoEcoModeOverride=false
Driver=nvidia
XorgConfDir=/etc/bumblebee/xorg.conf.d

[optirun]
Bridge=auto
VGLTransport=proxy
PrimusLibraryPath=/usr/lib64/primus:/usr/lib32/primus
AllowFallbackToIGC=false

[driver-nvidia]
KernelDriver=nvidia-drm
PMMethod=auto
LibraryPath=
XorgModulePath=
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau

Save and close the file when you are finished. 

Now edit /etc/modprobe.d/bumblebee.conf file with any of your favorite text editor:

vi /etc/modprobe.d/bumblebee.conf
Remove following highlighted text from the file:
blacklist nvidia
blacklist nouveau
Save and close the file when you are finished. Verify the BusID of NVIDIA graphic card with the following command:
lscpi | grep NVIDIA
Edit xorg.conf.nvidia file with any of your favorite text editor:
vi /etc/bumblebee/xorg.conf.nvidia
Uncomment the following highlighted parameter and update/replace BusID if it is different in your system:
Section "ServerLayout"
    Identifier  "Layout0"
    Option      "AutoAddDevices" "false"
    Option      "AutoAddGPU" "false"
EndSection

Section "Device"
    Identifier  "DiscreteNvidia"
    Driver      "nvidia"
    VendorName  "NVIDIA Corporation"

    BusID "PCI:01:00:0"

    Option "ProbeAllGpus" "false"

    Option "NoLogo" "true"
    Option "UseEDID" "false"
    Option "UseDisplayDevice" "none"
EndSection
Save and close the file when you are finished. Next, edit nvidia-settings.desktop file with any of your favorite text editor:
vi /usr/share/applications/nvidia-settings.desktop
Make the following highlighted changes:
Exec=optirun nvidia-settings -c :8.0
Save and close the file when you are finished. Reboot your system to take changes into effect:
reboot
Once reboot complete, login to the graphical desktop at the login prompt screen, then from terminal, execute the following command to open NVIDIA control panel:
optirun nvidia-settings -c :8.0

If you see the following NVIDIA control panel screen on your system, you have successfully installed NVIDIA driver on your system.

Share:

6 comments:

  1. Hello. Did what you said here and as a result there's no mouse or keyboard in GUI. Any suggestions?

    ReplyDelete
    Replies
    1. Solution to your problem is: yum -y install xorg-x11-drv-evdev xorg-x11-drv-synaptics

      Delete
  2. Hello. Followed your instructions to the letter and the result is an error: "Bumblebee Daemon has not been started yet or the socket path /bar/run/bumblebee.socket was incorrect." Any suggestions?

    ReplyDelete
    Replies
    1. You should check your problem here https://github.com/Bumblebee-Project/Bumblebee/wiki/Troubleshooting and here https://github.com/bumblebee-project/bumblebee/issues/227 and try to fix your issues as suggested.

      Delete
    2. Try this to fix your issue:

      yum -y install dkms-nvidia

      Delete
  3. AnonymousJuly 28, 2020

    Doesn't work on Centos 8 (64bit). Appears as thought the ELrepo 8 isn't as complete.

    ReplyDelete

Comments with links will not be published.

Video Tutorials