How to check gpu on linux

How to check which GPU is active in Linux?

I’ve just gone through a hell of a time trying to get my discrete graphics to work in Ubuntu and answering this questions was constantly a challenge, since the lspci method mentioned earlier can sometimes say that both are [VGA controller]

I think the following command should give you an indication of your active chip:

$ glxinfo|egrep "OpenGL vendor|OpenGL renderer" OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile 

For me this is telling me that my intel graphics are running the show.

glxinfo is availible from the mesa-utils package, so you will need to install it if you haven’t already. On Ubuntu 22.04 for example, run:

sudo apt-get install mesa-utils 

If you’re using an nvidia chip, and you’re using the bumblebee package, you can put optirun in front of that line and it should tell you that you’re running the NVidia chip (optirun is basically telling the computer to use the discrete chip to run whatever command follows, but everything else is still using the integrated chip)

$ optirun glxinfo|egrep "OpenGL vendor|OpenGL renderer" OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce GT 555M/PCIe/SSE2 

glxheads is another helpful command from mesa-utils that tells you some useful information about which graphics card is in use (mostly repeats glxinfo in a more compact and easy to read form tho), and it gives you a nice rendering of a rotating triangle.

Источник

How to get information about graphics card (GPU) 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 appropriate drivers and get the hardware to function properly. Most modern linux distros can detect variety of graphics card, but do not always have the best driver for it.

So if you have an external graphics card like Nvidia or Ati, then you need to find the model name/number and then lookup further details online. Ofcourse, its easier if you have the hardware manual that came along when you purchased the computer. But here we shall be using commands to find out the same information.

Hardware details

The are only a few commands to learn. 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 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 [disabled] Capabilities: 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.

Читайте также:  Linux исходный коды драйверов

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

The lshw command can also be used to get the above information.

$ 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: [email protected]: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.

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]) .

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.

$ sudo dmidecode -t baseboard | grep -i 'Product' Product Name: DG35EC
$ 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

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.

Читайте также:  Arch linux с браузером

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
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.

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 Find Which Graphics Card do You Have in Linux?

Be it Nvidia or Radeon or Intel, they all may have some issues with Linux. When you are on your way to troubleshoot the graphics problem, the first thing you want to know is which graphics card do you have in your system.

Linux has several commands to check hardware information. You can use them to check what graphics card (also refer to as video card) do you have. Let me show you a couple of commands to get GPU information in Linux.

Check graphics card details in Linux command line

Check GPU Info in Linux Command Line

Use lspci command to find graphics card

The lspci command displays the information about devices connected through PCI (peripheral Component Interconnect) buses. Basically, this command gives you the detail about all the peripheral devices to your system from keyboard and mouse to sound, network and graphics cards.

By default, you’ll have a huge list of such peripheral devices. This is why you need to filter the output for graphics card with grep command in this manner:

This should show a one line information about your graphics card:

[email protected]:~$ lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)

As you can see, my system has Intel HD 620 video card.

Get detailed graphics card information with lshw command in Linux

The lspci command is good enough to see what graphics card you have but it doesn’t tell you a lot. You can use lshw command to get more information on it.

You may have to install lshw on Fedora, Manjaro and a few non-Ubuntu distributions.

This command requires you to have root access. You need to specify that you are looking for video card (graphics card) information in this fashion:

Читайте также:  Linux decrease swap size

And as you can see in the output below, this command gives more information on the graphics card such as clock rate, width, driver etc.

[email protected]:~$ sudo lshw -C video [sudo] password for abhishek: *-display description: VGA compatible controller product: HD Graphics 620 vendor: Intel Corporation physical id: 2 bus info: [email protected]:00:02.0 version: 02 width: 64 bits clock: 33MHz capabilities: pciexpress msi pm vga_controller bus_master cap_list rom configuration: driver=i915 latency=0 resources: irq:139 memory:db000000-dbffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff 

Bonus Tip: Check graphics card details graphically

It’s not that you must use the command line to find graphics card details in Linux. Most Linux distributions (or should I say desktop environments) provide essential details in the settings application.

For example, if you are using GNOME desktop environment, you can check the details by going to About section of Settings. Here’s what it looks like in Ubuntu 20.04:

Ubuntu GPU Check

I hope you find this quick tip helpful. You can also use the same commands to find your network adapter and CPU information in Linux.

If you have questions or suggestions, don’t hesitate to write a comment.

Источник

Check GPU Info in Ubuntu

Sagar Sharma

Check GPU info in Ubuntu

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 GPU 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:

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

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:

use glxinfo command to get the GPU info in ubuntu

Check GPU info using the lspci command

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

Once done, use the lspci command:

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

use lspci command to find the GPU device ID

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

use lspci command to find the GPU info in ubuntu

Get GPU info of Nvidia cards in Ubuntu

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

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 CPU info in the following guide:

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.

Источник

Оцените статью
Adblock
detector