“How to deal with the problem that nvidia-smi couldn't communicate with the nvidia driver”版本间的差异
来自cslt Wiki
第1行: | 第1行: | ||
+ | 问题: | ||
服务器nvidia显卡已连接却不可用,nvidia-smi 命令显示 | 服务器nvidia显卡已连接却不可用,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. | nvidia-smi has failed because it couldn't communicate with the nvidia driver. make sure that the latest nvidia driver is installed and running. |
2020年7月14日 (二) 11:42的版本
问题:
服务器nvidia显卡已连接却不可用,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. 但使用 lspci 命令中可以看到显卡已连接。
原因:
可能是由于系统update时将kernel更新到了较新的版本,无法支持原有版本显卡驱动。
解决方法(以下需root权限):
1. 更新显卡驱动。
2. 若更新显卡驱动无效,则需要降低系统内核(kernel)版本。
具体版本推荐参照其他正常运行的服务器。
3. 下载对应版本kernel的rpm文件。使用以下命令运行安装
rpm -ivh --force kernel-3.10.0-xxx.xx.x.el7.x86_64.rpm 已下载的两个kernel版本rpm文件地址: wolf08:/root/kernel-3.10.0-862.14.4.el7.x86_64.rpm wolf08:/root/kernel-3.10.0-957.12.2.el7.x86_64.rpm #(推荐)
4. 使用 rpm -qa | grep kernel 查看已安装的kernel版本。
可使用 rpm remove xxx 命令卸载不再需要的kernel版本。
5. ls /usr/src/kernels/ 观察是否存在已安装kernel版本的库文件夹(如/usr/src/kernels/3.10.0-957.12.2.el7.x86_64/)。
若不存在,则需要下载所需文件夹(此时运行其他安装时会提示缺少kernel headers)。 若安装版本与其他服务器相同,则直接copy其他服务器的 /usr/src/kernels/ 文件夹下对应版本库文件夹至本机/usr/src/kernels/即可。
6. nvidia-smi 观察是否正常,若不正常可能需要降低nvidia驱动版本。
下载具体版本驱动的.run文件,使用 sudo ./NVIDIA-Linux-x86_64-xxx.xx.run 运行安装。 已下载的nvidia driver版本地址: wolf08:/root/NVIDIA-Linux-x86_64-367.44.run wolf08:/root/NVIDIA-Linux-x86_64-375.82.run wolf08:/root/NVIDIA-Linux-x86_64-410.78.run #(推荐) wolf08:/root/NVIDIA-Linux-x86_64-440.82.run wolf08:/root/NVIDIA-Linux-x86_64-450.57.run
7. 恢复正常后,若希望kernel不再跟随系统进行更新,则
sudo vim /etc/yum.conf 在[main]部分加上: exclude=kernel* centos-release
8*. 推荐版本(现wolf05、wolf08版本):
kernel: kernel-3.10.0-957.12.2.el7.x86_64 nvidia driver: NVIDIA-Linux-x86_64-410.78