Home CentOS How To Install NVIDIA Driver on CentOS 8 Dekstop

How To Install NVIDIA Driver on CentOS 8 Dekstop

5126
0

In order to improve graphics performance on your computer which running on CentOS 8 desktop, we need to install NVIDIA Graphic Driver if your computer have NVIDIA Graphic cards installed on it. In this tutorial, i’m using GeForce GTX 650. Yes, maybe it’s Old NVIDIA cards for you. 😀

Ok… let’s follow this simple tutorial to install NVIDIA Graphic driver on CentOS 8 Desktop PC.

1.) Change System Run-Level to multi-user.target

First of all, we need to change System Run-Level to multi-user.target, from GUI (Graphical User Interface) to CUI (Character User Interface) or CLI (Command Line Interface. So, after you change to CUI/CLI, there are no more GUI at all on your CentOS 8 PC. But, don’t worry, we can switch back to GUI after driver installation process is complete.

Check your current System Run-Level:

$ systemctl get-default
graphical.target
$ ll /etc/systemd/system/default.target 
lrwxrwxrwx. 1 root root 40 May 15 03:12 /etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target
$ ll /lib/systemd/system/multi-user.target 
-rw-r--r--. 1 root root 532 Jun 22 2018 /lib/systemd/system/multi-user.target

Ok.. let’s change to multi-user.target, simply run the following command:

$ systemctl set-default multi-user.target 
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/multi-user.target.
$ systemctl get-default 
multi-user.target
$ ll /etc/systemd/system/default.target 
lrwxrwxrwx. 1 root root 41 May 15 03:35 /etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target

2.) Disable Nouveau Driver Permanently

Then, don’t forget to disable [nouveau] driver or NVE7 which you can see on Settings > Details > About > Graphics. So, what is it exactly nouveau? Nouveau is accelerated open source driver for NVIDIA cards which aims to build high-quality, and free/libre software drivers for NVIDIA graphics cards. It consists of a Linux kernel KMS driver (nouveau), Gallium3D drivers in Mesa, and the Xorg DDX (xf86-video-nouveau).

To disable nouveau driver, run the following command:

$ lsmod | grep nouveau
nouveau 2187264 1
video 45056 1 nouveau
mxm_wmi 16384 1 nouveau
wmi 32768 2 mxm_wmi,nouveau
i2c_algo_bit 16384 1 nouveau
drm_kms_helper 200704 1 nouveau
ttm 131072 1 nouveau
drm 520192 4 drm_kms_helper,ttm,nouveau

Create a file called blacklist-nouveau.conf inside modprobe.d directory. I’m using nano instead of vim, ok, it’s very simple I think.

$ nano /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0

If you are using llvmpipe driver, simply create file “blacklist-llvmpipe.conf” in order to disable llvmpipe driver on your CentOS 8 machine.

$ nano /etc/modprobe.d/blacklist-llvmpipe.conf
blacklist llvmpipe
options llvmpipe modeset=0

After that, run this command and reboot your PC

$ dracut --force 
$ reboot

3.) Login to Your System via CUI / CLI

After you have rebooted your CentOS 8 PC, you will be forced to login to your system via CUI / CLI only. Also please make sure you have root privileges.

Let’s install some required packages along with its dependency, if any…

$ dnf install kernel-devel kernel-headers elfutils-libelf-devel zlib-devel gcc make

4.) Download NVIDIA Graphic Driver on their official site.

See… https://www.NVIDIA .com/Download/index.aspx?lang=en

You have downloaded NVIDIA driver on your computer, so run this command to verify graphics cards type on your PC.

$ lspci | grep VGA 
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)

Let’s move to downloads directory on your system:

$ cd /home/your-user/Downloads

And, finally run the installer:

$ bash NVIDIA -Linux-x86_64-440.82.run

It should be noted that you will face a number of important questions like this:

Install NVIDIA ‘s 32-bit compatibility libraries?
Yes No

# Select YES

Would you like to run the NVIDIA -xconfig utility to automatically update
your X configuration file so that the NVIDIA X driver will be used when you
restart X? Any pre-existing X configuration file will be backed up.
Yes No

# Select NO

Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64
(version: 440.82) is now complete. Please update your xorg.conf file as
appropriate; see the file /usr/share/doc/NVIDIA _GLX-1.0/README.txt for
details.

OK

5.) Verify NVIDIA Graphic driver

Let’s verify your driver installation in order to show NVIDIA Graphic cards status;

$ nvidia-smi
Fri May 15 06:59:11 2020 
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 650 Off | 00000000:01:00.0 N/A | N/A |
| 16% 43C P0 N/A / N/A | 215MiB / 980MiB | N/A Default |
+-------------------------------+----------------------+----------------------+

+—————————————————————————–+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
+—————————————————————————–+

6.) Change Back System Run-Level to graphical.target

You have finished installing NVIDIA Graphic driver version 440.82, so wee need to change back system run-level to graphical.target (GUI). Simply run the following command.

$ systemctl set-default graphical.target 
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/graphical.target.
$ systemctl get-default 
graphical.target
$ ll /etc/systemd/system/default.target 
lrwxrwxrwx. 1 root root 40 May 15 03:37 /etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target

On the same screen, reboot your CentOS 8 Desktop into GUI mode like before.

$ reboot
Next articleInstalling phpMyAdmin with Nginx on CentOS 7
I'm just an freelancer and part-time worker at several freelance sites. Here at knot35.com we will share everything knowledge about Linux, Unix-Like, and open-source softwares.

LEAVE A REPLY

Please enter your comment!
Please enter your name here