SuperAPI AI Directory

external-cannbot-ops-ascendc-env-check

General & other

View repository

Updated 10-15 17:19

About this skill

Ascend C Environment Check

Quickly check development environment configuration and NPU device status.

Workflow

环境检查
    │
    ├─ NPU 设备检查
    │   └─ npu-smi list / scripts/npu_info.sh
    │
    └─ CANN 环境检查
        └─ scripts/check_env.sh

NPU Device Check

Quick Commands

# 查看设备详细信息(包含设备列表)
npu-smi info

# 监控设备资源
npu-smi top

Script Tools

# 综合 NPU 信息(推荐)
bash scripts/npu_info.sh

For detailed command parameters, see npu_commands.md; for fallback solutions when npu-smi is unavailable, see asys_commands.md

CANN Environment Check

# 完整环境检查(推荐)
bash scripts/check_env.sh

Check Items

Check Item Description Required
ASCEND_HOME_PATH CANN Toolkit path Yes
CANN version Detect version number and runtime dependency baseline Confirm recommended
ASCEND_OPP_PATH CANN Ops path Required at runtime
Custom operator package op_api library Required to run custom operators
CANN tools msprof/cannsim Optional

⚠️ Note: The official environment variable is ASCEND_HOME_PATH, not ASCEND_HOME. Some old documents or sample code may use ASCEND_HOME, which is incorrect usage.

For detailed environment configuration, see env_config_guide.md; for version compatibility relationships, see the "CANN Version Compatibility" chapter therein

Diagnostic Scripts

Script Purpose
scripts/npu_info.sh Comprehensive query of NPU device information
scripts/check_env.sh CANN environment configuration check

Common Issues

  • NPU not visible: Check whether npu-smi list can recognize the device
  • Operator run failure: Preferentially run check_env.sh to check environment configuration
  • Confirm whether any process is occupying the NPU: Use npu-smi info -t usages -i <device_id> to view running processes; note that idle devices will still have a small amount of HBM occupied by the driver (normal phenomenon), which should not be misjudged as the device being occupied

For detailed troubleshooting, see troubleshooting.md