5

命令行查看GPU内存容量

 3 years ago
source link: https://www.lujun9972.win/blog/2018/08/14/%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%9F%A5%E7%9C%8Bgpu%E5%86%85%E5%AD%98%E5%AE%B9%E9%87%8F/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

命令行查看GPU内存容量

有两个命令可以帮助我们查看GPU的内存容量,一个时lspci,一个是lshw

lspci

  1. 查找显卡的设备地址

    lspci |grep VGA
    
    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
    

    其中 00:02.0 指明了显卡是在哪个总线、哪个插槽上的设备、上的那个功能模块。

  2. 查看详细信息

    lspci -v -s 00:02.0
    
    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])
      Subsystem: Lenovo ThinkPad T520
      Flags: bus master, fast devsel, latency 0, IRQ 30
      Memory at f0000000 (64-bit, non-prefetchable) [size=4M]
      Memory at e0000000 (64-bit, prefetchable) [size=256M]
      I/O ports at 5000 [size=64]
      [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
      Capabilities: <access denied>
      Kernel driver in use: i915
      Kernel modules: i915
    
    

    你可以看到,GPU可预取只有4M,不可预取内存为256M,果然是个垃圾显卡啊...

lshw -C display
*-display
     description: VGA compatible controller
     product: 2nd Generation Core Processor Family Integrated Graphics Controller
     vendor: Intel Corporation
     physical id: 2
     bus info: pci@0000:00:02.0
     version: 09
     width: 64 bits
     clock: 33MHz
     capabilities: vga_controller bus_master cap_list rom
     configuration: driver=i915 latency=0
     resources: irq:30 memory:f0000000-f03fffff memory:e0000000-efffffff ioport:5000(size=64) memory:c0000-dffff

可以看到resources中 irq:30 memory:f0000000-f03fffff memory:e0000000-efffffff 前一个容量就是 4M,后一个容量就是 256M


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK