How to check for GPU on CentOS Linux

陌路散爱 提交于 2019-12-21 07:55:16

问题


It is suggested that on Linux, GPU be found with the command lspci | grep VGA. It works fine on Ubuntu but when I try to use the same on CentOS, it says lspci command is not found. How can I check for the GPU card on CentOS. And note that I'm not the administrator of the machine and I only use it remotely from command line. I intend to use the GPU as a GPGPU on that machine, but first I need to check if it even has one.


回答1:


Have you tried to launch /sbin/lspci or /usr/sbin/lspci ?




回答2:


This assumes you have proprietary drivers installed, but issue the following command...

nvidia-smi

The output should look similar to this:

Mon Dec 23 10:50:28 2013       
+------------------------------------------------------+                       
| NVIDIA-SMI 331.20     Driver Version: 331.20         |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 660     Off  | 0000:01:00.0     N/A |                  N/A |
| 10%   38C  N/A     N/A /  N/A |     97MiB /  2047MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

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



回答3:


Try lshw or lspci. They have to be installed if you don't have already.

Install lshw

sudo yum install lshw //CentOS
sudo apt-get install lshw // Ubuntu

Then run this

sudo lshw -C display

The output would look like this

 *-display
       description: VGA compatible controller
       product: GP102 [GeForce GTX 1080 Ti]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:0b:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:95 memory:fb000000-fbffffff memory:e0000000-efffffff memory:de000000-dfffffff ioport:5000(size=128) memory:faf00000-faf7ffff

Similarly, you can try lspci

lspci | grep VGA

The output would look like this

0b:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)



回答4:


lspci should be in the package pciutils.

you could do this with dmidecode but as your not an admin you probably cant do this nor installing the pciutils package.

IF there is a Xorg on this system then it should be easy:

grep Graphics /var/log/Xorg.0.log



回答5:


Well, if you use CUDA, it has a function to enumerate CUDA-capable devices on the system. Why not use that?



来源:https://stackoverflow.com/questions/10310250/how-to-check-for-gpu-on-centos-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!