Use in Containers
- To use the Ascend-DMI tool in a container, run the following commands to start the container:
docker run --rm \ --device=/dev/davinci0 \ --device=/dev/davinci1 \ --device=/dev/davinci2 \ --device=/dev/davinci3 \ --device=/dev/davinci_manager \ --device=/dev/hisi_hdc \ --device=/dev/devmm_svm \ -v /usr/local/dcmi:/usr/local/dcmi:ro \ -v /usr/local/Ascend/nnae:/usr/local/Ascend/nnae:ro \ -v /usr/local/Ascend/nnrt:/usr/local/Ascend/nnrt: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 mount 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.
- If the Atlas 200I SoC A1 core board needs to use the Ascend-DMI tool in a container, build a container and then mount the following directories during container startup by referring to "Installation in a Container > Host Directories Mounted to a Container" in the Atlas 200I SoC A1 Core Board 6.0.0 NPU Driver and Firmware Installation Guide.
-v /usr/local/Ascend/nnae:/usr/local/Ascend/nnae:ro \ -v /usr/local/Ascend/nnrt:/usr/local/Ascend/nnrt: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 /etc/Ascend/ascend_cann_install.info:/etc/Ascend/ascend_cann_install.info:ro \
- After the mounting is complete, configure environment variables in the container. For details, see Environment Requirements.
Parent topic: Preparations