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).
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).
I do not know of a direct equivalent, but lshw should give you the info you want, try:
(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.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.
aticonfig --odgc
should fetch the clock rates, andaticonfig --odgt
should fetch the temperature data. I'm not familiar with AMDGPU-Pro, but a similar tool should exist.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
andlshw
tools.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:
You can then use this output with
lspci
again, forming two nested commandsIf 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:
EDIT: You can avoid the
<access denied>
by launching withsudo
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
(This works with the Nvidia drivers installed,but not with systems running the open-source 'nouveau' driver).
Output
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.
Run
google-chrome
and navigate to the URLabout:gpu
. If chrome has figured out how to use OpenGL, you will get extremely detailing information about your GPU.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
2nd GPU
For Nvidia cards, type
clinfo
is the analogue of
glxinfo
but for OpenCL, my GPU setup is described at: https://stackoverflow.com/questions/7542808/how-to-compile-opencl-on-ubuntu/33483311#33483311Ubuntu 20.04 Settings -> About
You can either open settings by clicking on top right menu, or you can just do:
So under "Graphics" I can see that my GPU model is "Quadro M1200/PCIe/SSE2".
nvidia-settings
Mixes runtime with some static info.
More details: How do I check if Ubuntu is using my NVIDIA graphics card?
I do believe the best option for this is neofetch.
This gives an output like this:
This is really not that complex For model and memory, here's a 1 liner that works for every video card I've tested it on regardless of manufacturer (Intel, AMD, NVIDIA):
GPU=$(lspci | grep VGA | cut -d ":" -f3);RAM=$(cardid=$(lspci | grep VGA |cut -d " " -f1);lspci -v -s $cardid | grep " prefetchable"| cut -d "=" -f2);echo $GPU $RAM
GPU= All this bit does is grab the 3rd field from 'lspci' output filtered via 'grep' for VGA which corresponds to the video chip.
RAM= All this bit does is set variable
cardid
equal to the first field of output fromlspci
matching "VGA" and feeds that as a request for-v
verbose output fromlspci
for that specific-s
device, further filtering the output bygrep
for the string " prefetchable" as this contains the memory on the card itself (note the preceding space as we don't want to match "non-prefetchable" in our output.For clock rate on Intel integrated graphics (Tested on I3 and I5)
execute the command
sudo find /sys -type f -name gt_cur* -print0 | xargs -0 cat
This dives into the /sys tree to locate the gt_cur_freq_mhz file which on my I3 is/sys/devices/pci0000:00/0000:00:02.0/drm/card0/gt_cur_freq_mhz
and prints the content. which in my case under extremely light load is350
as in 350 MHz which corresponds to the minimum frequency found in/sys/devices/pci0000:00/0000:00:02.0/drm/card0/gt_min_freq_mhz
and when runningglxgears
andglmark2
results in1050
as in 1050 MHz which corresponds to the maximum frequency found in/sys/devices/pci0000:00/0000:00:02.0/drm/card0/gt_max_freq_mhz
For clock rates on nvidia cards:
nvidia-smi -stats -d procClk
corresponds to the GPU clocknvidia-smi -stats -d memClk
corresponds to the memory clock.Note: I am unable to test the above as my trusty GeForce 210 isn't supported and this works only on Kepler or newer GPUs as indicated by `nvidia-smi -stats --help'
I do not currently have any solutions for clock rate on AMD cards and do not have the hardware available for testing. I will however say that to the best of my knowledge the
aticonfig
mentioned in the accepted answer no longer exists and it appears thatnvclock
isn't available for anything since trusty.If you're looking for only the names of the video cards on the machine, then simply use:
For some newer GPUs, this also lists the memory of each device.