当前位置:   article > 正文

Centos7安装NVIDIA的驱动的坑_error! your kernel headers for kernel 5.4.0-150-ge

error! your kernel headers for kernel 5.4.0-150-generic cannot be found. ple

错误:
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
  • 1

(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
  • 1
  • 2
  • 3

(3)安装显卡检测程序

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

       yum install nvidia-detect  
  • 1
  • 2
  • 3

(4)运行 nvidia-detect

      结果:kmod-nvidia
  • 1

(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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/酷酷是懒虫/article/detail/1000365
推荐阅读
相关标签
  

闽ICP备14008679号