skills/ascend-docker/SKILL.md
Create Docker containers for Huawei Ascend NPU development with proper device mappings and volume mounts. Use when setting up Ascend development environments in Docker, running CANN applications in containers, or creating isolated NPU development workspaces. Supports privileged mode (default), basic mode, and full mode with profiling/logging. Auto-detects available NPU devices.
npx skillsauth add Ascend/agent-skills ascend-dockerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create Docker containers configured for Huawei Ascend NPU development.
# Privileged mode (default, auto-detect all devices)
./scripts/run-ascend-container.sh <image> <container_name>
# Basic mode with specific devices
./scripts/run-ascend-container.sh <image> <container_name> --mode basic
# Full mode with selected devices
./scripts/run-ascend-container.sh <image> <container_name> --mode full --device-list "0,1,2,3"
The script auto-detects available NPU devices from /dev/davinci*. Use --device-list to select specific devices:
# Use all detected devices (default)
./scripts/run-ascend-container.sh <image> <container_name>
# Use specific devices
./scripts/run-ascend-container.sh <image> <container_name> --device-list "0,1,2,3"
# Use device range
./scripts/run-ascend-container.sh <image> <container_name> --device-list "0-3"
# Combine ranges and individual devices
./scripts/run-ascend-container.sh <image> <container_name> --device-list "0-3,7,10-11"
Check available devices:
ls /dev/davinci* | grep -oE 'davinci[0-9]+$'
Maximum permissions, suitable when no specific requirements.
docker run -itd --privileged --name=<CONTAINER_NAME> --ipc=host --net=host \
--device=/dev/davinci_manager \
--device=/dev/devmm_svm \
--device=/dev/hisi_hdc \
-v /usr/local/sbin:/usr/local/sbin:ro \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro \
-v /home:/home \
-w /home \
<IMAGE> \
/bin/bash
Specific device mapping with network host, for inference workloads.
docker run -itd --net=host \
--name=<CONTAINER_NAME> \
--device=/dev/davinci_manager \
--device=/dev/hisi_hdc \
--device=/dev/devmm_svm \
--device=/dev/davinci0 \
--device=/dev/davinci1 \
... \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro \
-v /usr/local/sbin:/usr/local/sbin:ro \
-v /etc/localtime:/etc/localtime \
-v /home:/home \
<IMAGE> \
/bin/bash
With profiling, logging, dump, and add-ons support.
docker run -itd --ipc=host \
--name=<CONTAINER_NAME> \
--device=/dev/davinci_manager \
--device=/dev/devmm_svm \
--device=/dev/hisi_hdc \
--device=/dev/davinci0 \
--device=/dev/davinci1 \
... \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
-v /usr/local/Ascend/add-ons/:/usr/local/Ascend/add-ons/ \
-v /usr/local/sbin/npu-smi:/usr/local/sbin/npu-smi \
-v /usr/local/sbin/:/usr/local/sbin/ \
-v /var/log/npu/conf/slog/slog.conf:/var/log/npu/conf/slog/slog.conf \
-v /var/log/npu/slog/:/var/log/npu/slog \
-v /var/log/npu/profiling/:/var/log/npu/profiling \
-v /var/log/npu/dump/:/var/log/npu/dump \
-v /var/log/npu/:/usr/slog \
-v /etc/localtime:/etc/localtime \
-v /home:/home \
<IMAGE> \
/bin/bash
| Feature | Privileged | Basic | Full | |---------|------------|-------|------| | Network mode | host | host | - | | IPC mode | host | - | host | | Device access | All (via privileged) | Selected devices | Selected devices | | Profiling support | ✓ | ✗ | ✓ | | Dump support | ✓ | ✗ | ✓ | | Logging (slog) | ✓ | ✗ | ✓ | | Security | Lowest | Higher | Higher |
| Device | Purpose |
|--------|---------|
| /dev/davinci_manager | NPU device manager |
| /dev/devmm_svm | Device memory management |
| /dev/hisi_hdc | HDC communication device |
| /dev/davinci<N> | Individual NPU devices (0, 1, 2, ...) |
| Volume | Purpose |
|--------|---------|
| /usr/local/Ascend/driver | Ascend driver libraries |
| /usr/local/sbin | NPU management tools (npu-smi) |
| /usr/local/Ascend/add-ons | Additional Ascend components |
| /var/log/npu/slog | System logs |
| /var/log/npu/profiling | Profiling data |
| /var/log/npu/dump | Dump data |
| /etc/localtime | Timezone sync |
| /home | User workspace |
ascendhub.huawei.com/public-ascendhub/ascend-pytorch:24.0.RC1
ascendhub.huawei.com/public-ascendhub/ascend-mindspore:24.0.RC1
ascendhub.huawei.com/public-ascendhub/ascend-toolkit:24.0.RC1
docker exec -it <container_name> bash
docker stop <container_name>
docker start <container_name>
docker rm -f <container_name>
For self-built images, configure environment variables:
echo 'source /usr/local/Ascend/ascend-toolkit/set_env.sh' >> ~/.bashrc
source ~/.bashrc
testing
Kubernetes 集群健康检查与安全修复 — 诊断问题,用户确认后执行修复
tools
昇腾NPU CANN Toolkit+Kernels+NNAL安装部署技能。支持从官网下载run包安装和从Docker镜像提取两种方式,覆盖驱动检查、包下载、安装、环境变量配置与验证全流程。当用户需要安装CANN全套组件或指定版本CANN到自定义路径时调用。
development
编译 ATB (Ascend Transformer Boost) 测试框架。当用户需要编译 ATB 测试框架、 运行 CSV 测试、或构建 atb_test_framework 时调用。支持全量编译(含第三方依赖克隆与源替换) 和增量编译两种模式。需在 Docker 容器内配合 CANN 环境执行。
databases
ATB OPS→ACLNN 迁移标准化工作流主模板。整合前置学习、设计文档生成、CSV用例设计、 实际迁移、编译验证、测试验证全流程,提供明确的阶段 Gates 和用户确认机制。