This instruction is based on CentOS7 and Nvidia driver.
**Preparation**
`yum -y update`
`yum -y groupinstall "Development Tools"`
`yum -y install kernel-devel`
Download the latest NVIDIA driver for unix.
In order to have the NVIDIA drivers rebuilt automatically with future kernel updates you can also install the EPEL repository and the DKMS package. This is optional.
`yum -y install epel-release`
`yum -y install dkms`
**Reboot machine to make sure running the newest kernel**
Edit `/etc/default/grub`. Append the following to “`GRUB_CMDLINE_LINUX`”
`rd.driver.blacklist=nouveau`
Generate a new grub configuration to include the above changes.
`grub2-mkconfig -o /boot/grub2/grub.cfg`
Edit/create `/etc/modprobe.d/blacklist.conf` and append:
`blacklist nouveau`
Backup your old initramfs and then build a new one