显卡升级计划

ctenos7 显卡升级计划

备注:参考网站:https://www.cnblogs.com/gollong/p/12655424.html

1 查看显卡的版本:
[root@host206 ~]# nvidia-smi 
Thu Jul  8 17:29:48 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.104      Driver Version: 410.104      CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla P40           Off  | 00000000:3B:00.0 Off |                    0 |
| N/A   33C    P0    49W / 250W |  16509MiB / 22919MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Tesla P40           Off  | 00000000:D8:00.0 Off |                    0 |
| N/A   39C    P0    50W / 250W |   9706MiB / 22919MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     17031      C   python3                                     2007MiB |
|    0    119681      C   python3                                     5395MiB |
|    0    183027      C   python3                                     1657MiB |
|    0    273585      C   python3                                     1625MiB |
|    0    304814      C   /usr/bin/python3                             145MiB |
|    0    373891      C   python3                                     2077MiB |
|    0    387697      C   /usr/bin/python3                             681MiB |
|    0    403831      C   /usr/bin/python3                             733MiB |
|    0    412428      C   python3                                     2177MiB |
|    1     91769      C   python                                      1539MiB |
|    1    106436      C   python3                                     1159MiB |
|    1    247393      C   python3                                     2263MiB |
|    1    401839      C   python3                                     4735MiB |
+-----------------------------------------------------------------------------+
2 查看显卡的型号
[root@host206 ~]# lspci | grep  -i nvidia
3b:00.0 3D controller: NVIDIA Corporation GP102GL [Tesla P40] (rev a1)
d8:00.0 3D controller: NVIDIA Corporation GP102GL [Tesla P40] (rev a1)

备注:Tesla P40是英伟达的显卡

3 查看显卡驱动
[root@host206 ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  410.104  Tue Feb  5 22:58:30 CST 2019
GCC version:  gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
4 检查内核版本和源码版本,保证一致
[root@host206 ~]# ls /boot | grep vmlinu
vmlinuz-0-rescue-1966ec2a32cc4b4e97499441109628d6
vmlinuz-3.10.0-693.el7.x86_64
vmlinuz-4.4.115-1.el7.elrepo.x86_64
[root@host206 ~]# rpm -aq | grep kernel-devel
kernel-devel-3.10.0-693.el7.x86_64
kernel-devel-3.10.0-693.11.1.el7.x86_64
[root@host206 ~]# cd /usr/src/kernels/
[root@host206 kernels]# ll
总用量 12
drwxr-xr-x  22 root root 4096 1014 2019 3.10.0-693.11.1.el7.x86_64
drwxr-xr-x. 22 root root 4096 619 2019 3.10.0-693.el7.x86_64
drwxr-xr-x  23 root root 4096 712 2019 4.4.115-1.el7.elrepo.x86_64
[root@host206 kernels]# uname -r
4.4.115-1.el7.elrepo.x86_64

备注:内核版本通过uname -r确认,源码包路径:/usr/src/kernels/。能对应上,就说明内核版本和源码版本,保证一致

5 查看 系统自带的nouveau 是否屏蔽掉
lsmod | grep nouveau

备注:没有显示表示已屏蔽

6 查看 initramfs image
[root@host206 kernels]# ll /boot/initramfs-4.4.115-1.el7.elrepo.x86_64.img 
-rw------- 1 root root 33182593 1014 2019 /boot/initramfs-4.4.115-1.el7.elrepo.x86_64.img

7 显卡驱动下载

下载网站:https://www.nvidia.cn/Download/index.aspx?lang=cn

在这里插入图片描述

备注:第一行有Tesla关键字,第二行有P关键字,选完之后点击搜索。
点击下载:

在这里插入图片描述

点击同意下载。浏览器就会自动下载

在这里插入图片描述

7 卸载原有的显卡

停掉原有的使用显卡的服务

[root@host206 src]# systemctl stop docker

卸载原有的显卡

[root@host206 src]# sudo /usr/bin/nvidia-uninstall
1 如果英伟达驱动程序不再使用,则应该确保X配置中没有配置X屏幕使用英伟达X驱动程序。

文件。如果您使用nvidiaxconfig配置X,它可能已经创建了原始配置的备份。您想运行“nvidia xconfig”吗

--还原原始备份`尝试还原原始X配置文件吗?  选择no

在这里插入图片描述

2 点击ok

核查是否成功卸载

[root@host206 src]# nvidia-smi 
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
8 安装新的显卡驱动

给执行权限

[root@host206 src]# chmod +x NVIDIA-Linux-x86_64-460.73.01.run 

执行安装显卡

[root@host206 src]# ./NVIDIA-Linux-x86_64-460.73.01.run -no-nouveau-check -no-opengl-files --kernel-source-path=/usr/src/kernels/$(uname -r)/ -k $(uname -r)
# -no-x-check 这个参数就是检查那个Xserver(gdm)服务,要关闭
# -no-nouveau-check,就是检查是否已禁用nouveau
# -no-opengl-files , 这个是防止图形化界面的centos7无限重启
# --kernel-source-path ,指定内核源码包版本,
# -k $(uname -r)    ,指定当前内核版本,要和上面版本一致
# --dkms -s ,这两个参数我没加上去,网上有要加,如果安装有问题,提示dkms可以加上,前提安装了dkms软件
1 是否要向DKMS注册内核模块源?如果您安装了不同的内核,这将允许DKMS自动构建一个新模块   选no

2 警告:nvidia安装程序被迫猜测X库路径“/usr/lib64”和X模块路径“/usr/lib64/xorg/modules”;这些路径是不可查询的

从系统中删除。如果X无法找到英伟达X驱动模块,请安装“PKG CONFIG”实用程序和X.org SDK/Debug开发包。

你的发行版和重新安装驱动程序。    选择 ok
3 安装NVIDIA的32位兼容库?  选择 no
4 英伟达加速的图形驱动程序内核模块安装为LIUX-X86Y64(版本460.73.01)现已完成。 选择ok 
9 验证显卡是否安装成功
[root@host206 src]# nvidia-smi 
Thu Jul  8 19:03:36 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla P40           Off  | 00000000:3B:00.0 Off |                    0 |
| N/A   27C    P0    48W / 250W |      0MiB / 22919MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  Tesla P40           Off  | 00000000:D8:00.0 Off |                    0 |
| N/A   33C    P0    49W / 250W |      0MiB / 22919MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
10 重启启动使用显卡相关的服务
[root@host206 src]# systemctl start docker
                                             结束,谢谢
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值