如何在 CentOS Linux 上检查 GPU

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10310250/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:58:30  来源:igfitidea点击:

How to check for GPU on CentOS Linux

clinuxgpux86-64gpgpu

提问by pythonic

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.

建议在 Linux 上使用命令找到 GPU lspci | grep VGA。它在 Ubuntu 上运行良好,但是当我尝试在 CentOS 上使用它时,它说找不到 lspci 命令。如何在 CentOS 上检查 GPU 卡。请注意,我不是机器的管理员,我只能从命令行远程使用它。我打算将 GPU 用作那台机器上的 GPGPU,但首先我需要检查它是否有。

采纳答案by shodanex

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

您是否尝试启动/sbin/lspci/usr/sbin/lspci

回答by K1773R

lspci should be in the package pciutils.

lspci 应该在 pciutils 包中。

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

您可以使用 dmidecode 执行此操作,但由于您不是管理员,因此您可能无法执行此操作,也无法安装 pciutils 包。

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

如果这个系统上有一个 Xorg 那么它应该很容易:

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

回答by IneQuation

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

好吧,如果您使用 CUDA,它具有枚举系统上支持 CUDA 的设备的功能。为什么不使用它?

回答by Erik

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

回答by Abu Shoeb

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

尝试lshwlspci。如果您还没有安装它们,则必须安装它们。

Install lshw

安装 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

lspci | grep VGA

The output would look like this

输出看起来像这样

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