Guides usage of the CANN asys tool for Ascend NPU fault diagnosis: collect logs, export stacks on hang, parse coredumps/traces, check device health, diagnose hardware, and profile performance.
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.
asys 是 CANN 提供的一键式故障信息收集工具,用于提高系统故障维测效率。
形态限制:asys 仅支持在 Ascend EP 形态下使用,RC 形态不支持。使用前先确认,避免在不支持的环境上白跑。
前提是已在 CANN 运行环境上安装 Toolkit 软件包。以 CANN 运行用户登录环境后设置环境变量:
source ${INSTALL_DIR}/set_env.sh
${INSTALL_DIR} 替换为 CANN 软件安装路径。以 root 用户安装为例,默认路径为 /usr/local/Ascend/cann。
设置环境变量后可直接输入 asys 命令,无需进入工具所在目录。
# 定位 asys 并检查依赖是否就绪
bash scripts/find_asys.sh
按现场症状选命令,不确定时从 asys collect 起步。
| 现场症状 | 命令 | 详细文档 |
|---|---|---|
| 需要打包一份完整维测信息交付分析 | asys collect | collect-and-launch.md |
| 问题可稳定复现,想连带复跑一起收集 | asys launch --task=... | collect-and-launch.md |
| 训练/推理进程卡住不退出 | asys collect -r=stacktrace | collect-and-launch.md |
日志或屏幕出现 there is an aivec error exception / there is an aicore error exception | asys analyze -r=aicore_error | analyze-files.md |
进程中断退出并报 Segmentation fault | asys analyze -r=coredump | analyze-files.md |
拿到 stackcore_*.txt / coretrace.* / trace *.bin / UB *.bin 要解析 | asys analyze -r=stackcore|coretrace|trace|ub | analyze-files.md |
| 怀疑 Device 不健康、要看故障码 | asys health | info-and-health.md |
| 要看芯片型号、温度、功耗、HBM、AI Core 利用率 | asys info -r=status | info-and-health.md |
| 要确认 CANN 包版本、系统内核、硬件规格 | asys info -r=software|hardware | info-and-health.md |
| 怀疑硬件故障(AI Core / HBM / CPU / AI Core STL / AI Vector) | asys diagnose -r=... | diagnose-and-config.md |
| 压测异常退出后电压未恢复 | asys config --restore --stress_detect | diagnose-and-config.md |
| 要采集 AI Core / 内存 / 带宽 / 功耗性能数据 | asys profiling | profiling.md |
| 复跑报错、堆栈导出超时 | — | faq.md |
参数风格统一:-r= 指定模式,--output= 指定输出目录前缀。
asys
├── collect 收集故障信息(-r=stacktrace 时为实时堆栈导出)
├── launch 复跑业务 + 收集故障信息
├── info 软硬件与 Device 状态展示(-r=status|software|hardware)
├── health Device 健康检查
├── diagnose 综合检测与组件检测
│ (-r=stress_detect|hbm_detect|cpu_detect|aicore_stl_detect|component)
├── analyze 文件解析
│ (-r=trace|coredump|stackcore|coretrace|ub|aicore_error)
├── config 环境配置获取与恢复(--get / --restore)
└── profiling 性能数据采集
# 1. 不复跑,直接收集环境上的软硬件信息与日志,并打包
asys collect --tar="True" --output=$HOME/dfx_info
# 2. 复跑业务并收集(默认开启算子编译文件、GE dump 图收集)
asys launch --task="sh ../run.sh" --tar="True" --output=$HOME/dfx_info
# 3. AI Core Error 故障解析
asys analyze -r=aicore_error --path=${HOME}/aic_err_info_timestamp
--output 是路径前缀,不是最终目录:
| 子命令 | 最终目录 |
|---|---|
collect / launch / analyze | {output}/asys_output_timestamp |
diagnose | {output}/diagnose_result_{time_stamp}.txt |
profiling | {output}/asys_profiling_result_timestamp |
不带 --output 时结果落在命令执行目录(diagnose 与 component 检测则只在终端显示、不落盘)。取值为空、为无效字符串、目录无写权限或创建失败时,asys 退出执行并报错。
ASCEND_PROCESS_LOG_PATH、NPU_COLLECT_PATH、DUMP_GRAPH_PATH、ASCEND_WORK_PATH、ASCEND_CACHE_PATH、ASCEND_CUSTOM_OPP_PATH,取值不一致时收集到的信息可能不准确。diagnose 与 config 必须在物理机且 root 用户下执行。$HOME/ascend/atrace/。完整约束、产品支持矩阵、外部依赖(gdb / readelf / addr2line)见 constraints.md。
并非所有功能全系列可用,在不支持的型号上执行会白跑:
| 功能 | Atlas A3 / A2 系列 | Atlas 200I/500 A2 推理、Atlas 推理/训练系列 |
|---|---|---|
collect / launch / info / health | 支持 | 支持 |
analyze -r=trace|coredump|stackcore|ub|aicore_error | 支持 | 支持 |
diagnose -r=component | 支持 | 支持 |
diagnose(综合检测) | 支持 | 不支持 |
config / profiling | 支持 | 不支持 |
analyze -r=coretrace | 不支持 | 不支持 |
diagnose -r=aicore_stl_detect | 不支持 | 不支持 |
coretrace 解析与 AI Core STL 检测仅支持 Ascend 950PR / Ascend 950DT。
| 文档 | 内容 |
|---|---|
| collect-and-launch.md | collect、launch、实时堆栈导出的参数、产物结构、asys.ini 配置 |
| info-and-health.md | info 三种信息类型、health 状态与故障级别映射 |
| diagnose-and-config.md | 压力 / HBM / CPU / AI Core STL / 组件检测,电压获取与恢复 |
| analyze-files.md | trace / coredump / stackcore / coretrace / UB / aicore_error 六种解析 |
| profiling.md | -r 采集类型、--aic_metrics PMU 类型 |
| constraints.md | 使用约束、产品支持矩阵、外部依赖、环境变量清单 |
| faq.md | 复跑报错、实时堆栈导出超时的定位方法 |
| 脚本 | 用途 |
|---|---|
scripts/find_asys.sh | 定位 asys 可执行文件,检查 EP 形态、外部依赖与关键环境变量 |
本 skill 是 asys 命令与参数的真源,其他 skill 需要 asys 用法时引用本 skill,不要复制命令细节。
ascendc-env-check:npu-smi 不可用时的设备查询回退,回退命令引用本 skill。ascendc-crash-debug:卡死/崩溃调试流程,堆栈与 coredump 解析步骤引用本 skill。ops-profiling:算子性能采集主路径是 msprof;asys profiling 是系统级周期采样,定位不同。tool-msnpureport: Device 侧 stackcore、coretrace、UB 文件的导出工具,是本 skill 解析功能的上游。命令、参数、约束与输出示例均来自 CANN oam-tools 开源仓 docs/zh/asys(19 个文档)。开源仓与商用版文档存在差异时以开源仓为准。文档中未给出的行为不做推断。本 skill 内容未在真实昇腾环境上实跑验证。
evals/evals.json (opens in a new tab)references/analyze-files.md (opens in a new tab)references/collect-and-launch.md (opens in a new tab)references/constraints.md (opens in a new tab)references/diagnose-and-config.md (opens in a new tab)references/faq.md (opens in a new tab)references/info-and-health.md (opens in a new tab)references/profiling.md (opens in a new tab)scripts/find_asys.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ascend, npu, fault-diagnosis, coredump-analysis, device-health
8 skills in this plugin
/npu-objdump-toolkit使用 npu-objdump/msobjdump 分析 Ascend 算子编译产物。触发:查看元数据、提取 device ELF、反汇编 AIC/AIV 指令,或结合报错日志中的异常 PC 定位指令时。/tool-aml为 oam-tools-diag 的 AICore STL 诊断模块(aicore_stl_detect)新增算子的工具。当用户提供形态(Ascend950/Ascend960DT)、算子类型(aic/aiv/mix)、算子名、aic/aiv kernel cce 代码,以及每个输入的 size/填充方式/dtype 和每个输出每 block 的 size 时,自动生成 ops/<算子名>/ 下的 .cpp(host 规格+下发+注册)、.asc(kernel 下发包装)与 aic_/aiv_*.cce 文件,并完成 host so 编译与注册校验。触发场景:为 aicore_stl_detect 模块新增、修改或校验 STL 算子。/tool-exception-dump昇腾 NPU AI Core Error 系统化诊断工作流:环境与输入检查、故障信息收集、场景判定与报错行定位、错误类型识别、单算子复现、证据链汇聚与修复建议,基于 msaicerr/asys 官方工具管线执行与判读,输出六段式证据链诊断报告。
Use when(满足任一强信号即触发):当用户提到 aicore error、aivec error、AI Core Error、AI Core 异常、核错误、算子报错;越界、野指针、内存踩踏、地址非法;exception dump 解析、plog、故障日志收集、asys collect、msaicerr -p/-d/-e;报错行定位、错误码定位、寄存器解码、结论码 101-107;单算子复现、最小复现、根因分析;Kernel 报错调试。即使只是询问某报错是否为 AI Core Error 也应使用本技能。
Do NOT use:仅询问 msaicerr/asys 工具用法与参数细节(转 tool-msaicerr、tool-asys 技能);GE/图编译层问题(转 graph/ 域技能);算子精度不达标(转 ascendc-precision-debug);AI CPU Error、HCCL 等其他错误类型(不在覆盖范围,说明后指路)。
/cann-tools-skills:tool-asysfrom cann-tools-skills
npx claudepluginhub hicann/cannbot-skills --plugin cann-tools-skillsOther plugins' skills for the same job