安装英伟达驱动错误
我在安装英伟达驱动时,遇到下面的一些错误,希望对网友们有借鉴作用
出现An error occurred while performing the step: “Building kernel modules”. See /var/log/nvidia
要详细的查看具体的报错日志,我们可以从日志中找到很多有用的信息,我当时的错误是:没有安装到一些编译所需要的库:
我当时在日志中找到一句话是:please install libelf-dev,没有找到 libelf 相关的库。
执行一下命令即可安装:
// Ubuntu 系统命令
sudo apt install build-essential
// Linux 系统命令
sudo yum groupinstall "Development Tools"
之后再进行执行即可不会出现这种错误
出现The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding.
这个是系统本身的GPU驱动与Nvidia的驱动冲突,需要禁用系统的程序即可:
-
打开
/etc/modprobe.d/blacklist-nouveau.conf
文件,如果没有则进行创建就行:sudo nano /etc/modprobe.d/blacklist-nouveau.conf
添加以下内容后保存:
blacklist nouveau options nouveau modeset=0
-
更新初始化 RAM 文件系统:(一定要执行该命令,否则修改不会生效)
// Ubuntu 系统命令 sudo update-initramfs -u // Linux 系统命令 dracut --forece
-
重启你的系统:(重启后生效)
sudo reboot
出现Unable to find the kernel source tree for the currently running kernel. Please make sure you
错误显示:
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.
这个首先需要查看kernel-devel
的版本安装是否与系统内核版本一致:
查看内核命令:
uname -r
查看是否安装kernel-devel
,如果没有则需要进行安装
yum info kernel-devel
错误中出现的:kernel-source
并不是一个 yum 文件,不用管他。
我的解决方法是,更新系统的所有依赖,在执行安装Nvidia驱动,则不会出现这个错误:
-
更新系统:首先,更新你的系统包列表和系统本身,确保所有的依赖都是最新的。
// Ubuntu 系统命令 sudo apt update sudo apt upgrade // Linux 系统命令 sudo yum check-update sudo yum update
这个错误参考文章:
如果以上错误还是没有解决,请尝试其他版本的Nvidia驱动进行安装。
以上是我遇到的一些报错,希望对网友们有帮助。