跳转至

海光 DCU

通过 hy-smi-exporter 采集海光 DCU / HCU 加速卡的算力利用率、显存与 GTT、温度、功耗、电压、时钟频率、PCIe 链路及 ECC/RAS 错误监控指标。

配置

前置条件

  • 目标节点已安装海光加速卡驱动(hydcu / hycu)与 DTK 工具链,且宿主机可执行只读命令 hy-smi(通常位于 /opt/hyhal/bin/hy-smi 或 /usr/bin/hy-smi)。
  • 已安装 DataKit,且 DataKit 所在主机可访问 hy-smi-exporter 监听的 :9584/metrics 端点。

部署 hy-smi-exporter

从 di-matrix-ai/hy-smi-exporter 获取或使用 Go 1.23+ 编译二进制:

git clone https://github.com/di-matrix-ai/hy-smi-exporter.git
cd hy-smi-exporter
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o hy-smi-exporter ./cmd/hy-smi-exporter

在搭载海光 DCU / HCU 的节点上启动 hy-smi-exporter(开启 --hy-smi.collect-1s-stats=true 以采集核心利用率、显存控制器利用率并在仅支持 hy-smi -a 文本详情的驱动版本上完成完整指标解析):

./hy-smi-exporter \
  --web.listen-address=:9584 \
  --hy-smi.path=/opt/hyhal/bin/hy-smi \
  --hy-smi.timeout=10s \
  --hy-smi.collect-1s-stats=true \
  --log.level=info

启动后验证健康检查与指标接口:

curl -s http://127.0.0.1:9584/healthz
curl -s http://127.0.0.1:9584/metrics | grep '^hy_smi_'

配置 DataKit

进入 DataKit 安装目录,复制 prom 采集器配置:

mkdir -p conf.d/prom
cp conf.d/samples/prom.conf.sample conf.d/prom/hy_smi.conf

修改 conf.d/prom/hy_smi.conf,将 <host> 和 <env> 替换为实际的节点地址与环境标识(通过 metric_name_filter = ["^hy_smi_"] 仅保留海光加速卡指标):

[[inputs.prom]]
  urls = ["http://<host>:9584/metrics"]
  source = "hy_smi"
  interval = "15s"
  timeout = "10s"
  measurement_name = "hy_smi"
  keep_exist_metric_name = true
  metric_name_filter = ["^hy_smi_"]
  election = false

  [inputs.prom.tags]
    service = "hygon_dcu"
    env = "<env>"

重启 DataKit

datakit service -R

指标

指标集:hy_smi。

MetricName MetricDescribe Dimensions Unit
hy_smi_bad_pages_retired_total 加速卡累计已退役坏页数量 gpu, host, instance, service, env -
hy_smi_boost_level_info 加速卡当前 Boost 加速等级信息,值恒为 1,等级记录在 level 标签中 gpu, level, host, instance, service, env -
hy_smi_clock_hertz 加速卡各时钟域当前运行频率(sclk/mclk/socclk) domain, gpu, host, instance, service, env Hz
hy_smi_clock_max_hertz 加速卡支持的最大时钟频率上限(sclk) domain, gpu, host, instance, service, env Hz
hy_smi_clock_min_hertz 加速卡支持的最低时钟频率下限(sclk) domain, gpu, host, instance, service, env Hz
hy_smi_cu_utilization_ratio 加速卡计算单元(CU)波前利用率比例(0–1) gpu, host, instance, service, env -
hy_smi_devices 最近一次成功采集发现的海光加速卡设备总数 host, instance, service, env -
hy_smi_df_bandwidth_mbytes_per_second 加速卡 Data Fabric(DF)片上互联读写带宽 gpu, host, instance, service, env MB/s
hy_smi_ecc_correctable_errors_total 加速卡累计可纠正 ECC 错误次数 gpu, host, instance, service, env -
hy_smi_ecc_uncorrectable_errors_total 加速卡累计不可纠正 ECC 错误次数 gpu, host, instance, service, env -
hy_smi_gtt_total_bytes 加速卡 GTT(图形转换表)内存总容量 gpu, host, instance, service, env B
hy_smi_gtt_used_bytes 加速卡已使用 GTT 内存容量 gpu, host, instance, service, env B
hy_smi_hcu_utilization_ratio 加速卡 HCU 核心活跃时间利用率比例(0–1) gpu, host, instance, service, env -
hy_smi_health_info 加速卡健康检查状态信息,值恒为 1,状态记录在 level 标签中 gpu, level, host, instance, service, env -
hy_smi_info 加速卡身份与固件信息,值恒为 1,型号、序列号、驱动、健康状态、运行模式及 VBIOS 记录在标签中 bus, device_id, driver, gpu, hcu, health, mode, product_name, serial, unique_id, vbios, host, instance, service, env -
hy_smi_memory_utilization_ratio 加速卡显存控制器活跃利用率比例(0–1) gpu, host, instance, service, env -
hy_smi_pcie_bandwidth_mbytes_per_second 加速卡 PCIe 链路收发总带宽 gpu, host, instance, service, env MB/s
hy_smi_pcie_link_speed_gts 加速卡当前 PCIe 链路传输速率 gpu, host, instance, service, env GT/s
hy_smi_pcie_link_width 加速卡当前 PCIe 链路通道宽度(Lanes) gpu, host, instance, service, env -
hy_smi_performance_level_info 加速卡当前 DPM 电源性能等级信息,值恒为 1,等级记录在 level 标签中 gpu, level, host, instance, service, env -
hy_smi_power_cap_watts 加速卡当前配置的封装功耗上限 gpu, host, instance, service, env W
hy_smi_power_max_watts 加速卡允许的最大封装功耗上限 gpu, host, instance, service, env W
hy_smi_power_watts 加速卡当前平均封装功耗 gpu, host, instance, service, env W
hy_smi_ras_errors_total 加速卡累计 RAS 错误总数 gpu, host, instance, service, env -
hy_smi_temperature_celsius 加速卡各位置传感器温度(edge/junction/mem) gpu, sensor, host, instance, service, env °C
hy_smi_umc_bandwidth_mbytes_per_second 加速卡统一内存控制器(UMC)读写带宽 gpu, host, instance, service, env MB/s
hy_smi_up 最近一次 hy-smi 采集是否成功(1 为成功,0 为失败) host, instance, service, env -
hy_smi_voltage_volts 加速卡核心电压轨读数 gpu, rail, host, instance, service, env V
hy_smi_vram_available_bytes 加速卡当前可用显存(VRAM)容量 gpu, host, instance, service, env B
hy_smi_vram_total_bytes 加速卡显存(VRAM)总容量 gpu, host, instance, service, env B
hy_smi_vram_used_bytes 加速卡当前已使用显存(VRAM)容量 gpu, host, instance, service, env B
hy_smi_vram_utilization_ratio 加速卡显存(VRAM)使用率比例(0–1) gpu, host, instance, service, env -
hy_smi_wave_utilization_ratio 加速卡计算单元波前驻留率比例(0–1) gpu, host, instance, service, env -
hy_smi_xhcl_bandwidth_mbytes_per_second 加速卡卡间高速互联(XHCL/HSL)带宽 gpu, host, instance, service, env MB/s

文档评价

文档内容是否对您有帮助?