NVIDIA-SMI has failed带来的一系列问题

发布时间 2023-06-26 17:02:48作者: 壶小旭

NVIDIA-SMI has failed带来的一系列问题

前沿

记实验室的小红帽服务器重启后,使用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.

现记录解决该问题过程中遇到的坑,首先百度到的解决方案就是安装dkms组件(Dynamic Kernel Module Support),利用dkms将未编译到内核之中的Linux驱动程序进行手动编译。

但是在使用命令

yum install dkms

出现了第一个问题

Question1:缺失RPM-GPG-KEY-rockyofficial 密钥文件

  • RPM-GPG-KEY-rockyofficial 是一个RPM软件包管理系统使用的GPG密钥。RPM(Red Hat Package Manager)是一种在Linux系统中广泛使用的软件包管理工具,用于安装、升级和卸载软件包。GPG(GNU Privacy Guard)是一个用于加密和签名数据的开源工具。

    RPM-GPG-KEY-rockyofficial 可能与 Rocky Linux 发行版相关。Rocky Linux 是一个社区驱动的企业级操作系统,由原始的CentOS团队创建,旨在提供一个自由、开放和可靠的替代方案,以填补CentOS项目将在将来不再提供长期支持的空白。RPM-GPG-KEY-rockyofficial 可能是用于验证 Rocky Linux 官方软件包的数字签名的GPG密钥。

  • Failed to search for file: Failed to download gpg key for repo 'baseos': Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial [Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial]

Solution1:补全RPM-GPG-KEY-rockyofficial 密钥文件

cd /etc/pki/rpm-gpg
wget http://mirror.alwyzon.net/rockylinux/RPM-GPG-KEY-rockyofficial
#若是无法wget下载可以利用浏览器直接下载再上传到服务器
rpm --import RPM-GPG-KEY-rockyofficial

Question2:docker-ce-stable的配置不正确

补全RPM-GPG-KEY-rockyofficial 后,继续执行yum install dkms,出现了第二个问题

Solution2

#访问https://download.docker.com/linux/rhel/9,发现只存在两个目录
s390x/
source/

为此需要重新配置/etc/yum.repos.d目录下的docker-ce.repo文件中的docker-ce-stable配置

将$basearch替换成source

[docker-ce-stable]
name=Docker CE Stable - $basearch
#baseurl=https://download.docker.com/linux/rhel/$releasever/$basearch/stable
baseurl=https://download.docker.com/linux/rhel/$releasever/source/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/rhel/gpg

Question3

解决完源的配置问题,执行yum install dkms,出现了第3个问题,没有任何匹配: dkms

(base) [root@localhost yum.repos.d]# yum install dkms
上次元数据过期检查:0:00:12 前,执行于 2023年06月26日 星期一 04时16分37秒。
未找到匹配的参数: dkms
错误:没有任何匹配: dkms

solution3

先安装EPEL

yum install -y epel-release
1

再安装kernel-headers, kernel-devel,dkms

yum install -y kernel-headers kernel-devel dkms

结语