CentOS7.9 Nvidia driver installation

environment

Operating system: Centos 7.9
Graphics card model: A4000
nvidia driver version: 470

Stepping on the pit experience

I set my own graphics card model on the official website, and the recommended version is 515. At first, I didn’t suspect that it was a version problem. Could the official website recommend something wrong?
insert image description here
insert image description here
Use method 1 and method 2 described below to install. After installation, it nvidia-smican be displayed normally, but once restarted, the screen will be black and the graphical interface cannot be entered. I thought it was the wrong installation process, but after reinstalling the system many times, I am sure that it is definitely a problem with the 515 version itself. After all, there is no option to choose the centos7 operating system when the graphics card driver is recommended on the above official website, and it is likely to be 515. caused by incompatibility.

Finally, after installing version 470 through method 1, it restarts normally. It took two days before and after, and I was exhausted physically and mentally.

The system linux and nvidia have entered into cooperation early, so don't cheat the majority of programmers anymore.

method one

rely

yum install gcc -y
yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

Key and library links

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

Install nvidia-detect and check the applicable version

yum install nvidia-detect
nvidia-detect
yum search kmod-nvidia

Please add a picture description
Get four centos7.9 suitable driver versions, the first one kmod-nvidia.x86_64is still the 515 version, after installation it will reboot to a black screen. Select version 470 to install

yum -y install kmod-nvidia-470xx.x86_64

After the installation is complete, execute nvidia-smi
Please add a picture description
the installation successfully. rebootreboot.
The installation is complete.

Method Two

rely

yum install gcc -y
yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
yum -y install dkms

To disable the nouveau
command is vim /lib/modprobe.d/dist-blacklist.conf
to comment out nvidialib, and add

blacklist nouveau
options nouveau modeset=0

reshape

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
dracut /boot/initramfs-$(uname -r).img $(uname -r)

reboot

reboot

Check after reboot

lsmod | grep nouveau

If nothing is printed then nouveau was successfully disabled.

Enter root authority

su

enter text mode

init 3

Install

cd /home/<用户名>/Downloads
chmod +x <驱动名>
./<驱动名>

nvidia-smi checks the results, shows that the installation is successful, and then restarts

reboot

If you can enter the image interface after restarting, it means the installation is successful.

Guess you like

Origin blog.csdn.net/lb5482464/article/details/127498748