centos7安装英伟达显卡驱动

没有特殊要求,就不要折腾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. 禁用nouveau链接:https://blog.csdn.net/zhangtong11111/article/details/79131978
  2. 切到init3,开始安装 sh NVIDIA-Linux-x86_64-390.67.run 其中的一些选项可自行百度,至此安装完成

8.查看状态 nvidia-smi

[ranlk@ranlk ~]$ nvidia-smi
Thu Aug  2 16:13:09 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.67                 Driver Version: 390.67                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro K620         Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   52C    P0     1W /  30W |      0MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

卸载:
方法1.用run包卸载 sh NVIDIA-Linux-x86_64-390.67.run --uninstall
方法2. 如果是用yum安装的,则需要命令yum list installed | grep nvidia找出安装的包,用yum remove把nvidi打头的删除。

参考链接 https://blog.csdn.net/darkeyers/article/details/80235386



 

发布了32 篇原创文章 · 获赞 5 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_28903377/article/details/101011729