安装NVIDIA驱动-centos

lspci |grep -E "VGA|3D"

去 http://www.nvidia.com/Download/Find.aspx?lang=en-us 下载驱动

chmod +x /path/to/NVIDIA-Linux-*.run

  1. 切换到root
  2. 添加 EPEL 源
    
    ## CentOS Stream 9 / Red Hat (RHEL) 9 ##
    
    dnf install \
    https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/e/epel-next-release-9-2.el9.next.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/e/epel-release-9-2.el9.next.noarch.rpm
    
    ## CentOS Stream 8 ##
    dnf config-manager --set-enabled powertools
    dnf install epel-release epel-next-release
    
    
  3. dnf install kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig
    
    
    echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
    
    
    
  4. 编辑 /etc/default/grub 
    在‘GRUB_CMDLINE_LINUX=”…”‘ 最后面添加 ‘rd.driver.blacklist=nouveau’ 
    
    ## Example row with LVM on Rocky Linux ##
    GRUB_CMDLINE_LINUX="crashkernel=auto resume=/dev/mapper/rl_rocky--linux-swap rd.lvm.lv=rl_rocky-linux/root rd.lvm.lv=rl_rocky-linux/swap rhgb quiet rd.driver.blacklist=nouveau"
    
    
     
  5. 更新 grub2 配置文件
    ## BIOS ##
    grub2-mkconfig -o /boot/grub2/grub.cfg
    ## UEFI CentOS Stream 9/8 ##
    grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
    

  6. 生成初始化文件 
    ## Backup old initramfs nouveau image ##
    mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
     
    ## Create new initramfs image ##
    dracut /boot/initramfs-$(uname -r).img $(uname -r)
    

  7. 设置启动level
    systemctl set-default multi-user.target
    
    # 重启
    reboot
    
     
  8. 登录切换到root或者直接以root登录,切换到驱动所在目录后执行 
    ./NVIDIA-Linux-*.run
    

  9. 一路选择Yes或者Ok,然后

    systemctl set-default graphical.target
    reboot
    

  10. 验证方法

    在终端中输入:nvidia-smi or nvidia-settings
    

     

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值