Install NVIDIA Drivers on CentOS Stream 9(rockylinux9.4成功)
主板为技嘉mz72-hb2
显卡为4090
一.Disable Secure Boot From the BIOS
二.Enabling the EPEL Repository on CentOS Stream 9
1.update the DNF package repository cache
sudo dnf makecache
如果源报错,请自行切换国内源。
2.Enable the official CentOS Stream 9 CRB package repository
sudo dnf config-manager --set-enabled crb
3.Install the epel-release and epel-next-release packages
sudo dnf install -y epel-release epel-next-release
sudo dnf makecache
三.Installing the Required Dependencies and Build Tools for Compiling NVIDIA Kernel Modules
1.install the required build tools and the required dependency libraries for compiling the NVIDIA kernel modules
sudo dnf install -y kernel-headers-$(uname -r) kernel-devel-$(uname -r) tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-opengl libglvnd-glx libglvnd-devel acpid pkgconfig dkms
如果安装headers和devel没有当前可用的,可以先安装dkms或更新kernel然后重启继续这部。
四.Adding the Official NVIDIA CUDA Package Repository on CentOS Stream 9
1.add the official NVIDIA CUDA package repository on CentOS Stream 9
sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel9/$(uname -i)/cuda-rhel9.repo
sudo dnf makecache
五.Installing the Latest NVIDIA GPU Drivers on CentOS Stream 9
1.install the latest version of the NVIDIA GPU drivers on CentOS Stream 9
sudo dnf module install -y nvidia-driver:latest-dkms
如果要安装特定版本可以更改上面部分为指定版本
六.Checking if NVIDIA Drivers are Installed Properly
lsmod | grep nvidia
lsmod | grep nouveau
nvidia-smi