安装英伟达驱动错误

安装英伟达驱动错误

我在安装英伟达驱动时,遇到下面的一些错误,希望对网友们有借鉴作用

出现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的驱动冲突,需要禁用系统的程序即可:

  1. 打开 /etc/modprobe.d/blacklist-nouveau.conf 文件,如果没有则进行创建就行:

    sudo nano /etc/modprobe.d/blacklist-nouveau.conf
    

    添加以下内容后保存:

    blacklist nouveau
    options nouveau modeset=0
    
  2. 更新初始化 RAM 文件系统:(一定要执行该命令,否则修改不会生效)

    // Ubuntu 系统命令
    sudo update-initramfs -u
    // Linux 系统命令
    dracut --forece
    
  3. 重启你的系统:(重启后生效)

    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驱动,则不会出现这个错误:

  1. 更新系统:首先,更新你的系统包列表和系统本身,确保所有的依赖都是最新的。

    // Ubuntu 系统命令
    sudo apt update
    sudo apt upgrade
    // Linux 系统命令
    sudo yum check-update
    sudo yum update
    

这个错误参考文章:

解决 be sure you have the ‘kernel-source‘ or ‘kernel-devel‘ RPM installed_unable to find the kernel source tree for the curr-CSDN博客

如果以上错误还是没有解决,请尝试其他版本的Nvidia驱动进行安装。

以上是我遇到的一些报错,希望对网友们有帮助。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值