Linux Commands

How to Check If NVIDIA GPU Is Installed on Your Computer from Linux

In this article, we will show you how to check if an NVIDIA GPU is installed on your computer from different Linux distributions.

Topic of Contents:

  1. Method 1: Using the Lspci Command
  2. Method 2: Using the Nvidia-Detect Command
  3. Method 3: Using the Ubuntu-Drivers Command
  4. Conclusion

Method 1: Using the Lspci Command

The “lspci” command is used to list all the PCI devices that are installed on your computer. It can also be used to list only the GPUs that are installed on your computer. The “lspci” command is available on most of the common Linux distributions.

To list only the installed GPUs of your computer, run the following command:

$ lspci | grep 'VGA|NVIDIA'

As you can see, we have an NVIDIA GeForce GTX 1050 Ti GPU installed on our computer. You will most likely have a different GPU installed on your computer. So, you will see a different output than ours.

A screenshot of a computer Description automatically generated

Method 2: Using the Nvidia-Detect Command

The “nvidia-detect” command is available on the Debian Linux operating system. If you’re using a Debian Linux on your computer, you can use it to check whether you have an NVIDIA GPU installed on your computer. The “nvidia-detect” tool is not installed on Debian Linux by default. But you can easily install it from the Debian non-free package repository.

First, enable the Debian non-free package repository on your Debian Linux operating system.

Then, update the Debian Linux package repository cache with the following command:

$ sudo apt update

A screenshot of a computer Description automatically generated

To install the “nvidia-detect” tool, run the following command:

$ sudo apt install nvidia-detect

To confirm the installation, press “Y” and then press <Enter>.

A screenshot of a computer Description automatically generated

To check whether you have an NVIDIA GPU installed on your computer, run the “nvidia-detect” command as follows:

$ nvidia-detect

If you have an NVIDIA GPU installed on your computer, it is listed on the output of the “nvidia-detect” command. As you can see, we have an NVIDIA GeForce GTX 1050 Ti GPU installed on our computer. You will most likely have a different NVIDIA GPU installed on your computer.

A screenshot of a computer Description automatically generated

Method 3: Using the Ubuntu-Drivers Command

If you’re using Ubuntu Linux on your computer, you can use the “ubuntu-drivers” command to check whether you have an NVIDIA GPU installed on your computer.

To check whether you have an NVIDIA GPU installed on your computer from the Ubuntu Linux operating system, run the “ubuntu-drivers” command as follows:

$ ubuntu-drivers devices

If you have an NVIDIA GPU installed on your computer, it will be listed on the output of the “ubuntu-drivers” command. As you can see, we have an NVIDIA GeForce GTX 1050 Ti GPU installed on our computer. You will most likely have a different NVIDIA GPU installed on your computer.

A screenshot of a computer Description automatically generated

Conclusion

In this article, we showed you how to use the “lspci” command to check if you have an NVIDIA GPU installed on your computer from most of the common Linux distributions. We also showed you how to use the “nvidia-detect” and “ubuntu-drivers” commands to check if you have an NVIDIA GPU installed on your computer from the Debian Linux and Ubuntu Linux operating systems, respectively.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.