Physical Server

Installing a Nvidia GPU Driver in CentOS

2024-12-12 06:42:56

This topic takes CentOS 7.6 as an example to describe how to install Nvidia GPU driver.

2.1 Disabling a Nouveau Driver

#Modify the dist-blacklist.conf file:
vim /lib/modprobe.d/dist-blacklist.conf
#1. Comment out nvidiafb: blacklist nvidiafb -> changes to #blacklist nvidiafb #2. Then add the following statement at the end of the file:
blacklist nouveau
options nouveau modeset=0

Note:

The Nvidia GPU driver must be installed in a non-desktop environment. In a desktop environment, you can run the systemctl set-default multi-user.target command and then restart to switch to the virtual terminal interface. Then, you can run the systemctl set-default graphical.target command and then restart to switch to the desktop environment.

2.2 Installing a Driver Using Run File

2.2.1 Downloading a Driver

Download the driver at the link below: https://download.nvidia.com/XFree86/Linux-x86_64/470.129.06/NVIDIA-Linux-x86_64-470.129.06.run

2.2.2 Installing a Driver

Assume that the downloaded driver is placed in /root/NVIDIA-Linux-x86_64-470.129.06.run

apt -y install build-essential #add necessary dependency chmod +x /root/NVIDIA-Linux-x86_64-470.129.06.run
/root/NVIDIA-Linux-x86_64-470.129.06.run

2.2.3 Verifying Whether the Driver is Normally Installed

nvidia-smi

The following interface displays when the driver is successfully installed.

2RoI6bgkHGse