设备管理工具PPU-SMI (v1.5)
1. 概述
PPU-SMI(PPU System Management Interface)是一个基于HGML(HanGuang Management Library)的命令行工具,用于辅助用户管理和查看PPU设备。通过PPU-SMI命令行工具,用户可以:
修改设备配置 / 特性开关。
查询指定设备运行参数和特性使能状态。
收集运行数据 / 特定事件,导出至表格供后续分析。
分析各个应用程序的设备资源使用情况。
查询多个PPU设备的拓扑信息。
2. 安装使用
PPU-SMI已集成在PPU_SDK软件包中,完成PPU_SDK安装后,进入PPU_SDK目录,通过脚本配置所需环境变量:
如果您使用官方镜像,镜像中已预置该工具,因此可跳过此步,无需获取与安装。
source envsetup.sh环境变量配置完成后,可执行ppu-smi -v检查版本信息,检查PPU-SMI是否可用:
root@122d8d7a7e37:~# ppu-smi -v
T-Head ppu-smi version v1.0
Build date: Sep 7 2022, 10:43:22
Code node: 4a1989d通过执行ppu-smi -h来查看帮助信息:
root@122d8d7a7e37:~# ppu-smi -h
PPU System Management Interface -- v1.0
PPU-SMI provides monitoring information for T-head PPU devices.
The data is presented in either a plain text or an XML format, via stdout or a file.
PPU-SMI also provides several management operations for changing the device state.
Note that the functionality of PPU-SMI is exposed through the HGML C-based library.
ppu-smi [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help
Print usage information and exit.
-v, --version
Print version information and exit.
LIST OPTIONS:
-L, --list-ppus
Display a list of PPUs connected to the system.
...3. 设备汇总信息
3.1 查看设备列表
通过执行ppu-smi -L查看系统内PPU设备列表。
root@0549cf16bb85:~# ppu-smi -L
PPU 0: PPU (UUID: GPU-019ea108-c110-0828-0000-0000c07e1a46)
PPU 1: PPU (UUID: GPU-019ea108-c120-040c-0000-0000c0267f1e)列表包含如下信息:
设备索引:设备上电后分配的从0开始的枚举编号
设备名称
设备UUID
3.1.1 MIG设备信息
在开启MIG模式后,ppu-smi -L将显示PPU设备下属的MIG设备信息,示例如下:
root@0549cf16bb85:~# ppu-smi -L
PPU 0: PPU (UUID: GPU-019ea108-c110-0828-0000-0000c07e1a46)
PPU 1: PPU (UUID: GPU-019ea108-c120-040c-0000-0000c0267f1e)
MIG g1.c1.i1, Device 0 (UUID: MIG-79c62632-04cc-574b-af7b-cb2e307121c85)
MIG g1.c0.i0, Device 1 (UUID: MIG-79c62632-04cc-574b-af7b-cb2e307121c84)3.2 查看基本信息汇总
通过执行ppu-smi,无任何参数,可查看系统内PPU设备列表。
root@122d8d7a7e37:~# ppu-smi
Wed Sep 7 17:04:22 2022
+-------------------------------------------------------------------------------+
| PPU-SMI 1.2 Driver Version: 543.21.01 HGGC Version: 11.5 |
+---------------------------------+----------------------+----------------------+
| PPU Name Persistence M. | Bus-Id | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | PPU-Util Compute M. |
| | | MIG M. |
+=================================+======================+======================+
| 0 alixpu N/A | 00000000:5E:00.0 | 0 |
| N/A 35C P0 100W / 200W | 114MiB / 134473MiB | 10% Default |
| | | Disabled |
+---------------------------------+----------------------+----------------------+
| 1 alixpu N/A | 00000000:5E:00.1 | 0 |
| N/A 34C P0 100W / 200W | 4MiB / 134473MiB | 10% Default |
| | | Disabled |
+---------------------------------+----------------------+----------------------+
+-------------------------------------------------------------------------------+
| Processes: |
| PPU GI CI PID Type Process name PPU Memory |
| ID ID Usage |
+===============================================================================+
| 0 N/A N/A 25759 C cuda_test1 151MiB |
| 0 N/A N/A 25677 C cuda_test2 151MiB |
+-------------------------------------------------------------------------------+查询结果分为两个表格,分别是PPU设备列表和PPU进程列表,其中当前设备不支持的信息,显示为N/A。
PPU设备列表表格信息说明如下:
PPU: 设备上电后分配的从0开始的枚举编号
Name: 设备名称
Persistence M.: 是否开启持久化模式(Persistence Mode)
Fan: 风扇目标转速占最大转速的百分比
Temp: 设备当前温度
Perf: 设备性能状态级别(performance state),P0为最高性能,P1 / P2等性能逐级下降,不支持时显示为
N/APwr:Usage/Cap: 当前设备功率(W) / 设备功率限制(W)
Bus-Id: 设备PCI Bus Id
Memory-Usage: 已使用设备内存大小(MiB) / 总共设备内存大小(MiB)
Volatile Uncorr. ECC: 自驱动加载后,设备发生的所有不可纠错的ECC错误个数汇总
PPU-Util: 当前PPU流处理器利用率
Compute M.: 当前的计算模式(Compute Mode),如Default / Prohibited / Exclusive Process(显示E. Process)模式
MIG M.: 当前MIG模式(MIG Mode)
PPU进程列表表格信息说明如下:
PPU: 设备上电后分配的从0开始的枚举编号
CI ID: 计算继承占用的Compute Instance资源的ID
PID: 系统进程ID
Type: 本进程的计算类型,其中C表示Compute
Process name: 进程名称
PPU Memory Usage: 本进程使用的PPU内存大小(MiB)
3.2.1 MIG设备信息
若存在PPU设备开启了MIG功能,通过执行ppu-smi,可查看当前存在的MIG设备信息表格:
+-----------------------------------------------------------------------------+
| MIG devices: |
+------------------+---------------------+----------+-------------------------+
| PPU GI CI MIG | Memory-Usage | Vol | Shared |
| ID ID DEV | | CU Unc | CpyEng ENC DEC OFA JPEG |
| | | ECC | |
+==================+=====================+==========+=========================+
| 0 0 0 5 | 106MiB / 33618MiB | 64 0 | 4 2 2 0 0 |
+------------------+---------------------+----------+-------------------------+
| 1 1 2 3 | 6MiB / 16809MiB | 32 0 | 2 0 0 0 0 |
+------------------+---------------------+----------+-------------------------+
| 1 1 3 2 | 6MiB / 16809MiB | 32 0 | 2 0 0 0 0 |
+------------------+---------------------+----------+-------------------------+MIG设备列表表格信息说明如下:
PPU: 设备上电后分配的从0开始的枚举编号
GI ID: MIG device关联的GPU instance ID
CI ID: MIG device关联的compute instance ID
MIG DEV: MIG device枚举编号
Memory-Usage: 本MIG device已使用设备内存大小(MiB) / 总共设备内存大小(MiB)
CU: 本MIG device独占的CU资源个数
Vol Unc ECC: 自驱动加载后,设备发生的所有不可纠错的ECC错误个数汇总
Shared:以下列出的资源,本MIG device和GPU instance上其他MIG device共享
CpyEng: 共享的copy engine资源个数
ENC: 共享的编码器个数
DEC: 共享的解码器个数
OFA: 共享的OFA处理单元个数
JPEG: 共享的JPEG处理单元个数
3.2.2 其他选项
选项 | 说明 |
-i, --id= | 指定查询某一个特定设备,可以是如下值:
推荐使用UUID或者PCI Bus ID指定设备:
|
-f, --filename= | 显示结果输出到文件 |
-l, --loop= | 指定每间隔多少秒查询一次,直到用户 |
4. 查询设备信息
4.1 通用查询
通过执行ppu-smi -q可查询系统相关信息,以及各个PPU设备的配置和状态信息。
root@122d8d7a7e37:~# ppu-smi -q
==============PPUSMI LOG==============
Timestamp : Wed Sep 7 19:13:36 2022
Driver Version : 510.39.01
HGGC Version : 11.6
SDK Version : 1.4.45-5188b0
Attached PPUs : 1
PPU 00000000:01:00.0
Product Name : alixpu
Persistence Mode : Disabled
MIG Mode
Current : N/A
Pending : N/A
Serial Number : N/A
PPU UUID : PPU-7f53d39f-ce6e-dc78-c3d4-4c18653c19c0
PCI
Bus : 0x01
Device : 0x00
Domain : 0x0000
Device Id : 0x1E0410DE
...可通过选项-d指定查询某些类型的信息,多个类型之间可通过,间隔,类型大小写不敏感,例如ppu-smi -q -d ECC,POWER,则PPU-SMI只会查询和ECC / POWER相关的信息。选项-d可选值说明如下:
-d选项可选值 | 说明 |
MEMORY | 内存相关信息:总内存大小 / 使用情况等 |
UTILIZATION | PPU处理器 / 内存 / 编解码器等利用率 |
ECC | ECC模式 / 错误计数器状态等 |
TEMPERATURE | 设备温度信息 |
POWER | 设备当前功率 / 功率限制等 |
CLOCK | 各时钟域时钟频率 / 最大可配置频率等 |
COMPUTE | 设备计算模式(Compute Mode) |
PIDS | 当前和本设备相关的进程信息 |
SUPPORTED_CLOCKS | 设备支持的处理器和内存的时钟频率配置组合 |
PAGE_RETIREMENT | 设备内存Retired Page相关信息 |
ROW_REMAPPER | 设备内存Remapped Row相关信息 |
VERSION | SDK各组件版本信息 |
执行ppu-smi -q时,会查询上表中所有的类型的信息,部分将不会展示,若想查看采样相关信息,需通过-d指定类型查询,例如:
ppu-smi -q -d POWER将会展示功率采样的时间段 / 最大值 / 最小值 / 平均值等信息采样信息(Sampling)。ppu-smi -q -d VERSION将会展示SDK各组件的版本信息。
4.1.1 基础查询说明
执行ppu-smi -q时会打印一些设备基本信息,这些信息不属于-d选项指定范畴,信息含义说明如下:
Driver Version:驱动(KMD)版本号
HGGC Version: HGGC版本号
SDK Version: PPU SDK版本号
Product Name: 设备名称
Product Architecture: 产品架构
Persistence Mode: 持久化特性开启状态
MIG Mode: MIG特性状态
Current: 当前MIG特性开启状态
Pending: 重启后MIG特性开启状态
Serial Number: 板卡序列号
PPU UUID: 设备UUID
Minor Number: 设备Minor number,Linux系统设备节点名称规则为:/dev/alixpu_ppu[minor number]
Rear ID:机尾ID
PPU Virtualization Mode:设备虚拟化信息
Virtualization Mode:是否开启虚拟化功能
Host VGPU Mode:当前host系统是否支持SR-IOV
VBIOS Version: 设备VBIOS(firmware)版本号
Auto Reset: 设备自动复位功能的开启状态
Performance Counter:Performance Counter是否在激活状态
Tide Mode:潮汐模式是否使能
MPS Mode:MPS模式是否使能
PCI: PPU PCI接口信息
BUS / Device / Domain / Device Id / Bus Id / Sub System Id / Vendor Id: 设备PCI标识
PPU Link Info: PCI链路配置信息
PCIe Generation: 协议版本
Max: PPU在本系统可能的最高协议版本,若PPU支持的Generation大于系统支持的Generation,则显示的是系统支持的Generation
Current: 当前生效的PCIe版本
Link Width: 链路传输位宽
Max: PPU在本系统可能的最高链路传输位宽,若PPU支持的Link Width大于系统支持的Link Width,则显示的是系统支持的Link Width
Current: 当前生效的链路传输位宽
Replays Since Reset: 自上次复位计数器后,发生的PCI重传的次数
Tx Throughput / Rx Throughput: 当前PCI链路吞吐量(KB / s)
Fan Speed: 期望的风扇转速百分比,并不一定反应真实风扇转速(比如风扇被卡主无法转动)
Performance State: 设备性能状态级别,P0为最高性能,P1 / P2等性能逐级下降
Clocks Throttle Reasons: 时钟降频原因
Idle: 因PPU空闲降频
Applications Clocks Setting: 时钟受当前Applications Clocks配置限制
SW Power Cap: 达到软件配置功率上限
HW Slowdown: 因硬件原因受限,任何一个子项受限,则本项标记为
ActiveHW Thermal Slowdown: 达到硬件温度限制
HW Power Brake Slowdown: 触发外部功率限制,导致降频
Sync Boost: 因所在Sync Group中的其他PPU降频,本PPU跟随降频,请查询Sync Group其他PPU降频原因
SW Thermal Slowdown: 达到软件配置温度上限
Xid Errors: 驱动XID错误码
PPU Reset Correctable:需要复位PPU修正的XID错误码,不存在时显示为
N/AOS Reboot Correctable:需要操作系统重启修正的XID错误码,不存在时显示为
N/ACold Reboot Correctable:需要系统断电重启修正的XID错误码,不存在时显示为
N/A
4.1.2 内存查询说明
执行ppu-smi -q -d MEMORY,打印的信息含义说明如下:
root@122d8d7a7e37:~# ppu-smi -q -d MEMORY
...
PPU 00000000:01:00.0
HBM Vendor : Samsung
Memory Usage
Total : 11264 MiB
Used : 248 MiB
Free : 11016 MiBHBM Vendor:HBM生产厂商
Total: 本设备总共内存大小(MiB)
Used: 当前使用的内存大小(MiB)
Free: 可用的内存大小(MiB)
4.1.3 利率用查询说明
执行ppu-smi -q -d UTILIZATION,打印的信息含义说明如下:
root@2b92dd1ad851:~# ppu-smi -q -d UTILIZATION
...
PPU 00000000:3E:00.0
Utilization
Ppu : 38 %
Core : 30 %
Memory : 0 %
Encoder : 0 %
Decoder : 0 %
PPU Utilization Samples
Duration : 19.89 sec
Number of Samples : 99
Max : 56 %
Min : 1 %
Avg : 31 %
Memory Utilization Samples
Duration : 19.89 sec
Number of Samples : 99
Max : 0 %
Min : 0 %
Avg : 0 %
ENC Utilization Samples
Duration : 19.89 sec
Number of Samples : 99
Max : 0 %
Min : 0 %
Avg : 0 %
DEC Utilization Samples
Duration : 19.89 sec
Number of Samples : 99
Max : 0 %
Min : 0 %
Avg : 0 %
Utilization: 汇总的利用率显示
Ppu: PPU处理器利用率
Core: PPU核心利用率
Memory: 内存利用率
Encoder: 编码器利用率
Decoder: 解码器利用率
PPU Utilization Samples: PPU处理器利用率采样信息
Duration: 采样数据持续时间
Number of Samples: 收集到的利用率采样数据个数
Max / Min / Avg: 采样点中最大 / 最小 / 平均利用率
Memory Utilization Samples: 内存利用率采样信息
ENC Utilization Samples: 编码器利用率采样信息
DEC Utilization Samples: 解码器利用率采样信息
4.1.4 ECC查询说明
执行ppu-smi -q -d ECC,打印的信息含义说明如下:
root@2b92dd1ad851:~# ppu-smi -q -d ECC
...
PPU 00000000:3E:00.0
Ecc Mode
Current : Enabled
Pending : Enabled
ECC Errors
Volatile
SRAM Correctable : 0
SRAM Uncorrectable : 0
DRAM Correctable : 0
DRAM Uncorrectable : 0
Aggregate
SRAM Correctable : 0
SRAM Uncorrectable : 0
DRAM Correctable : 0
DRAM Uncorrectable : 0Ecc Mode: ECC特性开启状态
Current: 当前ECC特性开启状态
Pending: 重启后ECC特性开启状态
ECC Errors: ECC校验错误统计
Volatile
SRAM Correctable: SRAM可纠错的ECC错误(1 bit错误)
SRAM Uncorrectable: SRAM不可纠错的ECC错误(2 bit错误)
DRAM Correctable: DRAM可纠错的ECC错误(1 bit错误)
DRAM Uncorrectable: DRAM不可纠错的ECC错误(2 bit错误)
Aggregate: 设备累计的ECC错误计数(持久化,设备重启不清零)
4.1.5 温度查询说明
执行ppu-smi -q -d TEMPERATURE,打印的信息含义说明如下:
root@2b92dd1ad851:~# ppu-smi -q -d TEMPERATURE
...
PPU 00000000:3E:00.0
Temperature
PPU Current Temp : 42 C
PPU Shutdown Temp : 95 C
PPU Slowdown Temp : 92 C
PPU Max Operating Temp : 85 C
PPU Target Temperature : N/A
Memory Current Temp : 42 C
Memory Max Operating Temp : 95 CPPU Current Temp: 处理器当前温度
PPU Shutdown Temp: 硬件停止工作温度
PPU Slowdown Temp: 硬件降频保护温度(Hardware slowdown)
PPU Max Operating Temp: PPU工作温度软件配置上限,超过则降频(Software slowdown)
PPU Target Temperature: PPU工作目标温度,系统通过控制工作频率接近此目标温度
Memory Current Temp: 内存当前温度
Memory Max Operating Temp: 内存工作温度软件配置上限,超过则降频(Software slowdown)
4.1.6 功率查询说明
执行ppu-smi -q -d POWER,打印的信息含义说明如下:
root@2b92dd1ad851:~# ppu-smi -q -d POWER
...
PPU 00000000:3E:00.0
Power Readings
Power Management : Supported
Power Draw : 51.99 W
Power Limit : 250.00 W
Default Power Limit : 250.00 W
Enforced Power Limit : 250.00 W
Min Power Limit : 150.00 W
Max Power Limit : 250.00 W
Power Samples
Duration : 2.39 sec
Number of Samples : 119
Max : 58.68 W
Min : 51.40 W
Avg : 55.23 WPower Readings: 功率相关状态值
Power Management: 是否支持功率控制特性
Power Draw: 当前消耗功率
Power Limit: 软件配置功率上限
Default Power Limit: 设备重启后默认的功率上限
Enforced Power Limit: 实际生效的功率上限,此上限可能在软件配置上限的基础上,叠加了其他功率控制特性的影响
Min Power Limit: 允许配置的最低功率上限
Max Power Limit: 允许配置的最高功率上限
Power Samples: 功率使用采样信息
Duration: 采样数据持续时间
Number of Samples: 收集到的利用率采样数据个数
Max / Min / Avg: 采样点中最大 / 最小 / 平均功率
4.1.7 时钟查询说明
执行ppu-smi -q -d CLOCK,打印的信息含义说明如下:
root@2b92dd1ad851:~# ppu-smi -q -d CLOCK
...
PPU 00000000:08:00.0
Clocks
CU : 200 MHz
Memory : 1800 MHz
Video : 1000 MHz
Applications Clocks
CU : 1700 MHz
Memory : 1800 MHz
Default Applications Clocks
CU : 1700 MHz
Memory : 1800 MHz
Max Clocks
CU : 1700 MHz
Memory : 1800 MHz
Video : 1000 MHzClocks: 当前时钟配置
CU: 流处理器(Streaming Multiprocessors)域时钟频率
Memory: 内存域时钟频率
Video: 视频编解码器域时钟频率
Applications Clocks:应用运行时钟配置
Default Applications Clocks:应用运行时钟默认配置
Max Clocks: 允许配置的最大时钟频率
4.1.8 计算模式查询说明
执行ppu-smi -q -d COMPUTE,打印的信息含义说明如下:
root@2b92dd1ad851:~# ppu-smi -q -d COMPUTE
...
PPU 00000000:3E:00.0
Compute Mode : DefaultCompute Mode: 当前生效的计算模式
Default模式:设备允许多context
Prohibited模式: 设备不允许建立任何context
Exclusive Process模式: 设备只允许建立一个context,此context可以在多线程中共享
4.1.9 进程信息查询说明
执行ppu-smi -q -d PIDS,打印的信息含义说明如下:
root@2b92dd1ad851:~# ppu-smi -q -d PIDS
...
PPU 00000000:3E:00.0
Processes
Compute instance ID : N/A
Process ID : 85637
Type : Compute
Name : ppu_test
Used PPU Memory : 413 MiB
Compute instance ID : N/A
Process ID : 87771
Type : Compute
Name : ppu_test_threads
Used PPU Memory : 413 MiBCompute Mode: 在MIG模式使能时,本进程占用的Compute instance的ID
Process ID: 进程的系统PID
Type: 进程工作模式,Compute表示为通用计算类型
Name: 进程名称
Used PPU Memory: 本进程占用PPU内存大小(MiB)
4.1.10 支持时钟配置查询说明
执行ppu-smi -q -d SUPPORTED_CLOCKS,打印的信息含义说明如下:
root@122d8d7a7e37:~# ppu-smi -q -d SUPPORTED_CLOCKS
...
PPU 00000000:01:00.0
Supported Clocks
Memory : 7000 MHz
CU : 2100 MHz
CU : 2085 MHz
CU : 2070 MHz
CU : 2055 MHz
CU : 2040 MHz
...
Memory : 6800 MHz
CU : 2100 MHz
CU : 2085 MHz
CU : 2070 MHz
CU : 2055 MHz
CU : 2040 MHz
...Memory: 内存时钟域可配置的时钟频率(如7000MHz)
CU: 当内存域配置为指定频率时(如7000MHz),流处理器时钟域可配置的时钟频率
4.1.11 retired pages查询说明
执行ppu-smi -q -d PAGE_RETIREMENT,打印的信息含义说明如下:
root@122d8d7a7e37:~# ppu-smi -q -d PAGE_RETIREMENT
...
PPU 00000000:10:00.0
Retired Pages
Single Bit ECC : 0
Double Bit ECC : 0
Pending Page Blacklist : NoSingle Bit ECC:由于多次出现Single Bit ECC错误导致retired的page的个数
Double Bit ECC:由于出现Double Bit ECC错误导致retired的page的个数
Pending Page Blacklist:当前是否有等待重启后生效的retired page,在重启之前性能下降的page仍可能被使用并出现错误
4.1.12 remapped rows查询说明
执行ppu-smi -q -d ROW_REMAPPER,打印的信息含义说明如下:
root@122d8d7a7e37:~# ppu-smi -q -d ROW_REMAPPER
...
PPU 00000000:10:00.0
Remapped Rows
Correctable Error : 0
Uncorrectable Error : 0
Pending : No
Remapping Failure Occurred : No
Bank Remap Availability Histogram
Max : 3072 bank(s)
High : 0 bank(s)
Partial : 0 bank(s)
Low : 0 bank(s)
None : 0 bank(s)Correctable Error:由于多次出现Single Bit ECC错误导致remap的row的个数
Uncorrectable Error:由于出现Double Bit ECC错误导致remap的row的个数
Pending:当前是否有等待重启后生效的remapped row,在重启之前性能下降的row仍可能被使用并出现错误
Bank Remap Availability Histogram:PPU设备所有bank的remap能力统计直方图,例如:
Max:能remap到所有预留的row的bank的个数
None:不能remap到任何预留的row的bank的个数
4.1.13 其他选项
选项 | 说明 |
-i, --id= | 指定查询某一个特定设备,可以是如下值:
推荐使用UUID或者PCI Bus ID指定设备:
|
-f, --filename= | 显示结果输出到文件 |
-l, --loop= | 指定每间隔多少秒查询一次,直到用户 |
-lms, --loop-ms= | 指定每间隔多少毫秒查询一次,直到用户 |
4.2 选择性查询
PPU-SMI支持用户查询指定的设备信息,用户通过选项传入希望查询的属性名称的列表(通过,分隔),PPU-SMI将查询结果以CSV表格的方式打印输出。
例如执行ppu-smi --query-ppu=timestamp,index,name,compute_mode,memory.total,memory.used --format=csv:
root@2b92dd1ad851:~# ppu-smi --query-ppu=timestamp,index,name,compute_mode,memory.total,memory.used --format=csv
timestamp, index, name, compute_mode, memory.total [MiB], memory.used [MiB]
2022/09/08 09:24:11.132, 0, alixpu, Default, 40960 MiB, 606 MiB
2022/09/08 09:24:11.139, 1, alixpu, Default, 24576 MiB, 508 MiBPPU-SMI支持的选择性查询功能如下:
选择性查询选项 | 说明 |
--query-ppu= | 查询各个PPU设备的属性信息,每行打印一个PPU设备的相关信息 |
--query-supported-clocks= | 查询各个PPU设备支持的时钟配置信息,每行打印一个PPU一对内存时钟域和处理器时钟域的相关信息 |
--query-compute-apps= | 查询各个PPU设备的进程信息,每行打印一个PPU设备的一个进程的相关信息 |
--query-retired-pages= | 查询各个PPU设备内存的retired pages信息,每行打印一个retired page的相关信息 |
--query-remapped-rows= | 查询各个PPU设备内存的remapped rows信息,每行打印一个PPU设备的remapped row的相关信息 |
选择性查询需要指定结果输出格式,通过选项--format进行指定,多个选项间通过,分隔,其中csv为必选项:
输出格式选项 | 说明 |
csv | 必选项,查询结果以 |
noheader | 不打印表头信息 |
nounits | 不打印表头和数据中的单位信息 |
4.2.1 查询PPU信息
使用--query-ppu选项指定查询的属性名称列表,不同属性通过,分隔。可执行ppu-smi --help-query-ppu查看所有支持的属性信息:
root@2b92dd1ad851:~# ppu-smi --help-query-ppu
List of valid properties to query for the switch "--query-ppu=":
"timestamp"
The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec".
"driver_version"
The version of the installed driver. This is an alphanumeric string.
"count"
The number of PPUs in the system.
"name" or "ppu_name"
The official product name of the PPU. This is an alphanumeric string. For all products.
"serial" or "ppu_serial"
This number matches the serial number physically printed on each board. It is a globally unique immutable alphanumeric value.
"uuid" or "ppu_uuid"
This value is the globally unique immutable alphanumeric identifier of the PPU. It does not correspond to any physical label on the board.
"pci.bus_id" or "ppu_bus_id"
PCI bus id as "domain:bus:device.function", in hex.
...选择部分属性进行查询,例如查询设备名称 / 序号列 / 设备枚举索引 / uuid等信息,执行ppu-smi --query-ppu=timestamp,count,name,serial,index,uuid --format=csv:
root@2b92dd1ad851:~# ppu-smi --query-ppu=timestamp,count,name,serial,index,uuid --format=csv
timestamp, count, name, serial, index, uuid
2022/09/08 09:42:34.913, 2, alixpu, 1320421013145, 0, PPU-0cdd7938-b576-2411-a408-3ad81dfc1a78
2022/09/08 09:42:34.920, 2, alixpu, 1323921045367, 1, PPU-16c4c41f-9214-5e29-3b86-7a26ab011d3e4.2.2 查询支持时钟配置信息
使用--query-supported-clocks选项指定查询的属性名称列表,不同属性通过,分隔。可执行ppu-smi --help-query-supported-clocks查看所有支持的属性名称和描述信息:
root@2b92dd1ad851:~# ppu-smi --help-query-supported-clocks
List of valid properties to query for the switch "--query-supported-clocks=":
[Section about Supported Clocks properties]
List of possible memory and processor clocks combinations that the PPU can operate on (not taking into account HW brake reduced clocks).
"timestamp"
The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec".
"name" or "ppu_name"
The official product name of the PPU. This is an alphanumeric string. For all products.
...
"memory" or "mem"
Memory clock.
"processor" or "sm"
Streaming multiprocessors clock.例如查询内存域和流处理器域时钟配置组合列表,执行ppu-smi --query-supported-clocks=timestamp,ppu_bus_id,memory,processor --format=csv:
root@2b92dd1ad851:~# ppu-smi --query-supported-clocks=timestamp,ppu_bus_id,memory,processor --format=csv
timestamp, pci.bus_id, memory [MHz], processor [MHz]
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1410 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1395 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1380 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1365 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1350 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1335 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1320 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1305 MHz
2022/09/08 09:50:26.289, 00000000:3E:00.0, 1215 MHz, 1290 MHz
...4.2.3 查询进程信息
使用--query-compute-apps选项指定查询的属性名称列表,不同属性通过,分隔。可执行ppu-smi --help-query-compute-apps查看所有支持的属性信息:
root@2b92dd1ad851:~# ppu-smi --help-query-compute-apps
List of valid properties to query for the switch "--query-compute-apps=":
[Section about Active Compute Processes properties]
List of processes having compute context on the device.
"timestamp"
The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec".
"name" or "ppu_name"
The official product name of the PPU. This is an alphanumeric string. For all products.
...
"pid"
Process ID of the compute application.
"process_name"
Process Name.
"used_ppu_memory" or "used_memory"
Amount memory used on the device by the context.例如查询PPU设备相关的进程PID / 名称 / 内存占用信息,执行ppu-smi --query-compute-apps=timestamp,uuid,pid,process_name,used_ppu_memory --format=csv:
root@2b92dd1ad851:~# ppu-smi --query-compute-apps=timestamp,uuid,pid,process_name,used_ppu_memory --format=csv
timestamp, uuid, pid, process_name, used_ppu_memory [MiB]
2022/09/08 09:57:57.660, PPU-0cdd7938-b576-2411-a408-3ad81dfc1a78, 61785, ppu_test, 413 MiB
2022/09/08 09:57:57.660, PPU-0cdd7938-b576-2411-a408-3ad81dfc1a78, 62103, ppu_test_threads, 413 MiB4.2.4 查询retired page信息
使用--query-retired-pages选项指定查询的属性名称列表,不同属性通过,分隔。可执行ppu-smi --help-query-retired-pages查看所有支持的属性信息:
root@0549cf16bb85:~# ppu-smi --help-query-retired-pages
List of valid properties to query for the switch "--query-retired-pages=":
[Section about Retired Pages properties]
List of pages have been retired or pending to be retired.
"timestamp"
The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec".
"name" or "ppu_name"
The official product name of the PPU. This is an alphanumeric string. For all products.
...
"retired_pages.address"
Address of a retired page. Address might be different when ECC is Enabled or Disabled.
"retired_pages.timestamp"
Timestamp at which the page was retired.
"retired_pages.cause"
Reason that describes why the page was retired. Can take one of two values:
- Double Bit ECC: The number of PPU device memory pages that have been retired due to a double bit ECC error.
- Single Bit ECC: The number of PPU device memory pages that have been retired due to multiple single bit ECC errors.例如查询PPU设备发生的retired page列表,查看地址、发生时间和原因,执行ppu-smi --query-retired-pages=timestamp,uuid,retired_pages.address,retired_pages.timestamp,retired_pages.cause --format=csv:
root@2b92dd1ad851:~# ppu-smi --query-retired-pages=timestamp,uuid,retired_pages.address,retired_pages.timestamp,retired_pages.cause --format=csv
timestamp, uuid, retired_pages.address, retired_pages.timestamp, retired_pages.cause
12:32:15.329, PPU-3f53d39f-ce6e-dc78-c3d4-4c18653c19c0, 0x0000000073234722, 1663256354, Single Bit ECC4.2.5 查询remapped row信息
使用--query-remapped-rows选项指定查询的属性名称列表,不同属性通过,分隔。可执行ppu-smi --help-query-remapped-rows查看所有支持的属性信息:
root@0549cf16bb85:~# ppu-smi --help-query-remapped-rows
List of valid properties to query for the switch "--query-remapped-rows=":
"timestamp"
The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec".
"name" or "ppu_name"
The official product name of the PPU. This is an alphanumeric string. For all products.
...
"remapped_rows.correctable"
The number of rows that have been remapped due to correctable ECC errors.
"remapped_rows.uncorrectable"
The number of rows that have been remapped due to uncorrectable ECC errors.
"remapped_rows.pending"
Whether or not there are pending row-remappings.
"remapped_rows.failure"
Whether or not a row remapping has failed in the past.
"remap_availability.bank_histogram.max"
The number of banks that have max remap availability(all reserved rows are available).
"remap_availability.bank_histogram.high"
The number of banks that have high remap availability.
"remap_availability.bank_histogram.partial"
The number of banks that have partial remap availability.
...例如查询PPU设备发生的remapped rows统计结果,执行ppu-smi --query-remapped-rows=timestamp,uuid,remapped_rows.correctable,remapped_rows.uncorrectable,remap_availability.bank_histogram.max --format=csv:
root@2b92dd1ad851:~# ppu-smi --query-remapped-rows=timestamp,uuid,remapped_rows.correctable,remapped_rows.uncorrectable,remap_availability.bank_histogram.max --format=csv
timestamp, uuid, remapped_rows.correctable, remapped_rows.uncorrectable, remap_availability.bank_histogram.max
2022/09/08 16:24:40.435, GPU-099ea108-0181-0230-0000-000060f19f20, 0, 0, 3072
2022/09/08 16:24:40.435, GPU-019ea108-01a1-0222-0000-000040dff62d, 0, 0, 3072
2022/09/08 16:24:40.435, GPU-019ea108-0121-0222-0000-0000605e6417, 0, 0, 30724.2.6 其他选项
选项 | 说明 |
-i, --id= | 指定查询某一个特定设备,可以是如下值:
推荐使用UUID或者PCI Bus ID指定设备:
|
-f, --filename= | 显示结果输出到文件 |
-l, --loop= | 指定每间隔多少秒查询一次,直到用户 |
-lms, --loop-ms= | 指定每间隔多少毫秒查询一次,直到用户 |
5. 修改设备配置
5.1 设备配置选项
PPU-SMI支持修改设备配置,例如修改处理器时钟频率,执行ppu-smi -lpc 1410:
root@122d8d7a7e37:~# ppu-smi -lpc 1410
Set PPU clock to (min clock 1410MHz, max clock 1410MHz) for PPU 00000000:01:00.0.
All done.支持的选项如下,单次PPU-SMI支持修改一种设备配置(选项中的其中一个):
选项 | 说明 |
-e, --ecc-config= | 设置ECC功能是否使能,支持输入参数如下,大小写敏感:
例如:
可执行 |
-c, --compute-mode= | 修改设备计算模式(Compute Mode),支持输入参数如下,大小写敏感:
例如:
可执行 |
-r, --ppu-reset | 复位PPU设备,执行 可用于复位PPU硬件状态,避免重启整个系统。 复位操作不保证任何场景下均生效,请小心使用。 |
-vm, --virt-mode= | 修改设备的虚拟化模式,支持输入参数如下,大小写敏感:
可执行 |
-lpc, --lock-ppu-clocks= | 执行 若希望时钟频率锁定在单个频点,可只传入单个频率值, 配置无论当前PPU是否有应用运行,均立刻生效。 例如:
|
-rpc, --reset-ppu-clocks | 执行 |
-lmc, --lock-memory-clocks= | 执行 若希望时钟频率锁定在单个频点,可只传入单个频率值, 例如:
|
-rmc, --reset-memory-clocks | 执行 |
-ac, --applications-clocks= | 执行 例如:
|
-rac, --reset-applications-clocks | 执行 |
-pl, --power-limit= | 设置设备最大功率限制,单位为 设备支持设置的功率范围可通过执行 例如:
|
-mig, --multi-instance-gpu= | 设置MIG功能是否使能,支持输入参数如下,大小写敏感:
例如:
可执行 注意:当有MIG实例存在,无法关闭MIG模式,请删除本设备所有MIG实例后,再尝试关闭MIG模式 |
--auto-reset= | 设置PPU设备自动复位功能是否使能,支持输入参数如下,大小写敏感:
当 可执行 |
-mps, --multi-process-service= | 设置PPU设备MPS模式是否使能,支持输入参数如下,大小写敏感:
例如:
可执行 |
5.1.1 复位PPU设备
执行ppu-smi -r可复位所有PPU设备,通过-i选项可复位指定PPU设备,比如ppu-smi -r -i 0复位PPU 0号设备。复位PPU设备需要满足如下前提:
所有PPU设备没有HGGC相关的应用(compute application)。
所有PPU设备没有PPU相关的监控、工具类应用,如ppu-smi、ppudbg、PPU DCGM等软件。
若复位PPU设备由于存在上述应用导致失败,可通过如下命令查询相关应用:
# 查询HGGC相关的应用
ppu-smi pmon -c 1
# 查询PPU相关的监控、工具类应用
lsof /dev/alixpu5.2 其他选项
选项 | 说明 |
-i, --id= | 若不指定设备,则对系统内所有PPU设备执行修改配置操作。 若通过选项
推荐使用UUID或者PCI Bus ID指定设备:
|
-eow, --error-on-warning | 若修改配置失败,PPU-SMI命令行返回非0错误码。 以下场景修改配置失败不作为错误处理:
|
6. 收集设备统计信息
PPU-SMI支持收集设备采样/事件信息,以CSV表格方式打印,供后续统计设备运行状态。用户可通过子命令stats使用设备统计功能,通过执行ppu-smi stats -h查看统计功能帮助信息:
root@2b92dd1ad851:~# ppu-smi stats -h
Generates PPU statistics such as power samples,
utilization samples, xid events, clock change events
and performance capping events.
ppu-smi stats [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-i, --id
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device
-f, --filename
Log to a specified file, rather than to stdout
-d, --display
Display specific metric:
pwrDraw,temp,memUtil,ppuUtil,
encUtil,decUtil,memClk,procClk,
violPwr,violThm,xidEvent,sbEcc,
dbEcc,pState,clkChg,pwrChg,migChg
Metric can be combined with comma e.g. pwrDraw,temp
-c, --count
Run for specified number of monitoring cycles and exit
-h, --help
Display help information
Stats in following CSV format:
Device, Power Drawn (pwrDraw), Timestamp (us), Value (Watts)
Device, PPU Temperature (temp), Timestamp (us), Value (C)
Device, PPU Util (ppuUtil), Timestamp (us), Value (%)
...6.1 打印格式
查询结果输出的CSV表格,执行ppu-smi stats结果如下:
root@122d8d7a7e37:~# ppu-smi stats
0, violPwr , 1662606252538553, 0
0, violThm , 1662606252537681, 0
0, temp , 1662606252536736, 51
0, pState , 1662606252559897, 0
0, clkChg , 1662606252559964, 0
0, pState , 1662606252568416, 0
0, clkChg , 1662606252568499, 0
...
0, temp , 1662606253541531, 52
0, pwrDraw , 1662606252543916, 45
0, pwrDraw , 1662606252567432, 54
0, pwrDraw , 1662606252584972, 66
0, pwrDraw , 1662606252605044, 66
...CSV表格格式含义如下,无表头,每列含义为:
第一列: 设备索引,设备上电后分配的从0开始的枚举编号。
第二列: 统计的metric名称缩写,如
pwrDraw,temp等。第三列: 数据获取的时间戳,单位为
微秒,值为系统时钟system_clock开始到采样时间的微秒数。第四列: 采样数值,无单位,具体含义参见下文metric介绍。
6.2 统计metrics说明
希望采集的metrics可通过-d选项指定,多个metics通过,分隔,如ppu-smi stats -d pwrDraw,temp:
root@122d8d7a7e37:~# ppu-smi stats -d pwrDraw,temp
0, temp , 1662606935107702, 51
0, pwrDraw , 1662606935059582, 38
0, pwrDraw , 1662606935079459, 39
0, pwrDraw , 1662606935099668, 39
...若不通过-d选项指定,则默认统计所有支持的metrics。支持的metrics说明如下:
metric名称 | 事件型metric | 说明 | 值含义 |
pwrDraw | 否 | 设备当前消耗功率的采样值 | 功率值,单位: W |
temp | 否 | 设备当前温度的采样值 | 温度值,单位: 摄氏度 |
ppuUtil | 否 | 设备处理器利用率的采样值 | 利用率百分比,单位: % |
memUtil | 否 | 设备内存利用率的采样值 | 利用率百分比,单位: % |
encUtil | 否 | 设备编码器利用率的采样值 | 利用率百分比,单位: % |
decUtil | 否 | 设备解码器利用率的采样值 | 利用率百分比,单位: % |
memClk | 否 | 内存时钟域频率的采样值 | 时钟频率,单位: MHz |
procClk | 否 | 处理器时钟域频率的采样值 | 时钟频率,单位: MHz |
violPwr | 否 | 自上次采样后,设备因超过功率限制而降频的持续时间汇总 | 总共的降频持续时间,单位: 纳秒 |
violThm | 否 | 自上次采样后,设备因超过温度限制而降频的持续时间汇总 | 总共的降频持续时间,单位: 纳秒 |
xidEvent | 是 | 驱动上报的XID事件 | XID错误代码 |
sbEcc | 是 | 发生了一次single bit ECC error事件 | 0,无含义 |
dbEcc | 是 | 发生了一次double bit ECC error事件 | 0,无含义 |
pState | 是 | 性能等级(Performance State)配置变更事件 | 0,无含义 |
clkChg | 是 | 时钟配置变更事件 | 0,无含义 |
pwrChg | 是 | 功率配置变更事件 | 0,无含义 |
migChg | 是 | MIG配置变更事件 | 0,无含义 |
对于事件性的metric(如xidEvent),PPU-SMI将在事件发生时打印输出。对于非事件性的metric(如pwrDraw),PPU-SMI每秒汇总一次采样结果并打印输出。
PPU-SMI默认将持续运行和采集数据,直到用户Ctrl + C打断。
6.3 其他选项
选项 | 说明 |
-i, --id= | 指定特定设备,支持指定多个设备,通过
推荐使用UUID或者PCI Bus ID指定设备:
|
-f, --filename= | 显示结果输出到文件 |
-c, --count= | 指定多少次统计周期后停止统计 |
7. 监视设备状态
PPU-SMI支持滚动输出设备监视信息,用户可通过子命令dmon使用监控设备功能,每行打印一个设备的检视信息,每类监视信息作为一列滚动打印,例如执行ppu-smi dmon:
root@2b92dd1ad851:~# ppu-smi dmon
# ppu pwr ptemp mtemp cu core mem enc dec mclk pclk
# idx W C C % % % % % MHz MHz
0 109 30 32 0 2 0 0 0 1800 1500
1 119 33 34 0 0 0 0 0 1800 1500
0 109 30 32 0 0 0 0 0 1800 1500
1 121 33 34 0 0 0 0 0 1800 1500
...通过执行ppu-smi dmon -h可查看监视设备功能帮助信息:
root@2b92dd1ad851:~# ppu-smi dmon -h
PPU statistics are displayed in scrolling format with one line
per sampling interval. Metrics to be monitored can be adjusted
based on the width of terminal window.
ppu-smi dmon [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-i, --id=
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device
-d, --delay=
Collection delay/interval in seconds [default=1sec]
-c, --count=
Collect specified number of samples and exit
-s, --select=
One or more metrics [default=puc]
Can be any of the following:
p - Power Usage and Temperature
u - Utilization
c - Proc and Mem Clocks
v - Power and Thermal Violations
m - SM Memory
e - ECC Errors and PCIe Replay errors
t - PCIe Rx and Tx Throughput
-o, --options=
One or more from the following:
D - Include Date (YYYYMMDD) in scrolling output
T - Include Time (HH:MM:SS) in scrolling output
...7.1 监视metrics说明
可通过-s选项指定希望监视的metrics,每个metric使用单个字符标识,多个metric对应的字符可拼接在一起,作为-s选项传入,例如ppu-smi dmon -s pc,指定打印功率(p)和时钟(c)相关metrics。
root@2b92dd1ad851:~# ppu-smi dmon -s pc
# ppu pwr ptemp mtemp mclk pclk
# idx W C C MHz MHz
0 41 45 45 1215 765
1 30 36 36 1215 930
...支持的metrics说明如下:
-s选项metric字符 | 说明 |
p | 当前功率 / 处理器和内存温度信息 |
u | 处理器 / 内存 / 编码器 / 解码器利用率 |
c | 处理器时钟域和内存时钟域的频率信息 |
v | PPU因温度或者功耗限制而降频的比例信息 |
m | 内存使用信息 |
e | ECC error错误计数和PCI replay错误计数 |
t | PCI接口的吞吐量信息 |
PPU-SMI滚动输出的每列信息,含义说明如下:
基础信息
Date: 当前日期
Time: 当前时间
ppu: 设备上电后分配的从0开始的枚举编号
metric类型
ppwr: 当前消耗功率,单位W
ptemp: 处理器当前温度
mtemp: 内存当前温度
metric类型
usm: 流处理器利用率,单位%
core: 核心利用率,单位%
mem: 内存利用率,单位%
enc: 编码器利用率,单位%
dec: 解码器利用率,单位%
metric类型
cpclk: 处理器时钟域频率,单位MHz
mclk: 内存时钟域频率,单位MHz
metric类型
vpviol: 因功率受限而降频的时间,占采样间隔时间的比例,单位%
tviol: 因温度受限而降频的时间,占采样间隔时间的比例,单位%
metric类型
m
mem: 当前内存已使用大小,单位MiB
metric类型
esbecc: 自驱动加载依赖,出现的single bit ECC error的次数
dbecc: 自驱动加载依赖,出现的double bit ECC error的次数
pci: 出现的PCI replay次数
metric类型
trxpci: PCI接收吞吐量,单位MB/s
txpci: PCI发送吞吐量,单位MB/s
7.2 其他选项
选项 | 说明 |
-i, --id= | 指定特定设备,支持指定多个设备,通过
推荐使用UUID或者PCI Bus ID指定设备:
|
-d, --delay= | 设定两次查询的等待间隔,单位: 秒 |
-c, --count= | 指定多少次统计周期后停止统计 |
-o, --options= | 指定滚动信息是否包含日期或者时间列 |
-f, --filename= | 显示结果输出到文件 |
8. 监控进程状态
PPU-SMI支持滚动输出进程监视信息,用户可通过子命令pmon使用监控设备功能,每行打印一个设备一个进程的检视信息,每类监视信息作为一列滚动打印,例如执行ppu-smi pmon:
root@122d8d7a7e37:~# ppu-smi pmon
# ppu pid type sm mem enc dec command
# idx # C/G % % % % name
0 4563 C 0 0 0 0 ppu_test
0 4991 C 0 0 0 0 ppu_test_thread
...通过执行ppu-smi pmon -h可查看监视进程功能帮助信息:
root@122d8d7a7e37:~# ppu-smi pmon -h
Process statistics are displayed in scrolling format per sampling
interval. This tool lists the statistics for all the compute
processes running on each device. Metrics to be monitored
can be adjusted based on the width of terminal window.
ppu-smi pmon [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-i, --id=
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device
-d, --delay=
Collection delay/interval in seconds [default=1sec]
-c, --count=
Collect specified number of samples and exit
-s, --select=
One or more metrics [default=u]
Can be any of the following:
u - Utilization
m - Memory usage
-o, --options=
One or more from the following:
D - Include Date (YYYYMMDD) in scrolling output
T - Include Time (HH:MM:SS) in scrolling output
...8.1 监视metrics说明
可通过-s选项指定希望监视的metrics,每个metric使用单个字符标识,多个metric对应的字符可拼接在一起,作为-s选项传入,例如ppu-smi pmon -s um,指定进程利用率(u)和内存占用(m)相关metrics。
root@122d8d7a7e37:~# ppu-smi pmon -s um
# ppu pid type sm mem enc dec mem command
# idx # C/G % % % % MB name
0 4563 C 0 0 0 0 151 ppu_test
0 4991 C 0 0 0 0 151 ppu_test_thread支持的metrics说明如下:
-s选项metric字符 | 说明 |
u | 进程的处理器 / 内存 / 编码器 / 解码器利用率 |
m | 进程的内存使用信息 |
PPU-SMI滚动输出的每列信息,含义说明如下:
基础信息
Date: 当前日期
Time: 当前时间
ppu: 设备上电后分配的从0开始的枚举编号
pid: 进程的系统PID
type: 进程的类型,C表示为计算类型(Compute)进程
metric类型
usm: 流处理器利用率,单位%
mem: 内存利用率,单位%
enc: 编码器利用率,单位%
dec: 解码器利用率,单位%
metric类型
pmem: 进程内存占用大小,单位MiB
8.2 其他选项
选项 | 说明 |
-i, --id= | 指定特定设备,支持指定多个设备,通过
推荐使用UUID或者PCI Bus ID指定设备:
|
-d, --delay= | 设定两次查询的等待间隔,单位: 秒 |
-c, --count= | 指定多少次统计周期后停止统计 |
-o, --options= | 指定滚动信息是否包含日期或者时间列 |
-f, --filename= | 显示结果输出到文件 |
9. 查询ICN链路信息
PPU-SMI支持查询ICN链路相关信息,用户可通过子命令icn查询ICN相关信息,相关结果按照每设备每ICN链路的顺序显示,例如执行ppu-smi icn -s。
root@dfc623e46a90:~# ppu-smi icn -s
PPU 0: PPU (UUID: GPU-019ea108-c180-040a-0000-000000000000)
Link 0: 50 GB/s
Link 1: <inactive>
Link 2: <inactive>
Link 3: 50 GB/s
Link 4: 50 GB/s
Link 5: 50 GB/s
Link 6: 50 GB/s
PPU 1: PPU (UUID: GPU-019ea108-c180-060c-0000-000000000000)
Link 0: 50 GB/s
Link 1: <inactive>
Link 2: <inactive>
Link 3: 50 GB/s
...通过执行ppu-smi icn -h可查看ICN功能帮助信息,用户可通过-i和-l选项约束查询的设备和链路范围(不指定表示查询所有),用户每次可指定一个ICN查询子选项(例如-s)进行查询:
root@dfc623e46a90:~# ppu-smi icn -h
icn -- Display ICN link information.
ppu-smi icn [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help
Display help information
-i, --id=
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device.
-l, --link=
Specify a target link ID (0-based link index),
Without this parameter, all links information are displayed.
[any one of]
-s, --status
Display link state (active/inactive).
-c, --capabilities
Display link capabilities.
-p, --pcibusid
Display remote node PCI bus ID for a link.
-r, --remotelinkinfo
Display remote device PCI bus ID and ICN link ID for a link.9.1 查询ICN链路状态
使用ppu-smi icn -s查询链路的激活状态,带宽规格等信息,用户可通过-i选项约束查询的设备,例如执行ppu-smi icn -s -i 0,查询结果说明如下:
root@dfc623e46a90:~# ppu-smi icn -s -i 0
PPU 0: PPU (UUID: GPU-019ea108-c180-040a-0000-000000000000)
Link 0: 50 GB/s
Link 1: <inactive>
Link 2: <inactive>
Link 3: 50 GB/s
Link 4: 50 GB/s
Link 5: 50 GB/s
Link 6: 50 GB/sLink 0: 50 GB/s:PPU 0的ICN link 0连接了其他设备,带宽为50GB/s。Link 1: <inactive>: PPU 0的ICN link 1未连接其他设备。
9.2 查询ICN链路能力
使用ppu-smi icn -c查询每条ICN链路的能力,仅显示激活的ICN链路信息,查询结果示例如下:
root@dfc623e46a90:~# ppu-smi icn -c
PPU 0: PPU (UUID: GPU-019ea108-c180-040a-0000-000000000000)
Link 0, P2P is supported: true
Link 0, Access to system memory is supported: false
Link 0, P2P atomics is supported: true
Link 0, System memory atomics is supported: false
Link 0, SLI is supported: false
Link 0, Link is supported: true
Link 3, P2P is supported: true
Link 3, Access to system memory is supported: false
Link 3, P2P atomics is supported: true
Link 3, System memory atomics is supported: false
Link 3, SLI is supported: false
Link 3, Link is supported: true
...9.3 查询链路对端PCI Bus ID
使用ppu-smi icn -p查询ICN链路对端设备的PCI Bus ID,仅显示激活的ICN链路信息,查询结果示例如下:
root@dfc623e46a90:~# ppu-smi icn -p
PPU 0: PPU (UUID: GPU-019ea108-c180-040a-0000-000000000000)
Link 0: 00000001:CE:00.0
Link 3: 00000000:89:00.0
Link 4: 00000000:89:00.0
Link 5: 00000000:CC:00.0
Link 6: 00000001:CE:00.0
PPU 1: PPU (UUID: GPU-019ea108-c180-060c-0000-000000000000)
Link 0: 00000001:D1:00.0
Link 3: 00000000:C9:00.0
Link 4: 00000000:86:00.0
Link 5: 00000000:86:00.0
Link 6: 00000001:D1:00.0
...9.4 查询链路对端信息
使用ppu-smi icn -r查询ICN链路对端的信息,包含对端设备的PCI Bus ID,以及对端的ICN链路索引,查询结果示例如下:
root@dfc623e46a90:~# ppu-smi icn -r
PPU 0: PPU (UUID: GPU-019ea108-c180-040a-0000-000000000000)
Link 0: Remote Device 00000001:CE:00.0: Link 6
Link 3: Remote Device 00000000:89:00.0: Link 1
Link 4: Remote Device 00000000:89:00.0: Link 1
Link 5: Remote Device 00000000:CC:00.0: Link 3
Link 6: Remote Device 00000001:CE:00.0: Link 6
PPU 1: PPU (UUID: GPU-019ea108-c180-060c-0000-000000000000)
Link 0: Remote Device 00000001:D1:00.0: Link 7
Link 3: Remote Device 00000000:C9:00.0: Link 2
Link 4: Remote Device 00000000:86:00.0: Link 0
Link 5: Remote Device 00000000:86:00.0: Link 0
Link 6: Remote Device 00000001:D1:00.0: Link 7
...9.5 查询线缆在位状态
使用ppu-smi icn -cs查询ICN链路各端口线路的在位状态,查询结果示例如下:
root@dfc623e46a90:~# ppu-smi icn -cs
PPU 0: t-head ppu 0 (UUID: GPU-3f53d39f-ce6e-dc78-c3d4-4c18653c19c0)
Link 0: Connected
Link 1: Disconnected
Link 2: Connected
...
PPU 1: t-head ppu 1 (UUID: GPU-3f53d39f-ce6e-dc78-c3d4-4c18653c19c1)
Link 0: Connected
Link 1: Connected
Link 2: Connected
...注意:部分PPU产品不支持线缆在位检测,对于此类PPU查询线缆状态将提示不支持此功能。
9.6 查询链路位宽
使用ppu-smi icn -lw查询ICN链路位宽,仅显示激活的ICN链路信息,查询结果示例如下:
root@dfc623e46a90:~# ppu-smi icn -lw
PPU 0: PPU-ZW810 (UUID: GPU-019ea108-4111-0220-0000-0000006ef62f)
Link 0: 16x
Link 3: 16x
Link 4: 16x
Link 5: 16x
Link 6: 8x
PPU 1: PPU-ZW810 (UUID: GPU-019ea108-8191-042a-0000-0000c0d6cc1d)
Link 0: 16x
Link 3: 16x
Link 4: 16x
Link 5: 16x
Link 6: 8x
...16x:链路位宽为16bit8x:链路位宽为8bit
9.7 查询链路到物理端口的映射
使用ppu-smi icn -lm查询ICN链路到物理端口的映射关系,查询结果实例如下:
root@dfc623e46a90:~# ppu-smi icn -lm
PPU 0: PPU-ZW810 (UUID: GPU-019ea108-4111-0220-0000-0000006ef62f)
Link 0: Physical Port 2
Link 1: N/A
Link 2: Physical Port 5
...
PPU 1: PPU-ZW810 (UUID: GPU-019ea108-8191-042a-0000-0000c0d6cc1d)
Link 0: Physical Port 2
Link 1: N/A
Link 2: Physical Port 5
...无物理端口映射的链路将显示为
N/A
注意:部分PPU产品不支持查询物理端口的映射,对于此类PPU查询线缆状态将显示为N/A。
9.8 查询链路统计数据和错误计数
使用ppu-smi icn -e查询ICN链路统计数据和错误计数,仅显示激活的ICN链路信息,查询结果示例如下:
PPU 0: PPU-ZW810 (UUID: GPU-019ea108-4111-0220-0000-0000006ef62f)
Link 0: 2 link up times
Link 0: 1 link down times
Link 0: 0 FEC correctable errors
Link 0: 0 FEC uncorrectable errors
Link 0: 0 TX packet errors
Link 0: 0 RX packet errors
Link 0: 13 total TX packets
Link 0: 11 total RX packets
Link 3: 2 link up times
Link 3: 1 link down times
Link 3: 0 FEC correctable errors
Link 3: 0 FEC uncorrectable errors
Link 3: 0 TX packet errors
Link 3: 0 RX packet errors
Link 3: 16 total TX packets
Link 3: 8 total RX packets
...
PPU 1: PPU-ZW810 (UUID: GPU-019ea108-8191-042a-0000-0000c0d6cc1d)
Link 0: 2 link up times
Link 0: 1 link down times
Link 0: 0 FEC correctable errors
Link 0: 0 FEC uncorrectable errors
Link 0: 0 TX packet errors
Link 0: 0 RX packet errors
Link 0: 9 total TX packets
Link 0: 4 total RX packets
...link up times:链路上线的次数link down times:链路下线的次数FEC correctable errors:链路FEC可纠错的错误计数FEC uncorrectable errors:链路FEC不可纠错的错误计数TX packet errors:链路发送错误的包数RX packet errors:链路接收错误的包数total TX packets:链路总的发送包数total RX packets:链路总的接收包数
9.9 查询链路吞吐量
使用ppu-smi icn -gt r查询ICN链路当前的数据吞吐量汇总,查询结果示例如下:
root@0549cf16bb85:~# ppu-smi icn -gt r
PPU 0: PPU (UUID: GPU-019ea108-c110-0828-0000-000000000000)
Link 0: Raw Tx: 1618498333 KiB
Link 0: Raw Rx: 1657515730 KiB
Link 3: Raw Tx: 1653010223 KiB
Link 3: Raw Rx: 1693049419 KiB
Link 4: Raw Tx: 1622645860 KiB
Link 4: Raw Rx: 1662045442 KiB
...
PPU 1: PPU (UUID: GPU-019ea108-c120-040c-0000-000000000000)
Link 0: Raw Tx: 1618498333 KiB
Link 0: Raw Rx: 1657515730 KiB
Link 3: Raw Tx: 1653010223 KiB
Link 3: Raw Rx: 1693049419 KiB
Link 4: Raw Tx: 1622645860 KiB
Link 4: Raw Rx: 1662045442 KiB
...10. 查询设备间拓扑信息
PPU-SMI支持查询设备间的拓扑信息,用户可通过子命令topo查询相关信息,例如执行ppu-smi topo -m:
root@dfc623e46a90:~# ppu-smi topo -m
PPU0 PPU1 PPU2 PPU3 PPU4 PPU5 PPU6 PPU7 CPU Affinity NUMA Affinity
PPU0 X ICN2 SYS ICN1 SYS SYS ICN2 SYS 0-47,96-143 0
PPU1 ICN2 X ICN1 SYS SYS SYS SYS ICN2 0-47,96-143 0
PPU2 SYS ICN1 X ICN2 ICN1 ICN1 SYS SYS 0-47,96-143 0
PPU3 ICN1 SYS ICN2 X ICN1 ICN1 SYS SYS 0-47,96-143 0
PPU4 SYS SYS ICN1 ICN1 X ICN2 SYS ICN1 48-95,144-191 1
PPU5 SYS SYS ICN1 ICN1 ICN2 X ICN1 SYS 48-95,144-191 1
PPU6 ICN2 SYS SYS SYS SYS ICN1 X ICN2 48-95,144-191 1
PPU7 SYS ICN2 SYS SYS ICN1 SYS ICN2 X 48-95,144-191 1
...通过执行ppu-smi topo -h可查询拓扑信息相关帮助信息,用户每次可指定一个topo查询子选项(例如-m)进行查询。在使用-n或者-p选项时,需要通过-i选项指定相关设备:
root@dfc623e46a90:~# ppu-smi topo -h
topo -- Display topological information about the system.
ppu-smi topo [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help
Display help information
-i, --id=
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device.
Must be used in conjunction with -n or -p.
-ri, --rear-id=
When used with the option to display matrix (-m or -mp),
Show PPU devices that match the specified rear id.
-po, --ppu-only
When used with the option to display matrix (-m or -mp),
Show PPU devices only.
-rg, --rear-group
When used with the option to display matrix (-m or -mp),
Group PPU device by rear id.
[any one of]
-m, --matrix
Display the PPUDirect communication matrix for the system.
-mp, --matrix_pci
Display the PPUDirect communication matrix for the system (PCI Only).
-lni, --list-network-interface
Display a list of RDMA network interface controller(NIC) connected to the system.
-c, --cpu=
Specify a CPU number, Display all PPUs with an affinity.
-n, --nearest_ppus=
Display the nearest PPUs for a given traversal path.
Could be one of the following:
0 = a single PCIe switch on a dual PPU board
1 = a single PCIe switch
2 = multiple PCIe switches
3 = a PCIe host bridge
4 = an on-CPU interconnect link between PCIe host bridges
5 = an SMP interconnect link between NUMA nodes
Used in conjunction with -i which must be a single device ID.
-p, --ppu_path
Display the most direct path traversal for a pair of PPUs.
Used in conjunction with -i which must be a pair of device IDs.
-p2p, --p2pstatus=
Displays the p2p status between the PPUs of a given p2p capability.
Could be one of the following:
r - p2p read capabiity
w - p2p write capability
n - p2p ICN link capability
a - p2p atomics capability
p - p2p prop capability10.1 查询拓扑矩阵信息
通过执行ppu-smi topo -m,可查询两两设备间的连接状态,以及PPU和RDMA网卡之间的连接状态,若ICN链路激活,优先显示互联的ICN链路信息,查询结果说明如下:
root@dfc623e46a90:/# ppu-smi topo -m
PPU0 PPU1 PPU2 PPU3 PPU4 PPU5 PPU6 PPU7 NIC0 NIC1 NIC2 NIC3 NIC4 NIC5 NIC6 NIC7 CPU Affinity NUMA Affinity
PPU0 X ICN2 SYS ICN1 SYS SYS ICN2 SYS PXB SYS SYS SYS SYS SYS PXB SYS 0-47,96-143 0
PPU1 ICN2 X ICN1 SYS SYS SYS SYS ICN2 PIX SYS SYS SYS SYS SYS PIX SYS 0-47,96-143 0
PPU2 SYS ICN1 X ICN2 ICN1 ICN1 SYS SYS SYS PXB SYS SYS SYS SYS SYS PXB 0-47,96-143 0
PPU3 ICN1 SYS ICN2 X ICN1 ICN1 SYS SYS SYS PXB SYS SYS SYS SYS SYS PXB 0-47,96-143 0
PPU4 SYS SYS ICN1 ICN1 X ICN2 SYS ICN1 SYS SYS SYS PXB SYS SYS SYS SYS 48-95,144-191 1
PPU5 SYS SYS ICN1 ICN1 ICN2 X ICN1 SYS SYS SYS SYS PXB SYS SYS SYS SYS 48-95,144-191 1
PPU6 ICN2 SYS SYS SYS SYS ICN1 X ICN2 SYS SYS PXB SYS SYS PXB SYS SYS 48-95,144-191 1
PPU7 SYS ICN2 SYS SYS ICN1 SYS ICN2 X SYS SYS PIX SYS SYS PIX SYS SYS 48-95,144-191 1
NIC0 PXB PIX SYS SYS SYS SYS SYS SYS X SYS SYS SYS SYS SYS PIX SYS 0-47,96-143 0
NIC1 SYS SYS PXB PXB SYS SYS SYS SYS SYS X SYS SYS SYS SYS SYS PIX 0-47,96-143 0
NIC3 SYS SYS SYS SYS SYS SYS PXB PIX SYS SYS X SYS SYS PIX SYS SYS 48-95,144-191 1
NIC4 SYS SYS SYS SYS PXB PXB SYS SYS SYS SYS SYS X SYS SYS SYS SYS 48-95,144-191 1
NIC5 SYS SYS SYS SYS SYS SYS SYS SYS SYS SYS SYS SYS X SYS SYS SYS 0-47,96-143 0
NIC6 SYS SYS SYS SYS SYS SYS PXB PIX SYS SYS PIX SYS SYS X SYS SYS 48-95,144-191 1
NIC7 PXB PIX SYS SYS SYS SYS SYS SYS PIX SYS SYS SYS SYS SYS X SYS 0-47,96-143 0
Legend:
X = Self
SYS = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
PHB = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
PXB = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
PIX = Connection traversing at most a single PCIe bridge
ICN# = Connection traversing a bonded set of # ICN links
NIC Legend:
NIC0: mlx5_bond_0
NIC1: mlx5_bond_1
NIC2: mlx5_bond_2
NIC3: mlx5_bond_3
NIC4: mlx5_bond_4
NIC5: mlx5_bond_5
NIC6: mlx5_bond_6
NIC7: mlx5_bond_7
PPU Rear Group:
Rear ID 0: PPU 0,1,2,3,4,5,6,7ICN2:例如PPU0和PPU1之间有2个激活的ICN链路,显示为ICN2。SYS:例如PP0和PPU2之间无激活的ICN链路,将显示基于PCIE总线的链接状态信息,具体含义参见Legend标注说明。CPU Affinity 0-47,96-143: PPU设备和CPU核的亲和关系说明,例如PPU0亲和的CPU核为:CPU0至CPU47以及CPU96至CPU143。NUMA Affinity 0: PPU设备和NUMA node的亲和信息,例如PPU0亲和的NUMA node为node 0。NIC0:连接在系统上的RDMA网卡设备,通过NIC Legend查看实际对应的网卡设备名称。PPU Rear Group:按照机尾分组的PPU列表。每行显示连接在本机尾的PPU列表。
通过选项-po可在拓扑矩阵中只显示PPU设备不显示RDMA网卡,通过选项-mp可只显示PCI总线连接关系,不包含ICN链接的连接状态。
例如执行ppu-smi topo -mp -po,可查询两两PPU设备间PCI总线连接关系,查询结果示例如下:
root@dfc623e46a90:/# ppu-smi topo -mp -po
PPU0 PPU1 PPU2 PPU3 PPU4 PPU5 PPU6 PPU7 CPU Affinity NUMA Affinity
PPU0 X PXB SYS SYS SYS SYS SYS SYS 0-47,96-143 0
PPU1 PXB X SYS SYS SYS SYS SYS SYS 0-47,96-143 0
PPU2 SYS SYS X PXB SYS SYS SYS SYS 0-47,96-143 0
PPU3 SYS SYS PXB X SYS SYS SYS SYS 0-47,96-143 0
PPU4 SYS SYS SYS SYS X PXB SYS SYS 48-95,144-191 1
PPU5 SYS SYS SYS SYS PXB X SYS SYS 48-95,144-191 1
PPU6 SYS SYS SYS SYS SYS SYS X PXB 48-95,144-191 1
PPU7 SYS SYS SYS SYS SYS SYS PXB X 48-95,144-191 1
Legend:
X = Self
SYS = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
PHB = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
PXB = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
PIX = Connection traversing at most a single PCIe bridge10.1.1 按照机尾过滤和分组
PPU-SMI支持显示拓扑矩阵时指定机尾ID,只显示连接在指定机尾的PPU之间的拓扑信息。通过选项-ri指定过滤的机尾ID。PPU对应的机尾ID可通过ppu-smi -q或者ppu-smi --query-ppu等命令查询,也可查看拓扑矩阵显示的PPU Rear Group信息获取分组信息。
例如执行ppu-smi topo -m -po -ri 1,查询机尾ID为1的PPU之间的拓扑信息,查询结果示例如下,只有机尾ID为1的PPU 1、3、5等被现实,连接在其他机尾的PPU将不显示:
root@dfc623e46a90:/# ppu-smi topo -m -po -ri 1
PPU1 PPU3 PPU5 PPU7 PPU9 PPU11 PPU13 PPU15 CPU Affinity NUMA Affinity
PPU1 X ICN2 SYS ICN1 SYS SYS ICN2 SYS 0-47,96-143 0
PPU3 ICN2 X ICN1 SYS SYS SYS SYS ICN2 0-47,96-143 0
PPU5 SYS ICN1 X ICN2 ICN1 ICN1 SYS SYS 0-47,96-143 0
PPU7 ICN1 SYS ICN2 X ICN1 ICN1 SYS SYS 0-47,96-143 0
PPU9 SYS SYS ICN1 ICN1 X ICN2 SYS ICN1 48-95,144-191 1
PPU11 SYS SYS ICN1 ICN1 ICN2 X ICN1 SYS 48-95,144-191 1
PPU13 ICN2 SYS SYS SYS SYS ICN1 X ICN2 48-95,144-191 1
PPU15 SYS ICN2 SYS SYS ICN1 SYS ICN2 X 48-95,144-191 1
...
PPU Rear Group:
Rear ID 1: PPU 1,3,5,7,9,11,13,15PPU-SMI支持显示拓扑矩阵时按照机尾ID分组,拓扑矩阵中的PPU将先按照机尾ID排序,再按照PPU索引排序,例如机尾ID为0的PPU将集中排列在前显示。
通过选项-rg使能按照机尾ID分组功能,例如执行ppu-smi topo -mp -po -rg,查询结果示例如下,PPU首先按照机尾ID排列:
root@dfc623e46a90:/# ppu-smi topo -mp -po -rg
PPU0 PPU2 PPU4 PPU6 PPU8 PPU10 PPU12 PPU14 PPU1 PPU3 PPU5 PPU7 PPU9 PPU11 PPU13 PPU15 CPU Affinity NUMA Affinity
PPU0 X PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX 0-1,64-65 0
PPU2 PHB X PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB 0-1,64-65 0
PPU4 SYS PXB X PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS 0-1,64-65 0
PPU6 PXB NODE PIX X SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB 0-1,64-65 0
PPU8 NODE PIX PHB SYS X NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE 0-1,64-65 0
PPU10 PIX PHB SYS PXB NODE X PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX 0-1,64-65 0
PPU12 PHB SYS PXB NODE PIX PHB X PXB NODE PIX PHB SYS PXB NODE PIX PHB 0-1,64-65 0
PPU14 SYS PXB NODE PIX PHB SYS PXB X PIX PHB SYS PXB NODE PIX PHB SYS 0-1,64-65 0
PPU1 PXB NODE PIX PHB SYS PXB NODE PIX X SYS PXB NODE PIX PHB SYS PXB 0-1,64-65 0
PPU3 NODE PIX PHB SYS PXB NODE PIX PHB SYS X NODE PIX PHB SYS PXB NODE 0-1,64-65 0
PPU5 PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE X PHB SYS PXB NODE PIX 0-1,64-65 0
PPU7 PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB X PXB NODE PIX PHB 0-1,64-65 0
PPU9 SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB X PIX PHB SYS 0-1,64-65 0
PPU11 PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX X SYS PXB 0-1,64-65 0
PPU13 NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS X NODE 0-1,64-65 0
PPU15 PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE PIX PHB SYS PXB NODE X 0-1,64-65 0
...
PPU Rear Group:
Rear ID 0: PPU 0,2,4,6,8,10,12,14
Rear ID 1: PPU 1,3,5,7,9,11,13,1510.2 查询RDMA网卡设备列表
PPU-SMI支持通过选项-lni查询系统中的RDMA网卡信息,例如执行ppu-smi topo -lni,将会显示网卡的列表,包含名称和PCI Bus Id等信息,查询结果示例如下:
root@dfc623e46a90:/# ppu-smi topo -lni
NIC 0: mlx5_bond_0 (PCI Bus Id: 00000000:8A:00.1)
NIC 1: mlx5_bond_1 (PCI Bus Id: 00000000:CF:00.1)
NIC 2: mlx5_bond_2 (PCI Bus Id: 00000001:D2:00.0)
NIC 3: mlx5_bond_3 (PCI Bus Id: 00000001:87:00.0)
NIC 4: mlx5_bond_4 (PCI Bus Id: 00000000:2A:00.1)
NIC 5: mlx5_bond_5 (PCI Bus Id: 00000001:D2:00.1)
NIC 6: mlx5_bond_6 (PCI Bus Id: 00000000:8A:00.0)
NIC 7: mlx5_bond_7 (PCI Bus Id: 00000000:CF:00.0)10.3 查询指定CPU的亲和设备列表
PPU-SMI支持查询指定CPU的亲和设备列表,通过-c选项指定CPU索引,例如执行ppu-smi topo -c 0,查询CPU 0的亲和设备列表,查询结果示例如下:
root@dfc623e46a90:/# ppu-smi topo -c 0
The PPUs that have an affinity with CPU 0 are: 0, 1, 2, 310.4 查询临近的PPU设备列表
PPU-SMI支持查询指定PPU的临近设备列表,通过-n选项指定查询的拓扑范围,拓扑范围的定义参见帮助信息,通过-i选项指定目标PPU设备。例如执行ppu-smi topo -n 5 -i 0,查询结果示例如下:
root@dfc623e46a90:/# ppu-smi topo -n 5 -i 0
Device 0 is connected by way of a SMP interconnect link between NUMA nodes to device(s): 1, 2, 3, 4, 5, 6, 710.5 查询两个PPU设备间最短路径
PPU-SMI支持查询两个PPU设备之间的最短路径,通过-i选项指定2个PPU设备,例如执行ppu-smi topo -p -i 0,1,查询结果示例如下:
root@dfc623e46a90:/# ppu-smi topo -p -i 0,1
Device 0 is connected to device 1 by way of potentially multiple PCIe switches.10.6 查询设备间P2P能力
通过-p2p选项指定一种能力类型,PPU-SMI可显示设备间的P2P能力支持状态,能力类型的定义参见帮助信息。例如执行ppu-smi topo -p2p r,查询设备间P2P read的能力,查询结果示例如下:
root@dfc623e46a90:/# ppu-smi topo -p2p r
PPU0 PPU1 PPU2 PPU3 PPU4 PPU5 PPU6 PPU7
PPU0 X OK OK OK OK OK OK OK
PPU1 OK X OK OK OK OK OK OK
PPU2 OK OK X OK OK OK OK OK
PPU3 OK OK OK X OK OK OK OK
PPU4 OK OK OK OK X OK OK OK
PPU5 OK OK OK OK OK X OK OK
PPU6 OK OK OK OK OK OK X OK
PPU7 OK OK OK OK OK OK OK X
Legend:
X = Self
OK = Status Ok
CNS = Chipset not supported
PNS = PPU not supported
TNS = Topology not supported
NS = Not supported
U = Unknown11. 多设备实例管理(MIG)
PPU-SMI支持查询MIG模式下各实例信息,并支持创建/删除相关实例。MIG相关概念介绍如下:
GPU instance:PPU硬件资源切分为若干实例,每个实例为一个GPU instance。GPU instance互相之间隔离运行。
GPU instance profile:表示支持的PPU硬件资源切分方法,例如本切分实例支持独占的CU个数和内存大小等。
Compute instance:GPU instance切分为若干实例,每个实例为一个Compute instance。Compute instance独占CU资源,复用其他资源。应用可指定在Compute instance上运行。
Compute instance profile:表示支持的GPU instance切分方法,例如本切分实例支持独占的CU个数,以及共享的资源情况。
用户可通过执行ppu-smi -mig 1开启PPU设备的MIG模式(详细信息参见5. 修改设备配置)。用户可通过子命令mig查询MIG相关信息,例如执行ppu-smi mig -lgip查看支持的GPU instance profile信息:
root@0549cf16bb85:~# ppu-smi mig -lgip
+---------------------------------------------------------------------------------+
| GPU instance profiles: |
| PPU Name Profile Instances Memory P2P CU DEC ENC |
| ID Free/Total GiB CpyEng JPEG OFA |
+=================================================================================+
| 1 MIG 8g48gb 3 0/1 48.00 No 64 4 4 |
| 2 4 0 |
+---------------------------------------------------------------------------------+
| 1 MIG 4g24gb 2 1/2 24.00 No 32 2 2 |
| 2 2 0 |
+---------------------------------------------------------------------------------+
| 1 MIG 2g12gb 1 2/4 12.00 No 16 1 1 |
| 2 1 0 |
+---------------------------------------------------------------------------------+
| 1 MIG 1g6gb 0 4/8 6.00 No 8 0 0 |
| 2 0 0 |
+---------------------------------------------------------------------------------+通过执行ppu-smi mig -h可查询MIG相关帮助信息,用户每次可指定一个mig查询子选项进行查询。部分子选项可通过-i / -gi / -ci约束操作范围,指定的范围可组合或单独使用,比如-i 0 -gi 1可指定作用域PPU0的gpu instance 1。
root@dfc623e46a90:/# ppu-smi mig -h
mig -- Multi Instance GPU management.
ppu-smi mig [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help
Display help information
-i, --id=
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device.
-gi, --gpu-instance-id=
GPU instance ID.
Provide comma separated values for more than one GPU instance.
-ci, --compute-instance-id=
Compute instance ID.
Provide comma separated values for more than one compute instance.
-C, --default-compute-instance
When used with the option to create a GPU instance (-cgi),
Create compute instance with the default profile.
[any one of]
-lgip,--list-gpu-instance-profiles
List supported GPU instance profiles.
Option -i can be used to restrict the command to run on a specific PPU.
-lgipp,--list-gpu-instance-possible-placements
List possible GPU instance placements in the following format:
{Start,Start...}:Size
Option -i can be used to restrict the command to run on a specific PPU.
-cgi, --create-gpu-instance=
Create GPU instances for the given profile tuples.
A profile tuple consists of a profile name or ID and an optional placement specifier,
which consists of a colon and a placement start index.
Provide comma separated values for more than one profile tuple(e.g. 1:0,4:2).
Option -i can be used to restrict the command to run on a specific PPU.
-dgi, --destroy-gpu-instance
Destroy GPU instances.
Options -i and -gi can be used individually or combined
to restrict the command to run on a specific PPU or GPU instance.
-lgi, --list-gpu-instances
List GPU instances.
Option -i can be used to restrict the command to run on a specific PPU.
-r, --reset-gpu-instance
Trigger reset of the GPU instance.
Options -i and -gi can be used individually or combined
to restrict the command to run on a specific PPU or GPU instance.
-lcip,--list-compute-instance-profiles
List supported compute instance profiles.
Options -i and -gi can be used individually or combined
to restrict the command to run on a specific PPU or GPU instance.
-lcipp,--list-compute-instance-possible-placements
List possible compute instance placements in the following format:
{Start,Start...}:Size
Options -i and -gi can be used individually or combined
to restrict the command to run on a specific PPU or GPU instance.
-cci, --create-compute-instance=
Create compute instance for the given profile tuples.
A profile tuple consists of a profile name or ID and an optional placement specifier,
which consists of a colon and a placement start index.
Provide comma separated values for more than one profile tuple(e.g. 1:0,4:2).
If no profile name or ID is given, then the default*
compute instance profile ID will be used.
Options -i and -gi can be used individually or combined
to restrict the command to run on a specific PPU or GPU instance.
-dci, --destroy-compute-instance
Destroy compute instances.
Options -i, -gi and -ci can be used individually or combined
to restrict the command to run on a specific PPU or GPU instance or compute instance.
-lci, --list-compute-instances
List compute instances.
Options -i and -gi can be used individually or combined
to restrict the command to run on a specific PPU or GPU instance.11.1 查询GPU instance profile信息
通过-lgip选项可查询GPU instance profile信息,后续可通过-cgi选项指定其中某类profile信息创建GPU instance。通过-i选项可约束查询的设备范围,例如执行ppu-smi mig -i 1 -lgip,查询结果说明如下:
root@a475cc8d4c49:/# ppu-smi mig -i 1 -lgip
+---------------------------------------------------------------------------------+
| GPU instance profiles: |
| PPU Name Profile Instances Memory P2P CU DEC ENC |
| ID Free/Total GiB CpyEng JPEG OFA |
+=================================================================================+
| 1 MIG 8g96gb 3 1/1 96.00 No 64 4 4 |
| 2 4 0 |
+---------------------------------------------------------------------------------+
| 1 MIG 4g48gb 2 2/2 48.00 No 32 2 2 |
| 2 2 0 |
+---------------------------------------------------------------------------------+
| 1 MIG 2g24gb 1 4/4 24.00 No 16 1 1 |
| 2 1 0 |
+---------------------------------------------------------------------------------+
| 1 MIG 1g12gb 0 8/8 12.00 No 8 0 0 |
| 2 0 0 |
+---------------------------------------------------------------------------------+PPU: 设备上电后分配的从0开始的枚举编号。
Name: GPU instance profile的名称,后续可通过
-cgi指定此名称来创建GPU instance。Profile ID: GPU instance profile的ID编号,后续可通过
-cgi指定此ID来创建GPU instance。Instances Free/Total: 本profile剩余可创建的GPU instance个数 / 总共可支持创建的GPU instance个数。
Memory GiB: 本profile分配的设备内存,单位
GiB。P2P: 本profile是否支持peer-to-peer能力。
CU: 本profile独占的CU资源个数。
DEC: 本profile独占的解码器资源个数。
ENC: 本profile独占的编码器资源个数。
CpyEng: 本profile独占的copy engine资源个数。
JPEG: 本profile独占的JPEG处理单元个数。
OFA: 本profile独占的OFA处理单元个数。
11.2 查询GPU instance profile可能的创建位置
通过-lgipp选项可查询GPU instance profile可能的创建位置信息,后续可通过-cgi选项指定在具体的位置创建GPU instance。
可能的创建位置显示格式为:{start0, start1, start2}:size,即可能多个开始位置(start0 / start1 / start2),每种创建位置的尺寸size均相同。比如下文表示可在0和4位置创建profile,每个实例的尺寸都是4。
{0,4}:4例如执行ppu-smi mig -i 1 -lgipp,查询结果示例如下:
root@a475cc8d4c49:/# ppu-smi mig -i 1 -lgipp
PPU 1 profile ID 0 placements: {0,1,2,3,4,5,6,7}:1
PPU 1 profile ID 1 placements: {0,2,4,6}:2
PPU 1 profile ID 2 placements: {0,4}:4
PPU 1 profile ID 3 placements: {0,4}:411.3 创建GPU instance实例
通过-cgi选项可创建一个或者多个GPU instance,多个GPU instance信息之间通过逗号,分隔,对于每个需要建立的GPU instance:
通过传入GPU instance profile的名称或者ID,来指定使用哪个GPU instance profile创建GPU instance。
profile名称支持使用全名或者短名称,比如
MIG 1g12gb,若指定名称,可指定为MIG 1g12gb或者1g12gb。
在profile信息后可通过冒号
:指定GPU instance创建的开始位置。可选项,创建位置可以不指定。
举例:通过指定GPU instance profile ID为3,创建一个GPU instance,不指定创建位置。
-cgi 3举例:通过指定GPU instance profile ID分别为0和1,创建两个GPU instance,不指定创建位置。
-cgi 0,1举例:通过指定GPU instance profile ID为1,创建一个GPU instance,指定创建位置从4开始。
-cgi 1:4举例:通过指定GPU instance profile短名称1g12gb,创建一个GPU instance,不指定创建位置。
-cgi 1g12gb举例:通过指定GPU instance profile名称MIG 1g12gb和MIG 2g24gb,创建两个GPU instance,分别指定创建位置。
-cgi "MIG 1g12gb:0,MIG 2g24gb:4"用户可通过-i选项指定创建GPU instance的PPU设备,若不指定,则将在每个PPU设备上尝试创建。例如执行ppu-smi mig -i 1 -cgi 1,创建结果显示如下:
root@a475cc8d4c49:~# ppu-smi mig -i 1 -cgi 1
Successfully created GPU instance ID 0 on PPU 1 using profile MIG 2g24gb (Profile ID 1)11.4 查看GPU instance信息
通过-lgi选项可查询已存在的GPU instance信息,通过-i选项可约束查询的设备范围,例如执行ppu-smi mig -i 1 -lgi,查询结果说明如下:
root@0549cf16bb85:~# ppu-smi mig -i 1 -lgi
+---------------------------------------------------------+
| GPU instances: |
| PPU Name Profile Instance Placement |
| ID ID Start:Size |
+=========================================================+
| 1 MIG 2g12gb 1 0 0:2 |
+---------------------------------------------------------+
| 1 MIG 2g12gb 1 2 2:2 |
+---------------------------------------------------------+PPU: 设备上电后分配的从0开始的枚举编号
Name: GPU instance的名称
Profile ID: 创建本GPU instance时使用的GPU instance profile的ID编号
Instance ID:GPU instance的ID编号,后续可在
-gi选项中通过此ID指定对应的GPU instancePlacement:本GPU instance创建的位置信息
11.5 删除GPU instance实例
通过-dgi选项可删除GPU instance,通过-i选项可约束操作的设备范围,通过-gi选项可约束操作的GPU instance范围,-i和-gi选项可单独或者配合使用。
例如执行ppu-smi mig -dgi -i 1 -gi 1,删除PPU 1设备的gpu instance 1,操作示例如下:
root@0549cf16bb85:~# ppu-smi mig -dgi -i 1 -gi 1
Successfully destroyed GPU instance ID 1 from PPU 111.6 复位GPU instance实例
通过-r选项可复位GPU instance,复位一个GPU instance不会影响其他GPU instance的运行。通过-i选项可约束操作的设备范围,通过-gi选项可约束操作的GPU instance范围,-i和-gi选项可单独或者配合使用。
例如执行ppu-smi mig -i 1 -gi 0 -r,复位PPU 1设备的gpu instance 0,操作示例如下:
root@0549cf16bb85:~# ppu-smi mig -i 1 -gi 0 -r
Successfully trigger reset of GPU instance ID 0 from PPU 1.11.7 查询Compute instance profile信息
通过-lcip选项可查询GPU instance支持切分的Compute instance profile信息,通过-i选项可约束查询的设备范围,通过-gi选项可约束查询的GPU instance范围,-i和-gi选项可单独或者配合使用。例如执行ppu-smi mig -lcip -i 1 -gi 0,查询PPU 1上gpu instance 0支持切分Compute instance的情况,结果说明如下:
root@0549cf16bb85:~# ppu-smi mig -lcip -i 1 -gi 0
+--------------------------------------------------------------------------------------+
| Compute instance profiles: |
| PPU GPU Name Profile Instances Exclusive Shared |
| Instance ID Free/Total CU DEC ENC OFA |
| ID CpyEng JPEG |
+======================================================================================+
| 1 0 MIG 1u.2g12gb 0 16/16 1 0 0 0 |
| 2 0 |
+--------------------------------------------------------------------------------------+
| 1 0 MIG 2u.2g12gb 1 8/8 2 0 0 0 |
| 2 0 |
+--------------------------------------------------------------------------------------+
| 1 0 MIG 3u.2g12gb 2 4/4 3 0 0 0 |
| 2 0 |
+--------------------------------------------------------------------------------------+
| 1 0 MIG 4u.2g12gb 3 4/4 4 0 0 0 |
| 2 0 |
+--------------------------------------------------------------------------------------+
| 1 0 MIG 8u.2g12gb 4 2/2 8 0 0 0 |
| 2 0 |
+--------------------------------------------------------------------------------------+
| 1 0 MIG 12u.2g12gb 5 1/1 12 0 0 0 |
| 2 0 |
+--------------------------------------------------------------------------------------+
| 1 0 MIG 16u.2g12gb 6* 1/1 16 1 1 0 |
| 2 1 |
+--------------------------------------------------------------------------------------+PPU: 设备上电后分配的从0开始的枚举编号
GPU Instance ID:GPU instance的ID
Name:Compute instance profile的名称,可通过
-cci选项指定本profile名称创建Compute instanceProfile ID:Compute instance profile的ID,可通过
-cci选项指定本profile的ID创建Compute instance包含
*标记的ID为默认的Compute instance profile ID,通过-C或者-cci创建默认Compute instance时,将创建此profile对应的Compute instance
Instances Free/Total:本Compute instance profile支持建立的Compute instance最大个数和可用个数
Exclusive CU:本Compute instance profile创建的Compute instance中独占的CU个数
DEC: 本profile共享的解码器资源个数
ENC: 本profile共享的编码器资源个数
CpyEng: 本profile共享的copy engine资源个数
JPEG: 本profile共享的JPEG处理单元个数
OFA: 本profile共享的OFA处理单元个数
11.8 查询Compute instance profile可能的创建位置
通过-lcipp选项可查询Compute instance profile可能的创建位置信息,后续可通过-cci选项指定在具体的位置创建Compute instance。通过-i选项可约束操作的设备范围,通过-gi选项可约束操作的GPU instance范围,-i和-gi选项可单独或者配合使用。可能的创建位置显示格式为:{start0, start1, start2}:size,即可能多个开始位置(start0 / start1 / start2),每种创建位置的尺寸size均相同。比如下文表示可在0和4位置创建profile,每个实例的尺寸都是4。
{0,4}:4例如执行ppu-smi mig -i 3 -gi 0 -lcipp,查询结果示例如下:
root@0549cf16bb85:~# ppu-smi mig -i 3 -gi 0 -lcipp
PPU 3 GPU instance 0 profile ID 0 placements: {0,1,2,3,4,5,6,7}:1
PPU 3 GPU instance 0 profile ID 1 placements: {0,2,4,6}:2
PPU 3 GPU instance 0 profile ID 2 placements: {0,4}:3
PPU 3 GPU instance 0 profile ID 3 placements: {0,4}:4
PPU 3 GPU instance 0 profile ID 4 placements: {0}:811.9 创建Compute instance实例
通过-cci选项可创建一个或者多个Compute instance,可指定对应的Compute instance profile的名称或者ID,若不指定参数,则使用默认的Compute instance profile进行创建。多个Compute instance信息之间通过逗号,分隔,对于每个需要建立的Compute instance:
通过传入Compute instance profile的名称或者ID,来指定使用哪个Compute instance profile创建Compute instance。
profile名称支持使用全名或者短名称,比如
MIG 1u.1g6gb,若指定名称,可指定为MIG 1u.1g6gb或者1u.1g6gb。
在profile信息后可通过冒号
:指定Compute instance创建的开始位置。可选项,创建位置可以不指定。
通过-i选项可约束操作的设备范围,通过-gi选项可约束操作的GPU instance范围,-i和-gi选项可单独或者配合使用。此外用户可在创建GPU instance时同时创建默认的Compute instance,例如执行ppu-smi mig -i 1 -cgi 1 -C:
root@0549cf16bb85:~# ppu-smi mig -i 1 -cgi 1 -C
Successfully created GPU instance ID 4 on PPU 1 using profile MIG 2g12gb (Profile ID 1)
Successfully created compute instance ID 0 on PPU 1 GPU instance ID 4 using profile MIG 16u.2g12gb (Profile ID 6)举例:通过指定Compute instance profile ID为3,创建一个Compute instance
-cci 3举例:通过指定Compute instance profile ID为3,4,创建两个Compute instance
-cci 3,4举例:通过指定Compute instance profile ID为1,创建一个Compute instance,指定创建位置从4开始
-cci 1:4举例:通过指定Compute instance profile短名称为1u.2g12gb,创建一个Compute instance
-cci 1u.2g12gb举例:通过指定Compute instance profile名称为MIG 1u.2g12gb和MIG 2u.2g12gb,创建两个Compute instance
-cci "MIG 1u.2g12gb,MIG 2u.2g12gb"举例:不指定Compute instance profile名称或者ID,使用默认的Compute instance profile创建一个Compute instance
ppu-smi mig -cci -i 1 -gi 0用户可通过-i和-gi选项指定创建Compute instance实例的位置,若不指定,将在所有的PPU设备和GPU instance上尝试创建。例如执行ppu-smi mig -i 1 -gi 0 -cci 3,操作示例如下:
root@0549cf16bb85:~# ppu-smi mig -i 1 -gi 0 -cci 3
Successfully created compute instance ID 0 on PPU 1 GPU instance ID 0 using profile MIG 4u.2g12gb (Profile ID 3)11.10 查询Compute instance信息
通过-lci选项可查询已存在的Compute instance信息,通过-i选项可约束查询的设备范围,通过-gi选项可约束查询的GPU instance范围,-i和-gi选项可单独或者配合使用。例如执行ppu-smi mig -i 1 -gi 0 -lci,查询结果说明如下:
root@0549cf16bb85:~# ppu-smi mig -i 1 -gi 0 -lci
+-------------------------------------------------------------------+
| Compute instances: |
| PPU GPU Name Profile Instance Placement |
| Instance ID ID Start:Size |
| ID |
+===================================================================+
| 1 0 MIG 4u.2g12gb 3 0 0:0 |
+-------------------------------------------------------------------+
| 1 0 MIG 8u.2g12gb 4 1 0:1 |
+-------------------------------------------------------------------+PPU: 设备上电后分配的从0开始的枚举编号
GPU Instance ID:GPU instance的ID
Name:Compute instance的名称
Profile ID:创建本Compute instance使用的Compute instance profile的ID
Instance ID:本Compute instance的ID,后续可通过
-ci选项指定Compute instance实例Placement:本Compute instance创建的位置信息
11.11 删除Compute instance实例
通过-dci选项可删除Compute instance,通过-i选项可约束操作的设备范围,通过-gi选项可约束操作的GPU instance范围,通过-ci选项可约束操作的Compute instance范围,-i、-gi和-ci选项可单独或者配合使用。
例如执行ppu-smi mig -dci -i 1 -gi 0 -ci 1,删除PPU 1设备的gpu instance 0的compute instance 1,操作示例如下:
root@0549cf16bb85:~# ppu-smi mig -dci -i 1 -gi 0 -ci 1
Successfully destroyed compute instance ID 1 from PPU 1 GPU instance 012. 虚拟化设备(vGPU)
PPU-SMI支持查询设备虚拟化(vGPU)的相关信息,并支持创建/删除vGPU实例。使用vGPU相关功能需要用户具备管理员权限。
vGPU相关概念介绍如下:
vGPU type:PPU设备支持的vGPU类型信息,即此类vGPU的PPU资源切分方法,例如本vGPU type切分方案下每个vGPU实例分配的CE个数和内存大小等。
vGPU instance:按照指定的vGPU type创建的vGPU实例,用户可使用vGPU instance创建虚拟机(VM)。
vGPU instance实例的状态说明如下:
active instance:指已被创建且存在VM与之关联的vGPU实例。
alive instance:指已被创建的vGPU实例,包含未关联任何VM的vGPU实例。
可通过执行ppu-smi -vm VGPU开启PPU设备的vGPU模式(详细信息参见5. 修改设备配置)。可通过vgpu子命令查询vGPU相关信息,例如执行ppu-smi vgpu -s查看设备支持的vGPU type信息:
root@0549cf16bb85:~# ppu-smi vgpu -s
PPU 0: PPU (UUID: GPU-019ea108-c110-0420-0000-0000e0b7fe3c)
vGPU Type 0: vGPU-0 (Class: MIG-Backed: 2 CE 5GB Memory 0 ICN 0 DVG 0 EVG)
vGPU Type 1: vGPU-1 (Class: MIG-Backed: 2 CE 5GB Memory 0 ICN 1 DVG 0 EVG)
vGPU Type 2: vGPU-2 (Class: MIG-Backed: 2 CE 5GB Memory 0 ICN 0 DVG 1 EVG)
vGPU Type 3: vGPU-3 (Class: MIG-Backed: 2 CE 5GB Memory 1 ICN 0 DVG 0 EVG)
vGPU Type 4: vGPU-4 (Class: MIG-Backed: 2 CE 5GB Memory 1 ICN 1 DVG 0 EVG)
vGPU Type 5: vGPU-5 (Class: MIG-Backed: 2 CE 5GB Memory 1 ICN 0 DVG 1 EVG)
...通过执行ppu-smi vgpu -h可查询vGPU相关帮助信息,每次可指定一个vgpu查询 / 操作子选项进行操作。可通过-i选项指定操作单个或多个PPU设备。vgpu子命令的所有查询功能均可通过-l选项指定周期输出查询结果,单位为秒,例如-l 5表示每5秒输出一次结果,直到输入ctrl +c取消查询操作。
root@0549cf16bb85:~# ppu-smi vgpu -h
vgpu -- Virtual GPU management.
ppu-smi vgpu [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help
Display help information
-i, --id=
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device.
-v, --verbose
Display detailed information about supported vGPU types or vGPU types that can be created.
-l, --loop=
Display information at the specified time interval in seconds until Ctrl-C is pressed.
-f, --force
When used with the option to delete a vGPU instance (-di),
Delete vGPU instance regardless of VM state.
[any one of]
-q, --query
Display information about currently running vGPU instances (VM active).
-a, --alive
Display information about currently alive vGPU instances.
-s, --supported
Display supported vGPU types.
-c, --creatable
Display the vGPU types that can currently be created.
-ci, --create-instance=
Create a vGPU instance for the given vGPU type ID.
-di, --delete-instance=
Delete a vGPU instance for the given vGPU instance ID.
Use option -f to delete vGPU instance regardless of VM state.12.1 查询支持的vGPU类型
通过-s选项可查询PPU设备支持的vGPU类型信息(vGPU type)。通过-i选项可约束查询的设备范围,例如执行ppu-smi vgpu -i 0 -s,查询结果说明如下:
root@0549cf16bb85:~# ppu-smi vgpu -i 0 -s
PPU 0: PPU (UUID: GPU-019ea108-c110-0420-0000-0000e0b7fe3c)
vGPU Type 0: vGPU-0 (Class: MIG-Backed: 2 CE 5GB Memory 0 ICN 0 DVG 0 EVG)
vGPU Type 1: vGPU-1 (Class: MIG-Backed: 2 CE 5GB Memory 0 ICN 1 DVG 0 EVG)
vGPU Type 2: vGPU-2 (Class: MIG-Backed: 2 CE 5GB Memory 0 ICN 0 DVG 1 EVG)
vGPU Type 3: vGPU-3 (Class: MIG-Backed: 2 CE 5GB Memory 1 ICN 0 DVG 0 EVG)
vGPU Type 4: vGPU-4 (Class: MIG-Backed: 2 CE 5GB Memory 1 ICN 1 DVG 0 EVG)
vGPU Type 5: vGPU-5 (Class: MIG-Backed: 2 CE 5GB Memory 1 ICN 0 DVG 1 EVG)
...每个PPU设备下的列表包含如下信息:
vGPU type ID
vGPU type的名称
vGPU type的分类详细信息
通过-s和-v选项组合,可以查询更详细的vGPU类型信息,例如执行ppu-smi vgpu -i 0 -s -v,查询结果说明如下:
root@0549cf16bb85:~# ppu-smi vgpu -i 0 -s -v
+-------------------------------------------------------------------+
| Supported vGPU types: |
| PPU Type Name Instances GPU Memory |
| ID Free/Total Instance GiB |
| ID |
+===================================================================+
| 0 0 vGPU-0 4/8 N/A 5.00 |
+-------------------------------------------------------------------+
| 0 1 vGPU-1 0/1 N/A 5.00 |
+-------------------------------------------------------------------+
| 0 2 vGPU-2 2/4 N/A 11.00 |
+-------------------------------------------------------------------+PPU: 设备上电后分配的从0开始的枚举编号
Type ID:vGPU type的ID
Name:vGPU type的名称
Instances Free/Total:当前可建立的vGPU实例个数 / 总共可建立的vGPU实例个数
GPU Instance ID:vGPU type对应的MIG GPU instance ID,
N/A表示没有对应关系Memory GiB:每个vGPU实例分配的内存大小
12.2 查询可创建的vGPU类型
通过-c选项可查询PPU设备当前可创建的vGPU类型信息(vGPU type),通过-i选项可约束查询的设备范围,例如执行ppu-smi vgpu -i 0 -c,查询结果仅包含当前PPU资源允许创建的vGPU type:
root@0549cf16bb85:~# ppu-smi vgpu -i 0 -s
PPU 0: PPU (UUID: GPU-019ea108-c110-0420-0000-0000e0b7fe3c)
vGPU Type 0: vGPU-0 (Class: MIG-Backed: 2 CE 5GB Memory 0 ICN 0 DVG 0 EVG)
vGPU Type 3: vGPU-3 (Class: MIG-Backed: 2 CE 5GB Memory 1 ICN 0 DVG 0 EVG)
...每个PPU设备下的列表包含如下信息:
vGPU type ID
vGPU type的名称
vGPU type的分类详细信息
通过-c和-v选项组合,可以查询更详细的允许创建的vGPU类型信息,例如执行ppu-smi vgpu -i 0 -c -v,查询结果说明如下:
root@0549cf16bb85:~# ppu-smi vgpu -i 0 -c -v
+-------------------------------------------------------------------+
| Supported vGPU types: |
| PPU Type Name Instances GPU Memory |
| ID Free/Total Instance GiB |
| ID |
+===================================================================+
| 0 0 vGPU-0 4/8 N/A 5.00 |
+-------------------------------------------------------------------+
| 0 2 vGPU-2 2/4 N/A 11.00 |
+-------------------------------------------------------------------+PPU: 设备上电后分配的从0开始的枚举编号
Type ID:vGPU type的ID
Name:vGPU type的名称
Instances Free/Total:当前可建立的vGPU实例个数 / 总共可建立的vGPU实例个数
GPU Instance ID:vGPU type对应的MIG GPU instance ID,
N/A表示没有对应关系Memory GiB:每个vGPU实例分配的内存大小
12.3 创建vGPU instance实例
通过-ci选项可一个指定vGPU type类型,创建对应类型的vGPU instance实例。
通过-i选项可约束操作的设备范围,例如执行ppu-smi vgpu -i 0 -ci 0,在PPU设备0上创建vGPU类型ID为0的一个vGPU实例,操作示例如下:
root@0549cf16bb85:~# ppu-smi vgpu -ci 0 -i 0
Successfully created vGPU instance 0 (PCI Bus ID 00000000:5E:00.0) on PPU 0 using vGPU type 0.12.4 查询已创建的vGPU instance信息
通过-a选项可查询已创建(状态为alive)的vGPU instance的信息,通过-i选项可约束查询的设备范围,例如执行ppu-smi vgpu -i 0 -a,查询结果说明如下:
root@0549cf16bb85:~# ppu-smi vgpu -i 0 -a
PPU 00000000:10:00.0
Alive vGPUs : 2
vGPU Instance 1
vGPU Instance ID : 1
vGPU Name : vGPU-10
vGPU Type : 10
vGPU UUID : VGPU-3f53d39f-ce6e-dc78-c3d4-4c18653c19c0
vGPU PCI Bus ID : 00000000:10:01.0
MDEV UUID : N/A
GPU Instance ID : N/A
ECC Mode : Enabled
Memory Size : 28672 MiB
vGPU Instance 5
vGPU Instance ID : 5
vGPU Name : vGPU-1
vGPU Type : 1
vGPU UUID : VGPU-3f53d39f-ce6e-dc78-c3d4-4c18653c19c1
vGPU PCI Bus ID : 00000000:10:01.4
MDEV UUID : N/A
GPU Instance ID : N/A
ECC Mode : Enabled
Memory Size : 7168 MiB对于每个PPU设备:
Alive vGPUs: 当前PPU设备已创建的vGPU实例个数
对于每个vGPU实例:
vGPU Instance ID: vGPU实例的ID,后续可通过
-di选项指定此ID,删除对应vGPU实例vGPU Name:本vGPU实例的名称
vGPU Type:对应vGPU类型的ID
vGPU UUID:vGPU实例的UUID
vGPU PCI Bus ID:vGPU实例的PCI Bus ID,即
Bus:Device.Function信息MDEV UUID:vGPU实例对应的MIG device的UUID,
N/A表示没有对应关系GPU Instance ID:vGPU实例对应的MIG GPU instance ID,
N/A表示没有对应关系ECC Mode:vGPU实例的ECC工作模式
Memory Size:vGPU实例分配的内存总量
12.5 查询已关联VM的vGPU instance信息
通过-q选项可查询已关联VM(状态为active)的vGPU instance的信息,通过-i选项可约束查询的设备范围,例如执行ppu-smi vgpu -i 0 -q,查询结果说明如下:
root@0549cf16bb85:~# ppu-smi vgpu -i 0 -q
PPU 00000000:10:00.0
Active vGPUs : 1
vGPU Instance 1
vGPU Instance ID : 1
VM UUID : ee7b7a4b-388a-4357-a425-5318b2c65b30
vGPU Name : vGPU-10
vGPU Type : 10
vGPU UUID : VGPU-3f53d39f-ce6e-dc78-c3d4-4c18653c19c0
vGPU PCI Bus ID : 00000000:10:01.0
MDEV UUID : N/A
Guest Driver Version : 0.8.0
GPU Instance ID : N/A
ECC Mode : Enabled
Memory Usage
Total : 28672 MiB
Used : 3 MiB
Free : 28669 MiB对于每个PPU设备:
Active vGPUs: 当前PPU设备已创建且关联VM的vGPU实例个数
对于每个vGPU实例:
vGPU Instance ID: vGPU实例的ID,后续可通过
-di选项指定此ID,删除对应vGPU实例VM UUID:VM虚拟机的UUID
VM Domain ID:VM虚拟机的domain ID
vGPU Name:本vGPU实例的名称
vGPU Type:对应vGPU类型的ID
vGPU UUID:vGPU实例的UUID
vGPU PCI Bus ID:vGPU实例的PCI Bus ID,即
Bus:Device.Function信息MDEV UUID:vGPU实例对应的MIG device的UUID,
N/A表示没有对应关系Guest Driver Version:VM虚拟机内的驱动版本
GPU Instance ID:vGPU实例对应的MIG GPU instance ID,
N/A表示没有对应关系ECC Mode:vGPU实例的ECC工作模式
Memory Usage:vGPU实例的内存使用情况
Total:vGPU实例分配的内存总量
Used:vGPU实例已使用内存量
Free:vGPU实例剩余可用内存量
12.6 删除vGPU instance实例
通过-di选项可指定一个指定vGPU instance ID,删除此ID对应的vGPU instance实例。通过-i选项可约束操作的设备范围,默认不允许删除正在被VM使用的vGPU instance,可通过-f强制删除正在被使用的vGPU instance。例如执行ppu-smi vgpu -i 0 -di 1,在PPU设备0上创建vGPU类型ID为1的一个vGPU实例,操作示例如下:
root@0549cf16bb85:~# ppu-smi vgpu -i 0 -di 1
Successfully deleted vGPU instance 9 from PPU 0.13. 隔离PPU设备(drain)
PPU-SMI支持设置和查询PPU设备的隔离状态(drain state),以支持当某个PPU设备出现故障时,将此PPU设备屏蔽和隔离。对于被隔离(drain)的PPU设备介绍如下:
PPU设备正在执行的任务将不收影响。
PPU设备不会接受新的计算任务。
PPU设备在PPU-SMI和PPUDBG等工具中不可见。
例如执行ppu-smi drain -p 0001:AA:00.0 -m 1将 PCI bus ID 为0001:AA:00.0的PPU设备设置为隔离状态:draining:
root@dfc623e46a90:~# ppu-smi drain -p 0001:AA:00.0 -m 1
Successfully set PPU 0001:AA:00.0 drain state to: draining.通过执行ppu-smi drain -h可查看drain功能帮助信息,相关功能需要通过-p传入PPU的 PCI bus ID 以指定对应PPU设备:
root@dfc623e46a90:~# ppu-smi drain -h
drain -- Displays/modifies PPU drain states for power idling.
ppu-smi drain [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help
Display help information
-p, --pciid=
PPU PCI ID in the format XXXX:YY:Z.a
XXXX = domain
YY = bus
Z = device
a = function
[any one of]
-m, --modify=
Modify the drain state of a PPU specified by -p.
0 = not draining
1 = draining
-q, --query
Query the drain state of a PPU specified by -p.13.1 设置隔离状态
使用-m选项可设置或者取消PPU设备的隔离状态(drain state),通过-p传入PPU的 PCI bus ID 以指定对应PPU设备。例如执行ppu-smi drain -p 0001:AA:00.0 -m 1将PPU进行隔离,操作结果示例如下:
root@dfc623e46a90:~# ppu-smi drain -p 0001:AA:00.0 -m 1
Successfully set PPU 0001:AA:00.0 drain state to: draining.Tips:由于被隔离的PPU设备在PPU-SMI等工具中不可见,若需要查询相关PPU设备的 PCI bus ID 信息,可通过lspci工具进行查询,例如执行:lspci | grep 6001 查询和过滤显示所有PPU设备。
13.2 查询隔离状态
使用-q选项可查询PPU设备的隔离状态(drain state),通过-p传入PPU的 PCI bus ID 以指定对应PPU设备。例如执行ppu-smi drain -p 0001:AA:00.0 -q查询隔离状态,结果示例如下:
root@dfc623e46a90:~# ppu-smi drain -p 0001:AA:00.0 -q
The current drain state of PPU 0000:12:1.0 is: draining.14. 性能监控功能管理(gpm)
PPU-SMI支持设置和查询性能监控(GPM)的使能状态,性能监控(GPM)功能使能时将会使用PPU设备performance counter采集数据,其他使用PPU设备performance counter功能的应用将无法运行。可通过PPU-SMI查询性能监控(GPM)功能的使能状态,以及暂停性能监控(GPM)功能以使用其他应用采集performance counter数据,并在使用完成后恢复性能监控(GPM)功能。
例如执行ppu-smi gpm --get-stream-state查询PPU设备的性能监控(GPM)功能是否被暂停的状态:
root@dfc623e46a90:~# ppu-smi gpm --get-stream-state
PPU 0 GPM stream state: Enabled.
PPU 1 GPM stream state: Disabled.通过执行ppu-smi gpm -h可查看drain功能帮助信息,可通过-i选项指定单个或多个PPU设备,多个设备ID通过逗号,分隔。
root@dfc623e46a90:~# ppu-smi gpm -h
gpm -- GPU Performance Monitoring management.
ppu-smi gpm [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help
Display help information
-i, --id=
Enumeration index, Serial number, PCI bus ID or UUID.
Provide comma separated values for more than one device.
[any one of]
-s, --set-stream-state=
Set GPU Performance Monitoring Stream State:
0/DISABLED, 1/ENABLED
-g, --get-stream-state
Get GPU Performance Monitoring Stream State
--get-sample-state
Get GPU Performance Monitoring Sample State14.1 设置性能监控输出状态
使用-s选项可使能或者禁止性能监控(GPM)功能的输出状态开关,当性能监控(GPM)功能被禁止时:
订阅
性能监控(GPM)数据的应用获取的性能结果为N/A。性能监控(GPM)功能不再使用PPU设备的performance counter。
例如执行ppu-smi gpm -s DISABLED -i 0暂停PPU 0设备的性能监控(GPM)的输出:
root@dfc623e46a90:~# ppu-smi gpm -s DISABLED -i 0
Set GPM stream state to DISABLED for PPU 00000000:5E:00.0.通过使用
-s选项暂时禁止性能监控(GPM)功能可以让其他使用PPU设备performance counter的应用(如Asight)可正常采集PPU性能数据。应用通过其他方式采集performance counter数据(非
性能监控(GPM)方式)的采集行为,不受此选项控制。
14.2 查询性能监控输出状态
使用-g选项可查询性能监控(GPM)功能的输出状态开关,通过-i选项可约束查询的设备范围。例如执行ppu-smi gpm -g -i 0查询PPU 0设备的性能监控(GPM)输出状态:
root@dfc623e46a90:~# ppu-smi gpm -g -i 0
PPU 0 GPM stream state: Disabled.性能监控(GPM)输出状态开关查询为使能时,可使用--get-sample-state选项查询性能监控(GPM)的采集状态,确认存在应用通过性能监控(GPM)采集性能指标,并占用PPU设备performance counter资源。可通过
ppu-smi -q查询PPU设备performance counter是否正在使能。
14.3 查询性能监控采集状态
使用--get-sample-state选项可查询性能监控(GPM)功能的采集状态,即是否存在应用使用性能监控(GPM)采集性能指标。例如执行ppu-smi gpm --get-sample-state查询所有PPU设备的性能监控(GPM)功能的采集状态:
root@dfc623e46a90:~# ppu-smi gpm --get-sample-state
PPU 0 GPM sample state: Enabled.
PPU 1 GPM sample state: Disabled.15. 已知问题
SDK v1.00:查询的application clock频率可能低于实际值。
SDK v1.00:
mig子命令中,不指定查询实例ID的查询操作可能失败。SDK v1.4.0:查询PPU进程列表可能包含错误的进程信息。
ppu-smi -q -d UTILIZATION中,和采样相关信息暂不支持。stats子命令中,和采样相关信息暂不支持。ppu-smi icn -gt d查询ICN链路负载数据吞吐量暂不支持。ppu-smi icn -gt r查询ICN链路数据量低于实际值。因温度或者功耗限制而降频的比例统计信息暂不支持。
PCIe replay counter和error counter相关信息查询暂不支持。