Linux(Centos7.7)下安装GPU驱动报unable to find kernel source的问题

	在Linux(Centos7.7)下安装GPU A100的驱动时,启用命令行界面,运行Nvidia Driver .run的安装包后,发现报错:Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured on Red Hat Linux system.be sure you have the 'kernel-source' or 'kernel-devel' RPM installed .If you know the correct kernel source files are installed ,you may specify the kernel source path with the '--kernel-source-path' command line option.

错误的原因是运行的系统内核版本与kernel-source kernel-devel等不一致。
运行uname -r 和rpm -qa | grep kernel 对比发现,运行内核版本确实与相关的devel headers的版本号不一致,发现devel的版本号较新,运行yum install 安装与kernel devel 一致的内核。随后切换默认的启动内核版本。

1.查看当前默认内核
grub2-editenv list
2.查看已有内核
cat /boot/grub2/grub.cfg |grep menuentry
3.更换默认启动内核
grub2-set-default ‘CentOS (3.10.2.el7.x86_64) 24 (Workstation Edition)’
4. 备份并重新生成grub信息
grub2-mkconfig -o /boot/grub2/grub.cfg
5.重启系统
reboot

切换完成后,再次运行安装驱动程序。安装成功!
报错的根本原因是内核版本与其他的内核相关kernel包版本不一致。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值