Centos7安装NVIDIA的驱动的坑

错误:
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

ERROR: Failed to run /sbin/dkms build -m nvidia -v 430.64 -k 3.10.0-1127.13.1.el7.x86_64: Error! echo
Your kernel headers for kernel 3.10.0-1127.13.1.el7.x86_64 cannot be
found at
/lib/modules/3.10.0-1127.13.1.el7.x86_64/build or
/lib/modules/3.10.0-1127.13.1.el7.x86_64/source.
You can use the --kernelsourcedir option to tell DKMS where it’s
located

ERROR: Failed to install the kernel module through DKMS. No kernel module
was installed; please try installing again without DKMS, or check the
DKMS logs for more information.

ERROR: Installation has failed. Please see the file
‘/var/log/nvidia-installer.log’ for details. You may find
suggestions on fixing installation problems in the README available
on the Linux driver download page at www.nvidia.com.

(1)查看安装的nvidia模块命令

        rpm -qa|grep -i nvid|sort

(2)删除找到的模块

        yum  remove kmod-nvidia-390.87-1.el7_5.elrepo.x86_64  xorg-x11-drv-nvidia-384.81-1.el7.x86_64yum search  kmod-nvidia   nvidia-kmod-384.81-2.el7.x86_64

 注释:如果有错误提示“NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver”需要运行nvidia-uninstall

(3)安装显卡检测程序

       rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm  

       yum install nvidia-detect  

(4)运行 nvidia-detect

      结果:kmod-nvidia

(5)安装基础包 yum install kernel-devel kernel-doc kernel-headers gcc* glibc* glibc-*

(6)安装刚才检测到的驱动 yum install kmod-nvidia
(7)然后查看显卡(命令:nvidia-smi)中进程的使用情况。

参考:https://blog.csdn.net/lwhsyit/article/details/82774438

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

九霄王

我们一起为这个世界努力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值