Compiles and installs mmcv-full with NPU operator support in an Ascend NPU container. Prerequisite for OpenMMLab libraries that depend on mmcv.
Ships in external-gitcode-ascend-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.
None: SKILL.md is the whole skill.
在昇腾NPU容器中编译安装mmcv-full(含NPU算子支持)
根据目标 PyTorch 版本安装前置依赖:
source /opt/conda/bin/activate <conda-env-name>
# 根据版本选择对应的 requirements 文件
pip install -r /path/to/DrivingSDK/model_examples/BEVFormer/requirements.txt
# 或 requirements_pytorch2.6.0.txt / requirements_pytorch2.7.1.txt 等
询问用户使用的conda环境名称
根据网络情况选择:
服务器直连正常:
git clone -b 1.x https://github.com/open-mmlab/mmcv.git
服务器网络超时:配置代理或本地克隆后scp传输
# 方案1:配置代理
export http_proxy=http://proxy:port
export https_proxy=http://proxy:port
git clone -b 1.x https://github.com/open-mmlab/mmcv.git
# 方案2:本地克隆后传输(仍使用GitHub链接)
# 本地执行
git clone -b 1.x https://github.com/open-mmlab/mmcv.git
scp -r mmcv user@server:/target/path/
重要:始终使用GitHub官方链接,不使用镜像站点。
从DrivingSDK复制patch并应用:
cd mmcv
cp /path/to/DrivingSDK/model_examples/BEVFormer/mmcv_config.patch .
git apply --reject mmcv_config.patch
source /opt/conda/bin/activate <conda-env-name>
pip install -r requirements/runtime.txt
pip install ninja
MMCV_WITH_OPS=1 MAX_JOBS=8 FORCE_NPU=1 python setup.py build_ext
MMCV_WITH_OPS=1 FORCE_NPU=1 python setup.py develop
python -c "import mmcv; print(mmcv.__version__)"
NPU验证:确认没有CUDA依赖
python -c "import site; print([p for p in site.getsitepackages() if 'cuda' in p.lower()])"
# 应输出空列表
| 变量 | 说明 |
|---|---|
| MMCV_WITH_OPS=1 | 编译NPU算子 |
| FORCE_NPU=1 | 强制使用NPU后端 |
| MAX_JOBS=8 | 并行编译任务数 |
pip install numpy==1.23.5向用户提问:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ascend-npu, mmcv-install, openmmlab, npu-compilation, container-setup
/external-gitcode-ascend-skills:external-gitcode-ascend-mmcvfrom external-gitcode-ascend-skills
npx claudepluginhub ascend-ai-coding/awesome-ascend-skills --plugin external-gitcode-ascend-skills91 skills in this plugin
/external-gitcode-ascend-analyse-coverage分析测试覆盖率盲区,生成覆盖率分析报告/external-gitcode-ascend-arxiv-recommendation-npu自动化推荐系统论文发现流水线。抓取 arxiv 推荐论文,检测源码,生成待迁移任务清单,由 npu-model-migration skill 完成 NPU 适配。/external-gitcode-ascend-ascendc-operator-code-gen根据设计文档生成 AscendC 算子完整代码实现并完成框架适配。TRIGGER when: 设计文档已完成,需要生成 op_host/op_kernel 代码、注册到 PyTorch 框架、编译测试。关键词:代码生成、op_host、op_kernel、tiling、kernel、框架适配、算子注册。Other plugins' skills for the same job