Exports and configures Device-side system logs and diagnostic info for Ascend EP devices using msnpureport. Supports one-time/permanent log export, querying/setting log levels, Coremask, accelerator reset, singlecommit, AI Core/Vector Core masking, and icache check.
Ships in cann-tools-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
导出 Device 侧系统类日志与维测信息,并查询/设置 Device 侧维测配置。工具随昇腾驱动包部署,路径为 {Driver安装目录}/driver/tools/msnpureport,驱动部署完成后可在任意目录执行。
| 项 | 要求 |
|---|---|
| 产品形态 | 仅适用于 Ascend EP 形态;昇腾虚拟化实例场景不支持 |
| 用户权限 | 导出类与所有 config --set 类命令仅支持 root 用户执行;查询类命令普通用户可执行(驱动需以 --install-for-all 安装) |
| 执行目录 | 不要在加锁目录下执行(lsattr 显示 i 属性即加锁)。导出目录须对普通用户无访问权限,否则存在日志被删除或系统信息泄露风险 |
| 容器场景 | 需加 --docker 参数,并配置 export PATH=/usr/local/Ascend/driver/tools:$PATH。非特权容器仅支持导出 Host 侧驱动内核日志;连续导出不支持 |
| Device ID | 命令中的 -d/--device 均为逻辑 ID,非 npu-smi info 显示的物理 ID |
环境自检:bash scripts/preflight.sh
| 场景 | 命令 | 详细参考 |
|---|---|---|
| 复现后一次性收集日志 | msnpureport report | export-one-time.md |
| 任务运行前布防,持续收集 | msnpureport report --permanent | export-permanent.md |
| 查询当前 Device 维测配置 | msnpureport config --get | config-query.md |
| 调整 Device 日志级别 | msnpureport config --set --log ... | config-set-log.md |
| AI Core 故障定位(复位/串行/屏蔽核/icache) | msnpureport config --set ... | config-set-aicore.md |
| 调整工具自身日志级别与打屏 | msnpureport report --print/--log_level | tool-log-config.md |
| 脚本方式连续导出(旧方式) | msnpureport_auto_export.sh | auto-export-script.md |
| 看不懂导出目录 | — | output-layout.md |
产品支持差异见 product-support.md,常见问题见 troubleshooting.md。
# 子命令与帮助
msnpureport help # 总帮助
msnpureport config --help # config 子命令帮助
msnpureport report --help # report 子命令帮助
msnpureport version # 版本信息
# 单次导出(先 cd 到已创建的存放目录,如 /var/log/npu/report)
msnpureport report # 默认集合:系统类日志 + 调用栈 + 黑匣子 + 事件调度 + Host内核日志 + Device OS日志
msnpureport report -d 0 # 指定 Device 逻辑 ID
msnpureport report -a # 追加黑匣子设备事件信息
msnpureport report -f # 再追加黑匣子存储空间历史维测信息(最全)
msnpureport report -t 2 # 只导黑匣子相关(含寄存器信息,不支持多进程并发)
msnpureport report -t 3 # 只导 coredump 调用栈
# 连续导出(root,任务启动前执行,Ctrl+C 或 kill -15 <pid> 结束)
msnpureport report --permanent
msnpureport report --permanent -d 0 -o mypath
# 查询配置
msnpureport config --get # 全量配置(日志级别 + Coremask + 复位 + singlecommit + icache)
msnpureport -r # 仅查日志级别(旧方式)
# 设置 Device 日志级别
msnpureport config --set --log -g info # 全局级
msnpureport config --set --log -m CCE:debug # 模块级
msnpureport config --set --log -e enable # Event 日志开关
导出前准备:先创建专用目录(如 /var/log/npu/report)并 cd 进去,导出内容落在当前目录下以时间戳命名的文件夹中。同一路径不要并发导出,否则时间戳目录名冲突;单次导出多进程建议不超过 4 个。
导出不全时改用连续导出:任务运行时间过长导致 Device 侧日志被老化、或 Device 异常导致无法导出,都会造成日志缺失。这种情况在任务启动之前用 --permanent 常驻导出,可拿到异常前的完整日志。
config --set 类命令有副作用,执行前必须确认:
--accelerator_recover 0、--aic_switch 0、--aiv_switch 0、--singlecommit 1 均为定位用临时配置,会影响性能或业务可用性,定位完成后必须及时恢复;其中 --accelerator_recover 0 需重启运行环境才能恢复 AI Core 业务。Device ID 语义按产品区分:Ascend 950PR/950DT 的导出目录中 Device ID 为逻辑 ID;Atlas A3/A2/训练/推理系列及 Atlas 200I/500 A2 为物理 ID。SMP 工作模式下多个 Device 共用一个 OS,指定组内任一 Device ID 会导出该 OS 下所有 Device 日志,且同一 OS 内不支持多个导出进程并发。
关联工具:stackcore/、ub_info/ 下的文件需用 asys 工具解析;黑匣子导出卡住或过慢时,用 npu-smi set -t reset -i <id> -c <chip_id> 复位芯片后重新导出。
本技能内容来自 CANN 社区仓 cann/driver 的 docs/zh/msnpureport 官方文档。命令输出示例因版本而异,请以环境实际输出为准。
evals/evals.json (opens in a new tab)references/auto-export-script.md (opens in a new tab)references/config-query.md (opens in a new tab)references/config-set-aicore.md (opens in a new tab)references/config-set-log.md (opens in a new tab)references/export-one-time.md (opens in a new tab)references/export-permanent.md (opens in a new tab)references/output-layout.md (opens in a new tab)references/product-support.md (opens in a new tab)references/tool-log-config.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)scripts/preflight.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/asys-toolkitCANN 一键式故障信息收集工具 asys 使用指导。覆盖故障信息收集(collect)、业务复跑收集(launch)、软硬件与 Device 状态查询(info)、健康检查(health)、综合检测与组件检测(diagnose)、trace/coredump/stackcore/coretrace/UB/AI Core Error 六类文件解析(analyze)、实时堆栈导出、环境配置(config)、性能数据采集(profiling)。触发场景:需要收集 NPU 故障维测信息、训练或推理进程卡死要导出堆栈、Segmentation fault 要解析 coredump、日志出现 aivec/aicore error exception、排查 Device 健康状态与故障码、做 HBM/CPU/AI Core 硬件检测、或用 asys 采集系统级性能数据时。/msaicerr-toolkitmsaicerr 工具使用技能。用于:(1) 分析 AI Core Error 问题的故障信息,输出 info.txt 辅助定位,(2) 将 Dump 文件解析为 .bin/.npy 文件(算子输入、输出、workspace),(3) 转换 *.bin 格式 Dump 文件的数据类型为 .npy,(4) 运行内置算子样例检查软硬件环境,(5) 排查工具本身的执行约束与不支持算子清单。触发关键词:msaicerr、msaicerr.py、aicore error、aivec error、there is an aicore error、AI Core Error 分析、解析Dump文件、Dump文件转换、bin转npy、dest_dtype、bfloat16ext、exception_info、data-dump、report_path、内置算子样例、检查昇腾环境、debug_info.txt、info.txt。//cann-tools-skills:msnpureport-toolkitfrom cann-tools-skills
npx claudepluginhub catman626/cannbot-skills --plugin cann-tools-skillsOther plugins' skills for the same job