错误注入
概述
DCGM 包含一个错误注入框架,允许用户在遇到 GPU 错误时模拟 DCGM API 的错误处理行为。
错误注入工作流程
使用该框架注入 GPU 错误的基本工作流程如下:
启动
nv-hostengine
守护程序通过 DCGM 启用监控(使用策略或健康监视)
确定目标 GPU 错误的注入值
使用
dcgmi test --inject
注入错误DCGM 现在应报告 GPU 错误
字段标识符
字段标识符的完整列表可在此处找到:https://github.com/NVIDIA/DCGM/blob/master/dcgmlib/dcgm_fields.h
这些标识符可用于确定以下部分命令中要使用的整数 ID。
注入框架中可能使用的常见错误列表包括:
PCIe 重放错误
ECC 错误(单双位错误或多个共址单比特错误)
电源偏移
热偏移
XID 错误
NVLink 错误
使用 dcgmi
的示例
在这些示例中,我们演示了如何使用 DCGM 检测各种 GPU 错误场景。
热违规
此示例演示了超过指定 GPU 热阈值的偏移。
在此示例中,使用 DCGM 策略来监视目标温度阈值 50°C 的违规行为。
在一个“监听”终端中
$ dcgmi policy --set 0,0 -T 50
Policy successfully set.
注册 DCGM 以监视违规行为
$ dcgmi policy --reg
Listening for violations.
在另一个“应用程序”终端中,启动工作负载。提供的 DCGM CUDA 负载生成器可用于此目的。 对于此示例,在 GPU 上启动 FP16 GEMM
$ dcgmproftester11 --no-dcgm-validation -t 1004 -d 30
回到“监听”控制台,DCGM 报告由于计算工作导致 GPU 温度升高而产生的热违规行为
Timestamp: Wed Sep 21 22:23:18 2022
The maximum thermal limit has violated policy manager values.
Temperature: 56
Timestamp: Wed Sep 21 22:23:28 2022
The maximum thermal limit has violated policy manager values.
Temperature: 60
PCIe 重放错误
此示例演示了 PCIe 重放错误的注入。
在“监听”终端中
$ dcgmi policy --set 0,0 -p
Policy successfully set.
$ dcgmi policy --reg
Listening for violations.
在另一个终端中,注入一个人为的值 99999
$ dcgmi test --inject --gpuid 0 -f 202 -v 99999
Successfully injected field info.
在“监听”终端中,DCGM 报告这些 PCIe 重放违规行为
Listening for violations.
Timestamp: Thu Sep 22 01:30:34 2022
A PCIe replay event has violated policy manager values.
PCIe replay count: 99999
当使用 DCGM 的健康监视时,也可以观察到相同的违规行为
$ dcgmi health -c
+---------------------------+----------------------------------------------------------+
| Health Monitor Report |
+===========================+==========================================================+
| Overall Health | Warning |
| GPU | |
| -> 0 | Warning |
| -> Errors | |
| -> PCIe system | Warning |
| | Detected more than 8 PCIe replays per minute for GPU 0 |
| | : 99999 Reconnect PCIe card. Run system side PCIE |
| | diagnostic utilities to verify hops off the GPU board |
| | If issue is on the board, run the field diagnostic. |
+---------------------------+----------------------------------------------------------+
ECC 错误
此示例演示了双位错误 (DBE) 的注入。
在“监听”终端中
$ dcgmi policy --set 0,0 -e
Policy successfully set.
$ dcgmi policy --reg
Listening for violations.
在另一个终端中,注入值 4
$ dcgmi test --inject --gpuid 0 -f 319 -v 4
Successfully injected field info.
在“监听”终端中,DCGM 报告 ECC 错误
Timestamp: Thu Sep 22 04:44:12 2022
A double-bit ECC error has violated policy manager values.
DBE error count: 2
API 示例
有关如何以编程方式注入值的示例,请参见以下 Python 文件
https://github.com/NVIDIA/DCGM/blob/master/testing/python3/tests/test_injection.py