问题描述
如题,起因是在阿里云GPU服务器上,使用原先正常运行的镜像生成了容器,但容器的显卡驱动出问题了,使用nvidia-smi命令会报错 NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver.
尝试使用官网.run文件重新安装显卡驱动会报错ERROR: Unable to load the kernel module ‘nvidia.ko’. This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the target kernel, or if a driver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s), or no NVIDIA GPU installed in this system is supported by this NVIDIA Linux graphics driver release.
按照报错信息,怀疑是内核版本或者gcc版本有误,更换了多个内核版本和gcc版本,使用了网上很多这两种保存相关的解决思路,都没能解决,一筹莫展。
放弃了原先的镜像,新建了空的容器,但是空的容器也会报NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver的错,并且空的容器居然也装不上显卡驱动,遂怀疑是容器本身的问题。
解决方案
发现可能是容器本身的设置有问题,设置为GPU计算时容器可正常安装驱动,但是设置为GPU计算可视化时就会报以上错误。
咨询阿里云,发现GPU计算可视化型需要提交工单获取特定的兼容驱动,GPU计算型才可以从官网下载驱动安装。通过提交工单获取特定的兼容驱动后,驱动可正常安装,问题解决。
反思
如果云服务器中空的容器连驱动都安装不好的话,就不要自己折腾了,大概率是容器本身哪里出问题了,咨询云服务商吧。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)