How to get the GPU info?

1,409,609

Solution 1

That type of information is non-standard, and the tools you will use to gather it vary widely.

The command glxinfo will give you all available OpenGL information for the graphics processor, including its vendor name, if the drivers are correctly installed.

To get clock speed information, there is no standard tool.

  • For ATI/AMD GPUs running the old Catalyst driver, aticonfig --odgc should fetch the clock rates, and aticonfig --odgt should fetch the temperature data. I'm not familiar with AMDGPU-Pro, but a similar tool should exist.
  • For NVIDIA GPUs, the nvidia-smi tool will show all of the information you could want, including clock speeds and usage statistics.

I am not aware of an equivalent tool for the open source drivers or for Intel or other GPUs, but other information on the hardware can be fetched from the lspci and lshw tools.

Solution 2

I do not know of a direct equivalent, but lshw should give you the info you want, try:

sudo lshw -C display

(it also works without sudo but the info may be less complete/accurate)

You can also install the package lshw-gtk to get a GUI.

Solution 3

A blog post focusing on work done on the command-line is here:

http://www.cyberciti.biz/faq/howto-find-linux-vga-video-card-ram/

Find out the device ID:

 lspci | grep ' VGA ' | cut -d" " -f 1
03:00.0

You can then use this output with lspci again, forming two nested commands

lspci  -v -s  $(lspci | grep ' VGA ' | cut -d" " -f 1)

If you have more than 1 GPU card, try this equivalent command instead:

lspci | grep ' VGA ' | cut -d" " -f 1 | xargs -i lspci -v -s {}

Output from my system:

03:00.0 VGA compatible controller: NVIDIA Corporation G98 [Quadro NVS 295] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: NVIDIA Corporation Device 062e
    Flags: bus master, fast devsel, latency 0, IRQ 24
    Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
    Memory at ec000000 (64-bit, prefetchable) [size=64M]
    Memory at f4000000 (64-bit, non-prefetchable) [size=32M]
    I/O ports at dc80 [size=128]
    [virtual] Expansion ROM at f7e00000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: nvidia

EDIT: You can avoid the <access denied> by launching with sudo

So, (prefetchable) [size=64M) indicates that I have a 64-MB NVIDIA card. However, I don't, it's rather 256 MB. Why? See below.

To see how to get the most info and performance out of it, read an extremely comprehensive article on the Arch-Linux Wiki

https://wiki.archlinux.org/index.php/NVIDIA

For nvidia users, start with

nvidia-smi

(This works with the Nvidia drivers installed,but not with systems running the open-source 'nouveau' driver).

Output

Thu Dec 19 10:54:18 2013       
+------------------------------------------------------+                       
| NVIDIA-SMI 5.319.60   Driver Version: 319.60         |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro NVS 295      Off  | 0000:03:00.0     N/A |                  N/A |
| N/A   73C  N/A     N/A /  N/A |      252MB /   255MB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Compute processes:                                               GPU Memory |
|  GPU       PID  Process name                                     Usage      |
|=============================================================================|
|    0            Not Supported                                               |
+-----------------------------------------------------------------------------+

This indicates that I have a 256 MB GDDR3 Graphics card.

At this time, I don't know how to get this for Intel and AMD/ATI GPUs.

Solution 4

Run google-chrome and navigate to the URL about:gpu. If chrome has figured out how to use OpenGL, you will get extremely detailing information about your GPU.

Solution 5

Because you specified a command like cat for CPU's this is therefore the equivalent for GPU's. Specifically for Nvidia cards. It requires no software except the Nvidia device driver to be loaded.

The path here works for the cards I have. But yours may differ as others have pointed out in the comments.

1st GPU

> cat /proc/driver/nvidia/gpus/0/information
Model:       GeForce GTX 680
IRQ:         24
GPU UUID:    GPU-71541068-cded-8a1b-1d7e-a093a09e9842
Video BIOS:      80.04.09.00.01
Bus Type:    PCIe
DMA Size:    40 bits
DMA Mask:    0xffffffffff
Bus Location:    0000:01.00.0

2nd GPU

> cat /proc/driver/nvidia/gpus/1/information
Model:       GeForce GTX 580
IRQ:         33
GPU UUID:    GPU-64b1235c-51fc-d6f1-0f0e-fa70320f7a47
Video BIOS:      70.10.20.00.01
Bus Type:    PCIe
DMA Size:    40 bits
DMA Mask:    0xffffffffff
Bus Location:    0000:08.00.0
Share:
1,409,609

Related videos on Youtube

user2413
Author by

user2413

Updated on September 17, 2022

Comments

  • user2413
    user2413 over 1 year

    I'm looking for a command that would give me the same info as:

    cat /proc/cpuinfo 
    

    Except for the GPU (type of the chip and memory, frequency).

    • Charlie Parker
      Charlie Parker about 6 years
      what does: cat /proc/cpuinfo do? what info are you looking for?
    • Emobe
      Emobe over 4 years
      @CharlieParker it outputs information of the cpu...
  • jmardones
    jmardones about 13 years
    Had to put gksu before the command in the menu to get lshw-gtk to work.
  • Martin Thoma
    Martin Thoma over 9 years
    +1 for nvidia-smi (that should be highlighted a bit in my opinion)
  • stiv
    stiv about 9 years
    How to install glxinfo?
  • Brett Rigby
    Brett Rigby about 9 years
    @stiv: It's part of the Mesa library, and comes with the package mesa-utils on Ubuntu.
  • matt wilkie
    matt wilkie over 8 years
    Thanks! (thoughcat /proc/driver/nvidia/gpus/0000\:01\:00.0/information for me)
  • Eliah Kagan
    Eliah Kagan almost 7 years
    This also works in Chromium (chromium-browser).
  • Elder Geek
    Elder Geek over 6 years
    I'm not seeing the video card frequency and memory in this answer. There are far simpler methods to obtain the model of GPU which appears to be all you are giving us. I'm not sure what this adds to the existing answers.
  • Elder Geek
    Elder Geek over 6 years
    aticonfig doesn't appear to be available since the retirement of fglrx. nvclock also appears to have been abandoned since the last version was for trusty. Do you have any updated solutions? Here's what I have so far..
  • Elder Geek
    Elder Geek over 6 years
    Any updates? I'm a fan of the command but the only clock rate (frequency) it seems to provide for me is the base bus clock 33MHz. I'm attempting to bring this Q&A up to date. Thank you!
  • Braden Best
    Braden Best about 6 years
    The screenfetch program does the same thing and doesn't require a PPA to install.
  • HaoZeke
    HaoZeke about 6 years
    It's a shell script. Plus I linked to its github as well so you can just use it as a script.
  • Camille Goudeseune
    Camille Goudeseune about 6 years
    Here's screenfetch: github.com/KittyKatt/screenFetch
  • INElutTabile
    INElutTabile about 6 years
    This should really be the accepted answer!
  • Nathan
    Nathan about 6 years
    Apologies, new to Deep Learning. What should it say if I have a GPU? It says product: 2nd Generation Core Processor Family Integrated Graphics Controller
  • John Hamilton
    John Hamilton almost 6 years
    glxinfo | grep "Device" worked well enough for me on an Intel GPU
  • Jacksonkr
    Jacksonkr almost 6 years
    Clever. Along these lines I additionally went to chromeexperiments.com to see the performance there. Smooth as butter - I'm definitely on gpu
  • user5280911
    user5280911 over 5 years
    This is the only correct answer in on-demand cloud/HPC cluster environment on which glxinfo or lspci both fail (the former because there's no OpenGL and display, the latter because the nVidia graphics card is abstracted by a graphics controller like Matrox G200eW3). The folder name under gpus is 0000:3b:00.0 or 0000:d8:00.0 for me, so we should type: cat /proc/driver/nvidia/gpus/0000:3b:00.0/information. The lovely Tesla V100-PCIE-16GB model shows that the qsub job limit is satisfied as desired.
  • mrgloom
    mrgloom over 5 years
    nvidia-smi not showing me full GPU name.
  • Chris1804505
    Chris1804505 over 5 years
    I use: glxinfo | egrep -i 'device|memory'
  • Torsten Bronger
    Torsten Bronger over 5 years
    All these greps yield “llvmpipe” on my system. Very odd model …
  • Nayantara Jeyaraj
    Nayantara Jeyaraj about 5 years
    @stiv glxinfo can be installed using the command : sudo apt install mesa-utils
  • johny why
    johny why over 4 years
    I'm getting 04. My GPU is 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 03) (prog-if 00 [VGA controller])
  • Nickolay
    Nickolay over 4 years
    nvidia-smi -q, as suggested by @Quanlong uses more sensible output format.
  • IT_User
    IT_User about 4 years
    nvidia-smi will show stats as well to include GB size.
  • boomkin
    boomkin about 4 years
    This was also an issue solver for me with my NVIDIA card. Found this in the official CUDA installation guide: docs.nvidia.com/cuda/cuda-installation-guide-linux/…
  • Jack G
    Jack G almost 4 years
    @Nathan That means that you have a GPU....probably a very weak GPU. Your GPU says integrated graphics, which means that it's integrated into the CPU. Your CPU has it own component which functions as a graphics card and probably (to save on costs) uses the ordinary RAM to store its buffers. You do not have a separate independent removable graphics card.
  • Shayan Amani
    Shayan Amani almost 4 years
    to be even shorter: $nvidia-smi -L
  • Protect children of Donbas2014
    Protect children of Donbas2014 over 3 years
    Only NVIDIA supported.
  • Eric Wiener
    Eric Wiener almost 3 years
    You can also use $ nvidia-smi --query-gpu=gpu_name --format=csv to just get the GPU name
  • Mina Michael
    Mina Michael almost 3 years
    lspci did the trick for me.
  • Admin
    Admin almost 2 years
    nvidia-smi is only an option if the driver is installed from what I know. In case of not wanting to use the driver (e.g. libvirt and PCI passthrough of the GPU) this is not possible since the GPU is detatched from the host.