Device Call Failure
Symptom
Device calling fails in a container. A message similar to the following is printed in the log:
Log message (1): The drvDeviceOpen error is printed in the log, as shown below.
[ascend][ERROR][2021-06-26-17:53:15:689064][curpid: 32707, 32707][devdrv][drvDeviceOpen 79]get phys failed, devId(0), phy_devId(0)
Log message (2): The message device is in used is printed in the kernel log (dmesg), as shown below.
[52783.010878] [ascend] [ERROR] [devdrv] [devdrv_manager_container_table_devlist_add_ns 832] <drv_hlt_dsmi_te:5615> device is in used [52783.010881] [ascend] [ERROR] [tsdrv] [devdrv_open 194] <drv_hlt_dsmi_te:5615> add to list failed. dev_id(0) [52783.013546] [ascend] [devdrv] [devdrv_manager_container_get_devnum 1306] <drv_hlt_dsmi_te:5615> weird device number, dev_num = 0 [52783.013547] [ascend] [ERROR] [devdrv] [devdrv_manager_container_get_devlist_ns 1210] <drv_hlt_dsmi_te:5615> some devices are used by other docker, mnt_ns = 0xffff8d33a5963720 [52783.013548] [ascend] [ERROR] [devdrv] [devdrv_manager_container_get_davinci_devlist 1248] <drv_hlt_dsmi_te:5615> get davinci devlist failed, ret(-22).
Possible Cause
The possible causes are as follows:
- Possible cause for log message (1): The device is not mapped when the Docker container is started.
- Possible cause for log message (2): The device is occupied by another container.
Solution
- For log message (1), rectify the fault as follows:
Run the ls /dev command in the container to check whether the device is mapped.

If the device is not mapped to the Docker container, start the container by referring to CANN Software Installation Guide. The command for starting Docker must contain the arguments of the mapped device, for example:
--device=/dev/davinciX --device=/dev/davinci_manager --device=/dev/devmm_svm --device=/dev/hisi_hdc
Parent topic: Abnormal Resources at Runtime