lspci |grep -E "VGA|3D"
去 http://www.nvidia.com/Download/Find.aspx?lang=en-us 下载驱动
chmod +x /path/to/NVIDIA-Linux-*.run
- 切换到root
-
添加 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
-
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
- 编辑 /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"
- 更新 grub2 配置文件
## BIOS ## grub2-mkconfig -o /boot/grub2/grub.cfg ## UEFI CentOS Stream 9/8 ## grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
- 生成初始化文件
## 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)
- 设置启动level
systemctl set-default multi-user.target # 重启 reboot
- 登录切换到root或者直接以root登录,切换到驱动所在目录后执行
./NVIDIA-Linux-*.run
-
一路选择Yes或者Ok,然后
systemctl set-default graphical.target reboot
-
验证方法
在终端中输入:nvidia-smi or nvidia-settings