This post will guide you how to get graphics card information from the command line in your Linux Operating system. How do I show graphics card hardware details using command on Linux.
- Lshw Command
- Lspci Command
- Displaying Graphics Card Vendor and Model
- Displaying Graphics Card Hardware Details
- Displaying Graphics Card Driver Information
Lshw Command
lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version,mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4is known to work).It currently supports DMI (x86 and IA-64 only), OpenFirmware device tree (PowerPC only), PCI/AGP, CPUID (x86), IDE/ATA/ATAPI, PCMCIA (only tested on x86), SCSI and USB.
Lspci Command
lspci is a utility for displaying information about PCI buses in the system and devices connected to them. By default, it shows a brief list of devices. Use the options described below to request either a more verbose output or output intended for parsing by other programs. If you are going to report bugs in PCI device drivers or in lspci itself, please include output of “lspci -vvx” or even better “lspci -vvxxx” .
Displaying Graphics Card Vendor and Model
If you want to dispaly graphics card vendor and model information in your Linux system, and you need to update the PCI ID database to the latest version using the update-pciids
command, and then you can use lspci
command to find out the model and vendor name. type:
$ sudo update-pciids $ lspci | grep -i 'vga'
Outputs:
[devops@mydevops ~]$ sudo update-pciids % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 252k 100 252k 0 0 3997 0 0:01:04 0:01:04 --:--:-- 3660 Done. [devops@mydevops ~]$ lspci | grep -i 'vga' 00:02.0 VGA compatible controller: VMware SVGA II Adapter
Displaying Graphics Card Driver Information
If you want to find out the name of the graphics card driver installed on your Linux system, and you can use the following lshw
command:
$ sudo lshw -c video | grep configuration
Outputs:
[devops@mydevops ~]$ sudo lshw -c video | grep configuration configuration: driver=vmwgfx latency=64
From the above output, you can see that the name of the graphics card driver name is shown in driver=vmwgfx.
If you want to show the details of the graphics card driver named “vmwgfx
” in your Linux system, and you can use the modinfo
command, type:
$ modinfo vmwgfx
Outputs:
[devops@mydevops ~]$ modinfo vmwgfx
filename: /lib/modules/4.18.0-80.7.1.el8_0.x86_64/kernel/drivers/gpu/drm/vmwgfx/vmwgfx.ko.xz
version: 2.14.1.0
license: GPL and additional rights
description: Standalone drm driver for the VMware SVGA device
author: VMware Inc. and others
rhelversion: 8.0
srcversion: D1098582484C9E1A5569B4C
alias: pci:v000015ADd00000405sv*sd*bc*sc*i*
depends: ttm,drm,drm_kms_helper
intree: Y
name: vmwgfx
vermagic: 4.18.0-80.7.1.el8_0.x86_64 SMP mod_unload modversions
sig_id: PKCS#7
signer: CentOS Linux kernel signing key
sig_key: 37:B5:D5:3D:74:5D:FC:B7:C9:E7:BA:25:33:FB:29:25:E6:8C:25:78
sig_hashalgo: sha256
signature: 15:54:27:C4:E5:36:10:DB:E1:E7:14:AB:AF:58:7A:12:0F:C5:DC:DD:
DE:29:9D:C4:D5:35:67:DF:AF:CC:04:23:78:26:08:F6:B8:4D:65:FA:
E5:66:4E:99:EC:1D:6C:54:F3:8D:A5:35:03:FC:F9:92:0E:A1:F0:7E:
BA:EA:6D:9C:36:FA:43:D2:73:6F:4C:A7:FB:3F:D6:08:E9:38:AE:61:
D5:87:36:EB:1A:52:2B:83:58:7D:12:CB:4D:BA:90:91:6D:91:F0:ED:
35:CB:E8:79:9E:08:1D:DC:F4:BE:D0:8C:9C:7F:25:91:B3:C0:3B:96:
9E:13:ED:75:14:C4:EB:BD:E2:AA:24:A4:1E:24:A8:A0:B8:A2:A5:88:
50:3E:C3:6F:84:AA:0C:C9:D3:D6:A6:1F:8F:03:1A:AF:52:74:4F:AF:
F6:85:52:CE:54:1C:A9:6D:A0:CB:95:89:D4:0E:B2:11:70:61:E3:3A:
E6:F0:58:A4:8F:19:D5:CA:3F:25:B6:A8:4A:28:FC:CE:2F:2E:E3:00:
F7:E9:6B:20:95:DC:60:BA:28:7A:ED:71:36:3C:48:27:8B:23:55:39:
32:07:1E:04:FF:02:B6:C2:1C:A3:23:9C:C6:6C:82:56:4C:03:64:CB:
36:1C:FD:C8:D3:8F:7A:8E:74:EB:92:74:AA:DF:F3:81:CB:7B:53:DA:
51:A5:F4:06:7E:5C:DD:AE:96:5E:9C:CF:7A:0E:C0:F8:4B:04:60:D1:
C3:D3:51:88:C4:2A:E8:C8:D5:E9:0A:F5:12:61:8B:E3:4A:7F:08:C3:
C7:0A:2F:1E:D1:52:62:65:CF:55:C0:A3:40:56:8A:22:CC:0C:DC:D0:
46:31:65:40:93:F4:76:E2:66:B5:B2:B3:81:72:83:FD:8E:41:7C:3D:
45:D8:4D:20:08:C2:FB:3B:E4:40:45:A9:82:6A:35:A2:4D:BC:C8:68:
B3:92:85:6F:55:2B:E5:97:99:BB:97:A6:B6:2B:D6:2D:C9:C6:EB:71:
40:85:60:39
parm: enable_fbdev:Enable vmwgfx fbdev (int)
parm: force_dma_api:Force using the DMA API for TTM pages (int)
parm: restrict_iommu:Try to limit IOMMU usage for TTM pages (int)
parm: force_coherent:Force coherent TTM pages (int)
parm: restrict_dma_mask:Restrict DMA mask to 44 bits with IOMMU (int)
parm: assume_16bpp:Assume 16-bpp when filtering modes (int)
Displaying Graphics Card Hardware Details
If you want to get more detailed information about your graphics card hardware, and you type the “lspci
” command at the shell prompt, type:
$ lspci -vnn | grep VGA -A 12
Outputs:
[devops@mydevops ~]$ lspci -vnn | grep VGA -A 12 00:02.0 VGA compatible controller [0300]: VMware SVGA II Adapter [15ad:0405] (prog-if 00 [VGA controller]) Subsystem: VMware SVGA II Adapter [15ad:0405] Flags: bus master, fast devsel, latency 64, IRQ 18 I/O ports at d010 [size=16] Memory at f0000000 (32-bit, non-prefetchable) [size=16M] Memory at f1000000 (32-bit, non-prefetchable) [size=2M] [virtual] Expansion ROM at 000c0000 [disabled] [size=128K] Kernel driver in use: vmwgfx Kernel modules: vmwgfx 00:03.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02) Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter [8086:001e] Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 19 Memory at f1200000 (32-bit, non-prefetchable) [size=128K]
Conclusion
You should know that how to get the information of the graphics card installed on your system using lspci/lshw commands in your CentOS or RHEL Linux system.