Container Startup

  1. After the image is downloaded, run the following commands to start the container:
    docker run -it -d --net=host --shm-size=1g \
           --name <container-name> \
           -w /home \
           --device=/dev/davinci0:rwm \
           --device=/dev/davinci1:rwm \
           --device=/dev/davinci2:rwm \
           --device=/dev/davinci3:rwm \
           --device=/dev/davinci_manager:rwm \
           --device=/dev/hisi_hdc:rwm \
           --device=/dev/devmm_svm:rwm \
           -v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro \
           -v /usr/local/dcmi:/usr/local/dcmi:ro \
           -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi:ro \
           -v /usr/local/sbin/:/usr/local/sbin:ro \
           -v /path-to-weights:/path-to-weights:ro \
           mindie:2.3.0-800I-A2-py311-openeuler24.03-lts bash
    • mindie:2.3.0-800I-A2-py311-openeuler24.03-lts is the image name, which can be changed as required.
    • The mount permission corresponding to the --device parameter is set to rwm instead of rw or r (with lower-level permission), for the following reasons:
      • For the Atlas 800I A2 inference server, if the mount permission is set to rw, you can access the container, run the npu-smi command to view the NPU usage, and run the MindIE service. However, if the mounted NPU (corresponding to davincixxx in the mount options, for example, npu0 corresponds to davinci0) is occupied by other tasks, an error is reported when you run the npu-smi command, and the MindIE task cannot be executed (torch.npu.set_device() fails).
      • For the Atlas 800I A3 SuperPoD Server, if the mount permission is set to rw, an error is reported when you run the npu-smi command after accessing the container, and the MindIE task cannot be executed (torch.npu.set_device() fails).
    Table 1 Parameters

    Parameter

    Description

    --name

    Assigns a name to the container. <container-name> indicates the identifier of the container. You can set it as required. It must be unique in the current system. If this parameter is not set, Docker automatically assigns a random name.

    --device

    Indicates the mapped device. One or more devices can be mounted.

    Devices to be mounted include:

    • /dev/davinciX: NPU device. X indicates the ID, for example, davinci0.
    • /dev/davinci_manager: Da Vinci-related management device.
    • /dev/hisi_hdc: HDC-related management device.
    • /dev/devmm_svm: Memory-related management device.
    NOTE:

    You can run the following command to query the number and names of devices. Change --device=**** as required.

    ll /dev/ | grep davinci

    -v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro

    Mounts the host directory /usr/local/Ascend/driver to the container. Change it according to the actual driver path.

    -v /usr/local/sbin/:/usr/local/sbin:ro

    Mounts the host tool /usr/local/sbin to the container in read-only mode. Change it as required.

    -v /path-to-weights:/path-to-weights:ro

    Sets the weight mounting path as required.

    NOTE:

    Place the weight file and dataset file in this path.

  2. Access the container.
    1
    docker exec -it <container-name> /bin/bash
    

For more information, see the section about starting a container.