Install the Nvidia GeForce Drivers on Centos 8

Step 1: Disable nouveau driver

blacklist nouveau
options nouveau modeset=0

add the above configs to these files:

Step 2: Rebuild the initial ramdisk image

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

Step 3: Download the Nvidia drivers and install it

you can find them on
and use wget to download.

then proceed:

yum install gcc kernel-devel kernel-headers  
systemctl set-default  
./NVIDIA-Linux-x86_64-*.run --kernel-source-path=/usr/src/kernels/*  -k $(uname -r)  

If the installation failed, try: ll /usr/libs/modules/*
rebuild the symbolic link when the font color of build path is red

rm ./build
ln -s /usr/src/kernels/[kernel]/ build