安装基础依赖环境

先更新centos vault的仓库源地址:

参考:

centos-vault | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

sed -e "s|^mirrorlist=|#mirrorlist=|g" \
    -e "s|^#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/8.5.2111|g" \
    -e "s|^#baseurl=http://mirror.centos.org/\$contentdir/\$releasever|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/8.5.2111|g" \
    -i.bak \
    /etc/yum.repos.d/CentOS-*.repo


建立缓存:

yum makecache

安装gcc和编译环境

dnf install gcc-toolset-11-gcc

dnf install elfutils-libelf-devel

安装kernel-devel包
yum install kernel-devel

rpm -qa |grep kernel-devel
kernel-devel-4.18.0-348.7.1.el8_5.x86_64

**安装匹配kernel devel包的内核**
dnf install kernel-core-4.18.0-348.7.1.el8_5.x86_64 kernel-modules-4.18.0-348.7.1.el8_5.x86_64

[root@PC002W amax]# uname -r
4.18.0-348.7.1.el8_5.x86_64



重启以新内核启动

打开/lib/modprobe.d/dist-blacklist.conf

注释掉这里:

#blacklist nvidiafb

添加以下:

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)

重启

加载gcc环境

source /opt/rh/gcc-toolset-11/enable

安装驱动:

bash xxx.RUN -a -s -X --no-nouveau-check --no-x-check -no-opengl-files