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:
/lib/modprobe.d/nvidia-installer-disable-nouveau.conf
/etc/modprobe.d/nvidia-installer-disable-nouveau.conf

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 https://www.nvidia.com/en-us/drivers/unix/
and use wget to download.

then proceed:

yum install gcc kernel-devel kernel-headers  
systemctl set-default multi-user.target  
./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