Centos桌面环境安装显卡驱动

322 阅读1分钟

Centos桌面环境安装显卡驱动

1.前提准备

  • 安装依赖环境

    yum install kernel-devel-$(uname -r) gcc -y
    
  • 屏蔽系统自带的nouveau显卡驱动

    lsmod |grep nouveau #查看nouveau
    vim /etc/modprobe.d/blacklist-nouveau.conf # 添加如下内容
    blacklist nouveau 
    options nouveau modeset=0
    
  • 重建initramfs image

    mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
    dracut /boot/initramfs-$(uname -r).img $(uname -r)
    
  • 修改运行级别为文本模式

    systemctl set-default multi-user.target
    
  • 重启服务器

    reboot
    

2.本地安装

  • 在NVIDIA官网下载指定版本驱动

    地址:https://www.nvidia.cn/Download/Find.aspx?lang=cn
    
  • 安装过程

    chmod +x <driver_file> 
    ./<driver_file> 
    #driver_file替换为显卡驱动文件名称,如提示X service error,可通过如下方式进行解决
    #切换用户模式
    init 3
    再次执行安装
    
  • 验证

    nvidia-smi