How to install Nvidia driver on CentOS 7 Linux

I am a new CentOS 7 Linux desktop user. I need to use Nvidia software for my video editing software and other purposes. How do I install the Nvidia driver on CentOS 7 Linux?

Introduction: Nvidia drivers used for gaming, video editing, visualization, artificial intelligence and more. This page shows how to install Nvidia GPU drivers on a CentOS 7 Linux desktop.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements RHEL/CentOS Linux 7
Est. reading time 3 minutes

How to install Nvidia driver on CentOS 7 Linux

The procedure to install proprietary Nvidia GPU Drivers on CentOS 7 Linux is as follows:

  1. Update your system running yum command
  2. Blacklist nouveau driver
  3. Download the Nvidia driver for CentOS 7
  4. Install required software to install the proprietary Nvidia driver on CentOS
  5. Disable Nouveau driver in CentOS 7
  6. Switch to CentOS 7 to text mode
  7. Run the NVIDIA driver installer
  8. Reboot the CentOS 7 to use the NVIDIA driver

Let us see all steps in details for installing NVIDIA drivers on CentOS 7.

How to update CentOS 7 desktop

It is essential that you use the latest Linux kernel and other drivers. Open the terminal application and run:
$ sudo yum update
How to update CentOS 7 desktop

How to find out info about the Nvidia GPU on CentOS 7

Execute the lspci command with grep command $ lspci | grep -i --color 'vga\|3d\|2d'
$ sudo lshw -class display
Find out Nvidia card name on CentOS 7
From the above outputs, it is clear that I have NVIDIA Corporation GK104GLM [Quadro K5000M] and the nouveau driver loaded for the device. For more info see “Linux Find Out Graphics Card Installed In My System“.

Download the NVIDIA driver

Visit this page and grab the drivers for your Linux system:
Download and Installing NVIDIA Drivers on CentOS 7
I saved driver to ~/Downloads/ directory on my CentOS Linux 7 desktop:
$ ls -l ~/Downloads/

total 105416
-rw-rw-r--. 1 vivek vivek 107944209 Nov 14 01:58

How to install kernel-devel and other software

One must install kernel-devel and gcc kernel on a CentOS 7:
$ sudo yum group install "Development Tools"
$ sudo yum install kernel-devel

Turn on and install EPEL Repo on a CentOS 7.x

You must install dkms for registering the NVIDA kernel module with DKMS:
$ sudo yum -y install epel-release
$ sudo yum -y install dkms

How to disable nouveau driver

If the nouveau kernel driver used by the CentOS 7, installer would not work as this driver is incompatible with the NVIDIA driver and it must be disabled. Edit a file named /etc/default/grub as follows:
$ sudo vi /etc/default/grub
Append the following to the GRUB_CMDLINE_LINUX line:
Save and close the file. Rebuild the grub config and restart the system as per BIOS or UEFI system.

BIOS USER run this

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

UEFI USER run this

$ sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Reboot the Linux box now:
$ sudo reboot

How to switch to CentOS 7 to text mode from GUI

To install the Nvidia driver switch to console mode. The Nvidia installer refuse to work if you are running from GUI:

You appear to be running an X server; please exit X before installing.

You appear to be running an X server; please exit X before installing.

Hence, it is necessary to switch to text mode. Open a terminal Window and run:
$ sudo systemctl isolate

Installing Nvidia driver on CentOS 7

Log in and type the following command:
$ sudo bash

Install Nvidia driver on CentOS 7 Linux command

Installing Nvidia driver in CentOS 7

Just follow on-screen instructions. Once installed reboot the machine again:
$ sudo reboot


You must log in and run the nvidia-settings from GUI to verify that everything working fine:
Running nvidia-settings on CentOS 7
Run the following nvidia-smi command to see what apps are using the NVIDIA GPU on CentOS 7 box:
$ nvidia-smi
Running nvidia-smi on CentOS 7 Linux


This page demonstrated how to disable the open-source Nouveau driver and install the proprietary Nvidia driver in CentOS 7 Linux.

This entry is 2 of 2 in the Nvidia Linux and Unix Tutorial series. Keep reading the rest of the series:
  1. Ubuntu Linux Install Nvidia Driver (Latest Proprietary Driver)
  2. How to install Nvidia driver on CentOS 7 Linux

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 5 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
5 comments… add one
  • Rajan Mar 17, 2021 @ 7:33

    Wow, very helpful. Successfully installed Nvidea driver.

    Those who downloaded the Nvidea Driver rpm file instead of .run file, follow this command

    i) rpm -i nvidia-driver-local-repo-rhel7-418.181.07-1.0-1.x86_64.rpm
    ii) yum clean all
    iii) yum install cuda-drivers
    iv) reboot

    • 🐧 Vivek Gite Mar 17, 2021 @ 13:14

      Glad you found it useful and thank you for sharing your tips too. Cheers mate.

  • DanieBe Apr 15, 2021 @ 11:37

    Spectacular! Clear and simple!

  • Stephani Macalino May 5, 2021 @ 6:09

    What if my graphics is llvmpipe and not nouveau? Do I do the same step but change “nouveau” for “llvmpipe”?

    • 🐧 Vivek Gite May 5, 2021 @ 9:52

      I never tried but my guess is you need to disable llvmpipe too.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum