Centos安装显卡

1、安装基础环境

yum -y install epel-release

yum -y install gcc kernel-devel kernel-headers

2.对应内核版本

yum info kernel-devel kernel-headers

Cat /proc/version

3、yum安装版本不对应。则去官网手动下载

离线安装对应的rpm: https://pkgs.org/download/kernel-headers

 

4、在英伟达官网下载相应驱动

​​​​

  4.1安装相关命令:

     rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

        rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm

yum -y install nvidia-detect

 4.2、检查显卡 nvidia-detect -v

4.3、官网下载:官方驱动 | NVIDIA

5、屏蔽所有带有的nouveau

打开文件:/lib/modprobe.d/dist-blacklist.conf

将nvidiafb注释掉。

添加:blacklist nouveau

options nouveau modeset=0  

6、重建iniramfs image步骤

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

dracut /boot/initramfs-$(uname -r).img $(uname -r)

  6.1:修改运行级别为文本模式

  systemctl set-default multi-user.target

重启服务器

  1. 7、查看nouveau是否已经禁用

  ls mod | grep nouveau

  1. 8、为显卡驱动文件授予X权限,然后直接运行

nvidia-smi查看是否有显示结果。

  1. 9、修改运行级别回图形模式

systemctl set-default graphical.target 

参考地址:

1、:Centos7 安装独立显卡驱动 - 总管 - 博客园 (cnblogs.com)

2、:centos7.5英伟达驱动:unable to find the kernel source tree for current running kernel;nvidia-smi has faild_unable to find the kernel source tree for the curr_haixwang的博客-CSDN博客

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值