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

If you are dealing a situation where a laptop or desktop with dual graphics adapter is not working under Linux operating system and you have no option in BIOS to make nvidia display adapter primary. This guide will show you how to install latest nvidia driver on CentOS/RHEL and make nvidia as the primary display.

 
For this guide, we have a laptop with dual graphic adapters installed with CentOS 7.6 x86_64bit operating system. You must disable "Secure Boot" option if exists from the BIOS before performing the following steps.

STEP1 – Install latest 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

yum -y update


reboot

STEP2 – 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:

rpm -qa |grep *nouveau*


yum -y autoremove xorg-x11-drv-nouveau

yum -y install xorg-x11-drv-evdev xorg-x11-drv-synaptics


reboot

STEP3 – 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


reboot

STEP4 – 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 yourusername

STEP5– Update bumblebee configuration files

vi /etc/bumblebee/bumblebee.conf

[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.

Now edit and remove blacklist nvidia line from the following file and leave blacklist nouveau line as is.

vi /etc/modprobe.d/bumblebee.conf
 

blacklist nouveau

Save and close.

Now verify nvidia graphic card bus id with the following command:

lscpi | grep nvidia

and update the nvidia display adapter bus id in xorg.conf.nvidia file:

vi /etc/bumblebee/xorg.conf.nvidia

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.

At this point, edit /usr/share/applications/nvidia-settings.desktop file and change the Exec line like below:

vi /usr/share/applications/nvidia-settings.desktop
 

Exec=optirun nvidia-settings -c :8.0

Save and close.

reboot

Now you can login with 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 can see the above screen on your laptop or desktop running CentOS 7.6 with dual graphics adapter then congrats, you have successfully made nvidia graphics driver functional.
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