怎么样查看服务器的gpu信息,服务器查看GPU等信息

博客介绍了如何使用`lspci`命令来查看系统的PCI设备信息,包括显卡等硬件细节。通过`lspci -v -s <设备编号>`可以获取更详细的设备数据。当没有安装显卡驱动时,显示的信息会有所不同。同时提到了`nvidia-smi`命令用于检查NVIDIA GPU的状态,并推荐了`htop`工具来实时监控内存和CPU使用情况。
摘要由CSDN通过智能技术生成

lspci,顾名思义,就是显示所有的 pci 设备信息。pci 是一种总线,而通过 pci 总线连接的设备就是 pci 设备了。如今,我们常用的设备很多都是采用 pci 总线了,如:网卡、存储。

如果没有 lspci 命令,安装:1

apt-get install pciutils

查看 gpu:1

lspci | grep -i vga

这样就可以显示机器上的显卡信息,比如

1

2

3

4

[root@localhost conf]# lspci | grep -i vga

01:00.0 VGA compatible controller: nVidia Corporation Device 1081 (rev a1)

02:00.0 VGA compatible controller: nVidia Corporation GT215 [GeForce GT 240] (rev a2)

08:05.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 10)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

如果想看详细的信息,比如 GeForce GT 240,即 02:00.0

[root@localhost conf]# lspci -v -s 02:00.0

02:00.0 VGA compatible controller: nVidia Corporation GT215 [GeForce GT 240] (rev a2) (prog-if 00 [VGA controller])

Subsystem: ASUSTeK Computer Inc. Device 8351

Flags: bus master, fast devsel, latency 0, IRQ 169

Memory at f9000000 (32-bit, non-prefetchable) [size=16M]

Memory at d0000000 (64-bit, prefetchable) [size=256M]

Memory at ce000000 (64-bit, prefetchable) [size=32M]

I/O ports at bc00 [size=128]

[virtual] Expansion ROM at f8f80000 [disabled] [size=512K]

Capabilities: [60] Power Management version 3

Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+

Capabilities: [78] Express Endpoint, MSI 00

Capabilities: [b4] Vendor Specific Information: Len=14 >

Capabilities: [100] Virtual Channel

Capabilities: [128] Power Budgeting >

Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 >

Kernel driver in use: nvidia

Kernel modules: nvidiafb, nvidia

可以看到 GT240 的显存是 256M

如果没有安装显卡驱动,显示可能如下:1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

root@0765afb5370d:/# lspci | grep -i vga

00:02.0 VGA compatible controller: Intel Corporation Device 3e92

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1c82 (rev a1)

root@0765afb5370d:/# lspci | grep -i 01:00.0

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1c82 (rev a1)

root@0765afb5370d:/# lspci -v -s 01:00.0

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1c82 (rev a1) (prog-if 00 [VGA controller])

Subsystem: ASUSTeK Computer Inc. Device 8609

Flags: bus master, fast devsel, latency 0, IRQ 125

Memory at f6000000 (32-bit, non-prefetchable) [size=16M]

Memory at e0000000 (64-bit, prefetchable) [size=256M]

Memory at f0000000 (64-bit, prefetchable) [size=32M]

I/O ports at e000 [size=128]

Expansion ROM at f7000000 [disabled] [size=512K]

Capabilities:

Kernel driver in use: nouveau

lspci: Unable to load libkmod resources: error -12

查看 nvidia 的 gpu 信息1

nvidia-smi

配合 watch 命令, 让一秒刷新一次

1

watch -n 1 nvidia-smi

查看内存及 cpu 使用情况的命令1

top

htop 工具,更直观1

apt-get install htop

安装完后,直接输入命令1

htop

就可以看到内存或 cpu 的使用情况了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值