SuperAPI AI Directory

ascend-mmlab-install-suite

Deployment & operations

View repository

Updated 10-24 04:38

About this skill

ascend-mmlab-install-suite

Features

Install the OpenMMLab series libraries in the Ascend NPU container environment, supporting:

  • mmcv (computer vision foundation library)
  • mmdet (object detection library)
  • mmdet3d (3D object detection library)
  • detectron2 (Facebook's detection and segmentation library)

Runtime Environment

  • Target environment: Ascend NPU container (Linux)
  • Client:Windows/macOS/Linux
  • Network: Requires access to GitHub/Gitee

Modules

  • mmcv: Compile and install mmcv-full (including NPU operators) → mmcv/SKILL.md
  • mmdet: Install mmdetection → mmdet/SKILL.md
  • mmdet3d: Install mmdetection3d (including mmsegmentation dependency) → mmdet3d/SKILL.md
  • detectron2: Install detectron2 from source (NPU-compatible) → detectron2/SKILL.md

Configuration

Required information (must be confirmed with the user)

  1. Target server information:

    • Server address/SSH connection method
    • Container name or ID
    • Working directory mount path (e.g. /home/zqq)
  2. conda environment:

    • Environment name (e.g. torch2.1.0_py38)
    • Python version
    • PyTorch version
  3. Network situation:

    • Whether a proxy is available
    • Whether the GitHub connection times out

Optional information

  1. patch file location: Configuration file path in DrivingSDK
  2. Installation order: Adjusted according to user requirements

Prerequisite third-party library dependencies

Before installing the OpenMMLab libraries, the prerequisite dependency packages need to be installed. Select the corresponding requirements file according to the target PyTorch version:

PyTorch version requirements file
torch 2.1.x requirements.txt
torch 2.6.0 requirements_pytorch2.6.0.txt
torch 2.7.1 requirements_pytorch2.7.1.txt
torch 2.7.1 (Ascend NPU) requirements_pytorch2.7.1_a5.txt

File location reference:DrivingSDK/model_examples/BEVFormer/requirements*.txt

Installation method:

pip install -r /path/to/requirements_xxx.txt

Key principles

⚠️ Important: Do not install OpenMMLab libraries directly with pip

It is strictly forbidden to use pip install mmcv-full or similar methods to install directly, because:

  1. The patch files provided by DrivingSDK contain NPU adaptation modifications; direct installation will cause the patches to fail to apply
  2. The source installation + patch application method must be used

Correct process:

  1. Try to git clone the repository directly; if it times out, proceed to the next step
  2. git clone the repository locally (using a mirror or direct clone)
  3. Transfer to the server via scp
  4. Apply the patch files in DrivingSDK
  5. Compile and install

NPU environment check

Verification is required after installation:

python -c "import site; print([p for p in site.getsitepackages() if 'cuda' in p.lower()])"

If CUDA-related path output appears, it means the CUDA version was installed and needs to be reinstalled.

Network strategy

Situation Strategy
The server can connect directly to GitHub normally git clone directly on the server
The server network times out Clone locally → transfer to the server via scp
A proxy is available Operate after configuring the proxy

Dependencies

mmcv (基础)
  ├── mmdet
  ├── mmdet3d → 依赖 mmsegmentation
  └── detectron2

Decision guidance

Ask the user to confirm:

  1. Which conda environment should be used?
  2. How is the server's network situation? (Can it access GitHub directly?)
  3. Do all libraries need to be installed? Or specific libraries?
  4. Patch file location? (e.g., if using DrivingSDK)

Pre-installation checks:

  1. Confirm the target environment is NPU rather than CUDA
  2. Check whether torch_npu is already installed
  3. Confirm the working directory is writable