Check GPU info in Ubuntu
How To

Check GPU Info in Ubuntu

Sagar Sharma
Sagar Sharma

Table of Contents

Want to check the GPU info in your Ubuntu system? I will be sharing multiple ways to do so in this tutorial.

So let's start with the first one.

Check GPU info using the lshw command

This is my personal favorite way to get the graphics driver info, as it gets the data in the most human-readable manner.

To get the GPU info using the lshw command, all you have to do is execute the given command:

sudo lshw -class display
use lshw command to get the GPU info in ubuntu

And if you just want to know the GPU you are using in your machine, you can use the following command:

sudo lshw -short | grep -i --color display
find which GPU I'm using in ubuntu

As you can see, I have Intel's graphics. Some systems have both Nvidia graphics drivers and Intel both. If that were the case, you would have seen both entries.

Check GPU info using the glxinfo command

The glxinfo utility is a part of the mesa library and does not come pre-installed in Ubuntu.

To install glxinfo, all you have to do is execute the following command:

sudo apt install mesa-utils

Once you are done with the installation, execute the glxinfo command with the -B flag:

glxinfo -B
use glxinfo command to get the GPU info in ubuntu

Check GPU info using the lspci command

This is an ideal method for those running more than one graphics card. 

To use the lspci command, first, you will have to update the database and get the most recent pci.ids file:

sudo update-pciids

Once done, use the lspci command:

lspci | grep 'VGA'

Here, note the first number which will serve as the device ID you want to target.

In my case, its 00:02.0:

use lspci command to find the GPU device ID

Once you know the device ID, execute the lspci command in the following manner:

sudo lspci -v -s [device_ID]
use lspci command to find the GPU info in ubuntu

Pretty cool. Isn't it?

Get GPU info of Nvidia cards in Ubuntu

This tool will only work when you have installed Nvidia drivers and won't work with nouveau drivers.

If you are running a GPU by Nvidia, there is a special tool called nvidia-smi.

All you have to do is execute the nvidia-smi command and it will get you everything related to your Nvidia GPU:

get Nvidia GPU info in Ubuntu

As you can see in the screenshot above, it shows the Nvidia driver version and many other details.

Want to check CPU info too? Here you have it!

There are multiple ways to check the CPU info in Linux including the lscpu, by checking the contents of the /proc/cpuinfo file, and more.

We have compiled such 8 utilities by which you can check the number of CPU cores and other information in the following guide:

How to Get CPU Info in Ubuntu
Here are various ways for getting the processor information in Ubuntu command line.

I hope that you will no longer find getting GPU info a complex task.

And if you have any doubts, let me know in the comments.

Sagar Sharma

Sagar Sharma

A software engineer who loves to tinker with hardware till it gets crashed. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.