linux-kernel - 用于 linux 的 Nvidia 驱动程序找不到 kernel.h 文件
问题描述
我知道我的 kernel.h 文件在 /usr/include/linux/ 中,但是这个 Nvidia 程序找不到它,然后它要求我使用 --kernel-source-path 参数运行它,我确实给了它那个路径和它不起作用它说找不到它,因为它不会采取正确的路径运行它只是通过
./nvidia.run
回报:
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.
然后运行它
./nvidia.run --kernel-source-path /usr/include/linux/
回报:
ERROR: The kernel header file '/usr/include/linux//include/linux/kernel.h'
does not exist. The most likely reason for this is that the kernel
source path '/usr/include/linux/' is incorrect. 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.
我的第一个想法是从地址中删除 /include/linux/ 但告诉它去路径 /usr/ 只是告诉我它是无效的。kernel.h 文件确实在 /usr/include/linux/kernel.h 中,但我无法读取它。
ERROR: The kernel source path '/usr/' is invalid. 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.
解决方案
根据https://ubuntuforums.org/showthread.php?t=843914可以试试
sudo apt update
sudo apt install linux-headers-`uname -r`
推荐阅读
- c# - 从 C# 中的不同进程访问类的实例
- c# - C# + Pl/SQL 存储过程中没有参数的问题
- angular - 在子组件的文件输入上触发 click() 将无法通过订阅进行
- firebase - Firebase 的签名错误 getSignedUrl()
- sharedpreferences - 在共享首选项中设置的字符串的更改未发布到 onSharedPreferenceChanged
- react-native - React native ActivityIndicator 即使在卸载后仍然保持动画
- python-3.x - 如何安装和运行openpose?
- android - react-native-maps + react-native-firebase Android 应用程序在启动时崩溃
- eclipse - 使用 Eclipse 运行 OpenCV 程序
- javascript - 将模板字符串传递给不带括号的函数