How to get graphics card (GPU) information on Linux

By | December 7, 2023

Get GPU Info on Linux

You need to find out the correct model and vendor of the graphics card on your system, to be able to install the correct up-to-date drivers and get the hardware to function properly.

For Nvidia and AMD discrete graphics cards, proprietory drivers are available from respective vendors that deliver the best performance.

Most modern linux distros can detect variety of graphics card from intel, nvidia and amd and use open source drivers (like nouveau for nvidia) that are either provided by vendor or are community managed. However the open source drivers are usually not the best performing ones as they cannot utilise the gpu's capabilities to the full potential.

If you have an external / discrete graphics card like Nvidia or Ati, then you probably already know its name and model, and can lookup online for further details.

In this article we shall take a look at some commands that can be used to check gpu details on linux. These details would include: Vendor name, model, kernel driver being used

1. lspci

First one is lscpi and here is a quick example showing how to fetch details about graphics unit (also called vga card or video card).

lspci -vnn | grep VGA -A 12

Here is how the output looks on my old desktop machine which had onboard gpu on an intel motherboard.

$ lspci -vnn | grep VGA -A 12
00:02.0 VGA compatible controller [0300]: Intel Corporation 82G35 Express Integrated Graphics Controller [8086:2982] (rev 03) (prog-if 00 [VGA controller])
        Subsystem: Intel Corporation Device [8086:d701]
        Flags: bus master, fast devsel, latency 0, IRQ 44
        Memory at e0200000 (32-bit, non-prefetchable) [size=1M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 2440 [size=8]
        Expansion ROM at <unassigned> [disabled]
        Capabilities: <access denied>
        Kernel driver in use: i915

The first line has the nae of the vendor, the model name/series and the pci id.

VGA compatible controller [0300]: Intel Corporation 82G35 Express Integrated Graphics Controller [8086:2982]

Note the numbers in the bracket - 8086:2982. Such a number is present for almost all graphics card. The first part (8086) indicates the vendor id (which is Intel here) and the second number (2982) indicates the pci id, which indicates the model of the graphics unit.

Now you can search google for more details using the Vendor name and the pci id.

Here is the output for another machine running in i5-7400 intel cpu with integrated gpu

$ lspci -vnn | grep VGA -A 12
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:5912] (rev 04) (prog-if 00 [VGA controller])
        DeviceName:  Onboard IGD
        Subsystem: Gigabyte Technology Co., Ltd HD Graphics 630 [1458:d000]
        Flags: bus master, fast devsel, latency 0, IRQ 131
        Memory at ee000000 (64-bit, non-prefetchable) [size=16M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: i915
        Kernel modules: i915

00:14.0 USB controller [0c03]: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller [8086:a12f] (rev 31) (prog-if 30 [XHCI])
$

Note the iGPU name: Intel Corporation HD Graphics 630 [8086:5912]

2. lshw command

The lshw command can also be used to get the above information. Specify the class "display" to show only display related hardware details. Ideally it should be run with sudo so that it can extract maximum possible details about the gpu

sudo lshw -numeric -C display
$ lshw -numeric -C display
WARNING: you should run this program as super-user.
  *-display:0             
       description: VGA compatible controller
       product: 82G35 Express Integrated Graphics Controller [8086:2982]
       vendor: Intel Corporation [8086]
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 03
       width: 64 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:44 memory:e0200000-e02fffff memory:d0000000-dfffffff ioport:2440(size=8)

The pci details is indicated in the same way. The active device driver is also listed in the "configuration" line.

Machine 2: Here is the output for another ubuntu desktop machine running with i5-7400

$ sudo lshw -numeric -C display
  *-display                 
       description: VGA compatible controller
       product: HD Graphics 630 [8086:5912]
       vendor: Intel Corporation [8086]
       physical id: 2
       bus info: pci@0000:00:02.0
       logical name: /dev/fb0
       version: 04
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=i915 latency=0 resolution=1920,1080
       resources: irq:131 memory:ee000000-eeffffff memory:d0000000-dfffffff ioport:f000(size=64) memory:c0000-dffff
enlightened@enlightened:~$

Machine 3: Here is a sample output from a system having an nvidia geforce 210 graphics card.

$ lspci -vnn | grep VGA -A 12
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT218 [GeForce 210] [10de:0a65] (rev a2) (prog-if 00 [VGA controller])
.....

3. inxi

The next command is inxi and it presents harware information in a very detailed and easy to read manner. With the -G option it reports the gpu model, driver, and linux display server being used along with 3d acceleration api and library being used.

inxi -G
$ inxi -G
Graphics:
  Device-1: Intel HD Graphics 630 driver: i915 v: kernel
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 23.2.0 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915
    resolution: 1920x1080~75Hz
  API: OpenGL v: 4.6 Mesa 23.2.1-1ubuntu3 renderer: Mesa Intel HD Graphics
    630 (KBL GT2)
$

The inxi command can display even more details along with information about display monitor with the options "-xx" or "-a".

inxi -G -xx
inxi -G -xx -a

Here is a quick example from my main ubuntu desktop machine using LG 22MK600M ips monitor.

$ inxi -G -xx -a
Graphics:
  Device-1: Intel HD Graphics 630 vendor: Gigabyte driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: HDMI-A-1
    empty: DP-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:5912 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 23.2.0
    compositors: 1: kwin_x11 2: Picom v: 10 driver: X: loaded: modesetting
    unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: HDMI-A-1 mapped: HDMI-1 model: LG (GoldStar) FULL HD
    serial: 16843009 built: 2016 res: 1920x1080 hz: 75 dpi: 102 gamma: 1.2
    size: 480x270mm (18.9x10.63") diag: 551mm (21.7") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  API: OpenGL v: 4.6 Mesa 23.2.1-1ubuntu3 renderer: Mesa Intel HD Graphics
    630 (KBL GT2) direct-render: Yes
$

Pro Tip: If you want to check what what resolutions are supported by your monitor, use the --edid option with inxi. Here is a sample output

$ inxi --edid
Graphics:
  Device-1: Intel HD Graphics 630 vendor: Gigabyte driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: HDMI-A-1
    empty: DP-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:5912 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 23.2.0
    compositors: 1: kwin_x11 2: Picom v: 10 driver: X: loaded: modesetting
    unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: HDMI-A-1 mapped: HDMI-1 model: LG (GoldStar) FULL HD
    serial: 16843009 built: 2016 res: 1920x1080 hz: 75 dpi: 102 gamma: 1.2
    chroma: red: x: 0.647 y: 0.333 green: x: 0.306 y: 0.631 blue: x: 0.149
    y: 0.047 white: x: 0.314 y: 0.329 size: 480x270mm (18.9x10.63")
    diag: 551mm (21.7") ratio: 16:9 modes: 1920x1080, 1680x1050, 1400x1050,
    1600x900, 1280x1024, 1440x900, 1280x800, 1152x864, 1280x720, 1024x768,
    800x600, 720x576, 720x480, 640x480, 720x400
  API: OpenGL v: 4.6 Mesa 23.2.1-1ubuntu3 renderer: Mesa Intel HD Graphics
    630 (KBL GT2) direct-render: Yes
$

See the Monitor-1 section above which reports the modes (list of supported resolutions.

4. neofetch

This is a rather fancy tool that reports some hardware details in a limited manner. The GPU name is reported though.

Look at the following output. It mentions the GPU: Intel HD Graphics 630.

$ neofetch
           `.:/ossyyyysso/:.               enlightened@enlightened 
        .:oyyyyyyyyyyyyyyyyyyo:`           ----------------------- 
      -oyyyyyyyodMMyyyyyyyysyyyyo-         OS: Kubuntu 23.10 x86_64 
    -syyyyyyyyyydMMyoyyyydmMMyyyyys-       Host: H110M-H 
   oyyysdMysyyyydMMMMMMMMMMMMMyyyyyyyo     Kernel: 6.5.0-10-generic 
 `oyyyydMMMMysyysoooooodMMMMyyyyyyyyyo`    Uptime: 28 days, 19 hours, 19 mins 
 oyyyyyydMMMMyyyyyyyyyyyysdMMysssssyyyo    Packages: 5441 (dpkg), 24 (snap) 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   Shell: bash 5.2.15 
oyyyysoodMyyyyyyyyyyyyyyyyyyydMMMMysyyyo   Resolution: 1920x1080 
yyysdMMMMMyyyyyyyyyyyyyyyyyyysosyyyyyyyy   DE: Plasma 5.27.8 
yyysdMMMMMyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy   WM: KWin 
oyyyyysosdyyyyyyyyyyyyyyyyyyydMMMMysyyyo   Theme: [Plasma], Breeze [GTK2/3] 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   Icons: oxygen [Plasma], oxygen [GTK2/3] 
 oyyyyyydMMMysyyyyyyyyyyysdMMyoyyyoyyyo    Terminal: konsole 
 `oyyyydMMMysyyyoooooodMMMMyoyyyyyyyyo     Terminal Font: Ubuntu Mono 10 
   oyyysyyoyyyysdMMMMMMMMMMMyyyyyyyyo      CPU: Intel i5-7400 (4) @ 3.500GHz 
    -syyyyyyyyydMMMysyyydMMMysyyyys-       GPU: Intel HD Graphics 630 
      -oyyyyyyydMMyyyyyyysosyyyyo-         Memory: 20588MiB / 32001MiB 
        ./oyyyyyyyyyyyyyyyyyyo/.
           `.:/oosyyyysso/:.`

Integrated chipsets vs dedicated gpus

For dedicated units like nvidia or ati, you can easily search online for the model number or pci id. The specifications and other details would be available on the vendor's website.

However for integrated graphics chipsets like Intel GMA, you may not get sufficient details by just searching the series name (82G35 over here) or pci id. The series covers many similar models, while the pci id might not be documented on the website.

In that case, lookup the motherboard model and find its specifications. Vendors publish product specification documents for every motherboard model they manufacture. These contain technical details about the hardware.

To find your motherboard model, use dmidecode or inxi command.

Dmidecode

$ sudo dmidecode -t baseboard | grep -i 'Product'
        Product Name: DG35EC

Inxi

$ inxi -M
Machine:   Mobo: Intel model: DG35EC version: AAE29266-210
           Bios: Intel version: ECG3510M.86A.0112.2009.0203.1136 date: 02/03/2009

The above output shows that its a "Intel DG35EC" motherboard. Google up for that model to find the product specifiation document, and look for Video/Graphics information in it.

Check hardware acceleration support (api and library)

With hardware based 3d acceleration, applications that need to draw 3d graphics can use the hardware directly to process and generate the graphics, speeding up 3d rendering significantly. For this, the graphics card must support hardware acceleration and the correct drivers must be installed on the system to use this feature.

The 3d processing functions provided by the hardware adhere to the OpenGL specifications, and with the right hardware, applications can access them through the opengl api. OpenGL just defines the functions and the implementation is done inside the hardware which makes it very fast.

However there are libraries like MESA that implement the opengl functions entirely inside software. So it is possible to render graphics using opengl without actually having an opengl compatible gpu. So by checking the opengl rendering library, we can find out if hardware acceleration is present or not.

Check the glxinfo command output for OpenGL details

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) 965G 
OpenGL version string: 2.1 Mesa 10.1.0
OpenGL shading language version string: 1.20
OpenGL extensions:

The "OpenGL renderer string" points to MESA libraries which means that 3d rendering is being handled entirely inside software. This is going to be slow and games would not work well.

The output on a machine with dedicated nvidia geforce 200 graphics card looks like this

$ glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 210/PCIe/SSE2
OpenGL core profile version string: 3.3.0 NVIDIA 331.20
OpenGL core profile shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.3.0 NVIDIA 331.20
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler

Note the line

OpenGL renderer string: GeForce 210/PCIe/SSE2

So the OpenGL renderer is GeForce, which is the nvidia proprietory driver. This indicates the hardware based 3d acceleration is available. So graphics performance would be good.

Monitor GPU load (usage)

Another important aspect of hardware analysis is to monitor the hardware usage or how much processing load it is under. For resources like cpu, memory, disk activity we can monitor the load using tools like htop, top, iotop etc.

However for gpu or graphics cards, there is no integrated approach to monitor the utilisation using a single command approach. GPUs are primarily from 3 major vendors, namely nvidia, amd and intel. For each of the vendor there are vendor provided specific programs and tools to monitor the gpu usage.

For instance, for intel integrated gpus you can use the intel_gpu_top command. For nvidia you have the nvidia-smi command.

Here are some detailed article on the subject:

How to Check Intel Integrated GPU Details on Ubuntu / Linux
How to monitor Nvidia GPU temperature on Ubuntu / Linux

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

35 Comments

How to get graphics card (GPU) information on Linux
  1. Displaybenchmark

    My issue is during booting time and after entering laptop password i keep getting screen flashing multiple time, which is annoying to me. my laptop model is Lenovo e570. I think i am having driver issue or my screen size is not available in the Ubuntu settings. i need help

  2. Andree

    There are a few ways to get information about your graphics card on Linux. One way is to use the lspci command. This command will show you all of the PCI devices on your system. To get information about your graphics card, you can use the -v flag with the lspci command. This will show you your graphics card’s vendor, device, and subsystem IDs.

  3. Alejandro Illescas

    Thanks you.
    You were be clear and concise. And you clarify me many points that I have unconnected until now.
    Thanks Again

  4. Fios

    How do I make my amd graphics card as default? As in I should see it as the default graphics card in settings -> about. (I’m using Ubuntu 18.04)

  5. hameed lungi

    So there is no easy one step way any more to grep out card info, you have to look at the entire lspci or other info output, then find the ones that are at busid .0, which is what sgfxi and inxi now do.

  6. Shaharyar

    The actual performance of a GPU both depends on the internal architecture and the way the displaying purpose is done. A GPU normally has multiple cores, each doted with L1 and sometimes L2 cache. A GPU chip is capable of both integer and floating point execution.

  7. Nolan

    If you are a windows user then you will just install an additional softeare like nvedia and get all info. Also you can see all information in your task manager.

  8. Nolan

    Linixu os is difficult for me. I am a windows user, I just download software to check GPU information and it shows me all details about GPU.

  9. Brian Dean

    Bruh! Can you please make a guide for windows? How can we get the info about Installed GPU on windows?

    Thanks in Advance

  10. Monitortechy

    The dedicated graphics card is not showing the details, I am only able to get the details of the integrated card, can anyone guide me how can I get the details of dedicated card as well?

  11. DeMus

    Nice information to find out if the card is using acceleration or not, but what when it doesn’t? My Intel GPU does not, so what do I do now? I was hoping to find help in this article but obviously I was wrong.

  12. Dragos

    I tried command glxinfo | grep OpenGL and it is case sensitive. It doesn’t work when you write opengl in lowercase. I’m using linux mint 19.1.

  13. Peters

    There are two types of drivers you can install to get your graphics cards working, namely proprietary drivers or open source. While there are good and bad aspects to both, they differ if you’re using a Nvidia or AMD graphics card.

  14. Branden Lambert

    I’m not able to get information about my dedicated graphics card. It’s only showing information about my integrated card. Does this mean that the dedicated card is not inserted properly?

  15. Areeb

    Good info also inxiDev lspci does display more details about the manufacturer though like the OP showed:

    1a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/580] [1002:67df] (rev e7) (prog-if 00 [VGA controller])
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:22f1]

  16. Inukaze

    Hi there, how i can determine which is the Total MB of the GPU ???
    Because with lspci, the maximum says is 256M, not matter if the GPU using have 2GB or more.

  17. inxiDev

    The graphic card id method you are showing is legacy, as I discovered recently with inxi and sgfxi, they started failing to report cards because they were relying on the VGA detection method, but in fact, there are now 3 different syntaxes being used to identify cards, and you cannot simply grep for them because the syntaxes are used either as a second feature of the card, like 3D controller, or Display Controller, OR those are being used to identify a real card. The only way to determine which it is is to also then check the pci bus id, and if it ends in .0, it’s a real graphic card. sgfxi had dual card detection which was failing because of this issue, it took a few user data sets to figure out and debug the issue. VGA always works, but will only return cards using the VGA id method, and it will miss all cards, often things like intel onboard cards.

    inxi -Gxx
    Graphics: Card: NVIDIA GT218 [GeForce 210] bus-ID: 02:00.0 chip-ID: 10de:0a65
    Display Server: X.Org 1.14.4 driver: nvidia Resolution: 1280×[email protected], 1280×[email protected]
    GLX Renderer: GeForce 210/PCIe/SSE2/3DNOW! GLX Version: 3.3.0 NVIDIA 337.12 Direct Rendering: Yes

    The last item, Direct Rendering, generally shows if the video driver is working, by the way. I don’t remember which release of inxi fixed this bug, but it’s certainly fixed now, in 2.1.20. I didn’t personally have a system that used alternate syntax for primary card id, but by good fortune I did have systems that showed the problem with the busID, for example, you can have a busid of 02.01.1 which is NOT a card, but just the 3D controller identifier for a VGA id’ed card at 02.01.0 . I have no idea who or what made this change, all I know is it happened sometime in the past 2 or 3 years. Obviously as well, VGA is a legacy term in the first place, which is I think why they moved to other terms. So there is no easy one step way any more to grep out card info, you have to look at the entire lspci or other info output, then find the ones that are at busid .0, which is what sgfxi and inxi now do.

    Your inxi review recently was good by the way, I liked it, thanks.

    1. John

      There are a few ways to get information about your graphics card on Linux. One way is to use the lspci command. This command will show you all of the PCI devices on your system. To see information about your graphics card, you can run the following command:

      lspci -v | grep VGA

      This will show you information such as the name of your graphics card, the driver that is being used, and other details about your graphics card.

Leave a Reply

Your email address will not be published. Required fields are marked *