解决 be sure you have the ‘kernel-source‘ or ‘kernel-devel‘ RPM installed

错误记录:
ERROR: 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 systems, for example, 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

解决方案:

1.先确认OS是否做过内核版本升级?

2.查看当前内核版本
uname -r

3.查看kernel-devel和headers信息,确认是否与当前OS内核一致?
~]# yum info kernel-devel kernel-headers
Loaded plugins: auto-update-debuginfo, fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
Installed Packages
Name        : kernel-devel
Arch        : x86_64
Version     : 4.14.105
Release     : 19.0020.tl2
Size        : 54 M
Repo        : installed
From repo   : tlinux
Summary     : Development package for building kernel modules to match the 4.14.105-19.0020.tl2 kernel
URL         : http://www.tencent.com
License     : GPLv2
Description : This package provides kernel headers and makefiles sufficient to build modules
            : against the 4.14.105-19.0020.tl2 kernel package.

Name        : kernel-headers
Arch        : x86_64
Version     : 3.10.0
Release     : 1062.12.1.el7
Size        : 3.7 M
Repo        : installed
Summary     : Header files for the Linux kernel for use by glibc
URL         : http://www.kernel.org/
License     : GPLv2
Description : Kernel-headers includes the C header files that specify the interface
            : between the Linux kernel and userspace libraries and programs.  The
            : header files define structures and constants that are needed for
            : building most standard programs and are also needed for rebuilding the
            : glibc package.

Available Packages
Name        : kernel-headers
Arch        : x86_64
Version     : 4.14.105
Release     : 19.0020.tl2
Size        : 1.1 M
Repo        : tlinux/2.4/x86_64
Summary     : Header files for the Linux kernel for use by glibc
URL         : http://www.tencent.com
License     : GPLv2
Description : Kernel-headers includes the C header files that specify the interface
            : between the Linux kernel and userspace libraries and programs.  The
            : header files define structures and constants that are needed for
            : building most standard programs and are also needed for rebuilding the
            : glibc package.


4.下载安装对应内核的kernel-devel和headers,然后重新安装NVIDA驱动
https://centos.pkgs.org/7/centos-updates-x86_64/kernel-devel-3.10.0-1160.el7.x86_64.rpm.html
https://centos.pkgs.org/7/centos-x86_64/kernel-headers-3.10.0-1160.el7.x86_64.rpm.html

5.查看显卡信息
[root@gpu03 ~]# nvidia-smi 
Mon Aug 16 20:58:33 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.95.01    Driver Version: 440.95.01    CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla V100-SXM2...  Off  | 00000000:00:06.0 Off |                    0 |
| N/A   33C    P0    53W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Tesla V100-SXM2...  Off  | 00000000:00:07.0 Off |                    0 |
| N/A   32C    P0    52W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  Tesla V100-SXM2...  Off  | 00000000:00:08.0 Off |                    0 |
| N/A   33C    P0    52W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   3  Tesla V100-SXM2...  Off  | 00000000:00:09.0 Off |                    0 |
| N/A   35C    P0    53W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   4  Tesla V100-SXM2...  Off  | 00000000:00:0A.0 Off |                    0 |
| N/A   31C    P0    53W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   5  Tesla V100-SXM2...  Off  | 00000000:00:0B.0 Off |                    0 |
| N/A   34C    P0    51W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   6  Tesla V100-SXM2...  Off  | 00000000:00:0C.0 Off |                    0 |
| N/A   31C    P0    53W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   7  Tesla V100-SXM2...  Off  | 00000000:00:0D.0 Off |                    0 |
| N/A   33C    P0    53W / 300W |      0MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

寻花之梦~~

谢谢老板的支持和鼓励!

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

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

打赏作者

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

抵扣说明:

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

余额充值