Use in Containers

  1. To use MindCluster ToolBox in a container, run the following commands to start the container as required:
    docker run --rm \
    --device=/dev/davinci0:/dev/davinci0:rwm \
    --device=/dev/davinci1:/dev/davinci1:rwm \
    --device=/dev/davinci2:/dev/davinci2:rwm \
    --device=/dev/davinci3:/dev/davinci3:rwm \
    --device=/dev/davinci_manager:/dev/davinci_manager:rwm \
    --device=/dev/hisi_hdc:/dev/hisi_hdc:rwm \
    --device=/dev/devmm_svm:/dev/devmm_svm:rwm \ 
    -v /usr/local/dcmi:/usr/local/dcmi:ro \
    -v /usr/local/Ascend/cann:/usr/local/Ascend/cann:ro \
    -v /usr/local/Ascend/version.info:/usr/local/Ascend/version.info:ro \
    -v /usr/local/Ascend/toolbox:/usr/local/Ascend/toolbox:ro \
    -v /etc/ascend_install.info:/etc/ascend_install.info:ro \
    -v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro \
    -v /usr/local/Ascend/firmware:/usr/local/Ascend/firmware:ro \
    -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi:ro \
    -v /etc/Ascend/ascend_cann_install.info:/etc/Ascend/ascend_cann_install.info:ro \
    -it ubuntu:18.04 /bin/bash
    • Before mounting a Da Vinci device, run the ls /dev/ | grep davinci command to query the Da Vinci device, that is, davinciX. X indicates the Da Vinci device ID.
    • In the preceding commands, ubuntu:18.04 is the name:tag of the container image, which can be queried by running the docker images command and corresponds to the values of the REPOSITORY and TAG fields. If the container image does not have a name or tag, run the docker images command to query the image ID of the container image and use the ID to replace name:tag.
    • When using MindCluster ToolBox in a container on the Atlas 200I SoC A1 core board, first build a container and mount the following directories when starting the container:
      -v /usr/local/Ascend/version.info:/usr/local/Ascend/version.info:ro \
      -v /usr/local/Ascend/toolbox:/usr/local/Ascend/toolbox:ro \
      -v /etc/ascend_install.info:/etc/ascend_install.info:ro \
      -v /etc/Ascend/ascend_cann_install.info:/etc/Ascend/ascend_cann_install.info:ro \
    • For versions earlier than CANN 8.5.0, mount the following directories when starting containers for NNRT, NNAE, and toolkit:
      -v /usr/local/Ascend/nnae:/usr/local/Ascend/nnae:ro \
      -v /usr/local/Ascend/nnrt:/usr/local/Ascend/nnrt:ro \
      -v /usr/local/Ascend/ascend-toolkit:/usr/local/Ascend/ascend-toolkit:ro \
  2. After the mounting is complete, configure environment variables in the container. For details, see Environment Requirements.