docker run -it -e ASCEND_VISIBLE_DEVICES=0 image-name:tag /bin/bash
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_OPTIONS=NODRV image-name:tag /bin/bash
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_MOUNTS=hostlog image-name:tag /bin/bash
docker run -it -e ASCEND_VISIBLE_DEVICES=100 -e ASCEND_RUNTIME_OPTIONS=VIRTUAL image-name:tag /bin/bash
docker run -it --rm -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_VNPU_SPECS=vir04 image-name:tag /bin/bash
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_ALLOW_LINK=True image-name:tag /bin/bash
ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin
Ascend Docker Runtime can be used to enable containers to run training, inference, or other jobs.
docker run -it -e ASCEND_VISIBLE_DEVICES=0 --device=/dev/xsmem_dev:rwm --device=/dev/event_sched:rwm --device=/dev/svm0:rwm --device=/dev/sys:rwm --device=/dev/vdec:rwm --device=/dev/vpc:rwm --device=/dev/log_drv:rwm --device=/dev/spi_smbus:rwm --device=/dev/upgrade:rwm --device=/dev/user_config:rwm --device=/dev/ts_aisle:rwm --device=/dev/memory_bandwidth:rwm -v /var/dmp_daemon:/var/dmp_daemon:ro -v /var/slogd:/var/slogd:ro -v /var/log/npu/conf/slog/slog.conf:/var/log/npu/conf/slog/slog.conf:ro -v /usr/local/Ascend/driver/tools:/usr/local/Ascend/driver/tools -v /usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64 -v /usr/lib64/aicpu_kernels:/usr/lib64/aicpu_kernels:ro -v /usr/lib64/libtensorflow.so:/usr/lib64/libtensorflow.so:ro -v /sys/fs/cgroup/memory:/sys/fs/cgroup/memory:ro -v /usr/lib64/libyaml-0.so.2:/usr/lib64/libyaml-0.so.2:ro -v /etc/ascend_install.info:/etc/ascend_install.info -v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info workload-image:v1.0 /bin/bash
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_ALLOW_LINK=True workload-image:v1.0 /bin/bash
docker run -it --device=/dev/davinci0:rwm --device=/dev/xsmem_dev:rwm --device=/dev/event_sched:rwm --device=/dev/svm0:rwm --device=/dev/sys:rwm --device=/dev/vdec:rwm --device=/dev/venc:rwm --device=/dev/vpc:rwm --device=/dev/davinci_manager:rwm --device=/dev/spi_smbus:rwm --device=/dev/upgrade:rwm --device=/dev/user_config:rwm --device=/dev/ts_aisle:rwm --device=/dev/memory_bandwidth:rwm -v /etc/sys_version.conf:/etc/sys_version.conf:ro -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi:ro -v /var/dmp_daemon:/var/dmp_daemon:ro -v /var/slogd:/var/slogd:ro -v /var/log/npu/conf/slog/slog.conf:/var/log/npu/conf/slog/slog.conf:ro -v /etc/hdcBasic.cfg:/etc/hdcBasic.cfg:ro -v /usr/local/Ascend/driver/tools:/usr/local/Ascend/driver/tools -v /usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64 -v /usr/lib64/aicpu_kernels:/usr/lib64/aicpu_kernels:ro -v /usr/lib64/libtensorflow.so:/usr/lib64/libtensorflow.so:ro -v /sys/fs/cgroup/memory:/sys/fs/cgroup/memory:ro -v /usr/lib64/libyaml-0.so.2:/usr/lib64/libyaml-0.so.2:ro -v /etc/ascend_install.info:/etc/ascend_install.info -v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info workload-image:v1.0 /bin/bash
Parameter |
Description |
Example |
|---|---|---|
ASCEND_VISIBLE_DEVICES |
|
|
ASCEND_ALLOW_LINK |
Specifies whether soft links are allowed in the mounted file or directory. This parameter must be specified for the Atlas 500 A2 edge station, Atlas 200I A2 accelerator module, and Atlas 200I DK A2 developer kit. NOTE:
Other devices such as Atlas training product, |
|
ASCEND_RUNTIME_OPTIONS |
Restricts the processor ID specified by ASCEND_VISIBLE_DEVICES.
|
|
ASCEND_RUNTIME_MOUNTS |
Name of the configuration file with content to be mounted. You can configure the files and directories to be mounted to the container in this file. |
|
ASCEND_VNPU_SPECS |
Splits a certain number of AI Cores from a physical NPU device and specifies them as virtual devices. The following values are supported:
This parameter must be used together with ASCEND_VISIBLE_DEVICES that specifies the physical NPU device to be split. NOTE:
If the value of ASCEND_RUNTIME_OPTIONS contains VIRTUAL, ASCEND_VNPU_SPECS does not take effect. |
ASCEND_VNPU_SPECS=vir04 indicates that four AI Cores are used as virtual devices and mounted to the container. NOTE:
|
Parameter |
Parameter Description |
|---|---|
/dev/xsmem_dev |
Mounts the device that manages the memory to the container. |
/dev/event_sched |
Mounts the device for event scheduling to the container. |
/dev/ts_aisle |
Mounts the device corresponding to the aicpudrv driver to the container. |
/dev/svm0 |
Mounts the device for memory management to the container. |
/dev/sys |
Mounts the DVPP-related device to the container. |
/dev/vdec |
Mounts the DVPP-related device to the container. |
/dev/vpc |
Mounts the DVPP-related device to the container. |
/dev/log_drv |
Mounts the device that records logs to the container. |
/dev/upgrade |
Mounts the device that obtains the Ascend system configuration and firmware information to the container. |
/dev/spi_smbus |
Mounts the device that uses out-of-band SPI communication to the container. |
/dev/user_config |
Mounts the device that is related to the management user configuration to the container. |
/dev/memory_bandwidth |
Mounts the device that is related to the memory bandwidth to the container. |
-v /var/slogd:/var/slogd |
Mounts the log process file of the host to the container in read-only mode. |
-v /var/dmp_daemon:/var/dmp_daemon |
Mounts the DMP daemon to the container. |
-v /var/log/npu/conf/slog:/var/log/npu/conf/slog |
Mounts the NPU log module to the container. |
-v /usr/lib64/libyaml-0.so.2:/usr/lib64/libyaml-0.so.2:ro |
Mounts the .so file of libyaml on the host to the container. |
-v /usr/local/Ascend/driver/tools:/usr/local/Ascend/driver/tools |
Mounts /usr/local/Ascend/driver/tools (driver-related tool directory) to the container. |
-v /usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64 |
Mounts /usr/local/Ascend/driver/lib64 (dynamic library directory of the driver dependency) to the container. |
-v /usr/lib64/libtensorflow.so:/usr/lib64/libtensorflow.so |
Mounts /usr/lib64/libtensorflow.so (AI CPU operator library file of TensorFlow) to the container. |
-v /usr/lib64/aicpu_kernels:/usr/lib64/aicpu_kernels |
Mounts /usr/lib64/aicpu_kernels (AI CPU operator library directory) to the container. |
-v /sys/fs/cgroup/memory:/sys/fs/cgroup/memory:ro |
Mounts the /sys/fs/cgroup/memory directory required for querying the host memory usage to the container in read-only mode. |
-v /etc/ascend_install.info:/etc/ascend_install.info |
Mounts the host installation information file /etc/ascend_install.info to the container. |
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info |
Mounts the host version information file /usr/local/Ascend/driver/version.info to the container. Modify the file according to your actual requirements. |
workload-image:v1.0 |
Indicates the generated image file. |
/bin/bash |
Starts the interactive Bash Shell in the container. |