用途:npu-smi 是华为昇腾 NPU 设备管理命令行工具,用于查询设备状态、调整配置、升级固件、管理 vNPU 与证书。
主要能力: 查询:npu-smi info -l 列出设备;-t health -i <id> 健康状态;-t board/-t npu/-m 板卡与芯片信息;-t temp/-t power/-t memory -i <id> -c <chip> 实时温度、功耗、内存;info proc 查看进程;-t ecc、-t usages、-t pcie-info、-t p2p、-t product 查询 ECC、利用率、PCIe、P2P、产品序列号。 配置:set -t temperature/-t power-limit 设置温度与功耗阈值;set -t ecc-mode/-t compute-mode/-t persistence-mode/-t p2p-mem-cfg 设置模式;set -t pwm-mode/-t pwm-duty-ratio 风扇控制;set -t mac-addr/-t boot-select/-t cpu-freq-up/-t sys-log-enable 系统设置;clear -t ecc-info 清除 ECC 错误。 固件:流程为查询→升级→查状态→激活→重启。npu-smi upgrade -b 查版本,-t -f <file.hpm> 上传,-q 查状态,-a 激活。MCU/引导需重启,VRD 需断电 30 秒以上。 虚拟化:info -t vnpu-mode/template-info/info-vnpu 查询;set -t vnpu-mode 设置 AVI 模式,-t create-vnpu 创建,-t destroy-vnpu 销毁;vNPU ID 范围为 [phy_id16+100, phy_id16+115]。 证书:info -t tls-csr-get 生成 CSR,-t tls-cert 查看,-t tls-cert-period 查阈值,-t rootkey 查根密钥;set -t tls-cert 设置证书,-t tls-cert-period -s <days> 设阈值(7-180 天),clear -t tls-cert-period 恢复默认 90 天。
使用方式:设备 ID 从 npu-smi info -l 获取,芯片 ID 从 npu-smi info -m 获取;大多数配置命令需要 root 权限;MAC、引导变更后需重启;芯片名(如 910B3)不能代表服务器平台,可用 dmidecode -t system | grep Product 或 npu-smi info -t product 识别。
适用平台:Atlas 200I DK A2、Atlas 500 A2、Atlas 200I A2、Atlas A2/A3 训练系列等。
限制:命令可用性因硬件平台而异;升级相关操作需按重启或断电要求执行。更多输出格式与脚本参见 references 目录。官方文档:https://www.hiascend.com/document/detail/zh/canncommercial/81RC1/envdeployment/instg/instg_0045.html