centos安装nvidia驱动

没有特殊要求,就不要折腾centos系统的显卡驱动了!!!
昨天手贱安装显卡驱动,总算是折腾好了,现将过程简单记录于此,以便下次手贱查阅

  1. 首先关闭[Secure BOOT],开机时按F2(dell 台机),找到该选项,改为[Disable]

  2. 添加ElRepo源
    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

3.安装nvidia-detect,用于检查显卡 yum install nvidia-detect

  1. 运行命令 nvidia-detect -v 返回结果:
[ranlk@ranlk ~]$ nvidia-detect -v
Probing for supported NVIDIA devices...
[10de:13bb] NVIDIA Corporation GM107GL [Quadro K620]
This device requires the current 390.67 NVIDIA driver kmod-nvidia
[8086:1912] Intel Corporation HD Graphics 530
An Intel display controller was also detected

注意这里的信息 [Quadro K620]390.67
下载 NVIDIA-Linux-x86_64-390.67.run
地址 https://www.nvidia.com/object/linux-amd64-display-archive.html

  1. 安装前的一系列准备工作
yum -y update //若系统很久没跟新,这句可能耗时较长
yum -y groupinstall "GNOME Desktop" "Development Tools"
yum -y install kernel-devel

yum -y install epel-release
yum -y install dkms
  1. 禁用nouveau
vim /etc/default/grub  #在“GRUB_CMDLINE_LINUX”中添加 rd.driver.blacklist=nouveau nouveau.modeset=0
grub2-mkconfig -o /boot/grub2/grub.cfg #生成配置
vim /etc/modprobe.d/blacklist.conf #打开(新建)文件,加入blacklist nouveau
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
dracut /boot/initramfs-$(uname -r).img $(uname -r)   #更新配置,并重启
reboot

#开机后确认是否禁用
lsmod | grep nouveau  #应该返回空
  1. 切到init3,开始安装 sh NVIDIA-Linux-x86_64-390.67.run 其中的一些选项可自行百度,至此安装完成

驱动版本和CUDA版本要求

https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html


 

猜你喜欢

转载自blog.csdn.net/u014234504/article/details/84655464