I'm connecting 4 HDK 888 devices to Azure Arc so I can include SNPE hardware inference latency testing in an Azure ML pipeline. The devices are connected to a Linux machine running Ubuntu 18.04 and they work perfectly there, "adb devices" lists them, etc.
But I need to create a docker container that can access those same devices, and after much searching I have found "docker run -ti -d --privileged -d -p 4723:4723 -v /dev/bus/usb:/dev/bus/usb name" is the recommended way to give the container access to the host usb devices. But "adb devices" in the docker container returns empty list. But "lsusb" shows the devices no problem as shown below.
Has anyone got past this point to get "adb" to work properly in the docker container with the HDK 888 devkits?
root@25126bbc126f:/home/archai# lsusb
Bus 002 Device 002: ID 8087:8002 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:800a Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 097: ID 05c6:901d Qualcomm, Inc.
Bus 004 Device 096: ID 05c6:901d Qualcomm, Inc.
Bus 004 Device 010: ID 0451:8140 Texas Instruments, Inc.
Bus 004 Device 098: ID 05c6:901d Qualcomm, Inc.
Bus 004 Device 099: ID 05c6:901d Qualcomm, Inc.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 010: ID 05c6:9501 Qualcomm, Inc.
Bus 003 Device 009: ID 05c6:9500 Qualcomm, Inc.
Bus 003 Device 008: ID 05c6:9501 Qualcomm, Inc.
Bus 003 Device 007: ID 05c6:9500 Qualcomm, Inc.
Bus 003 Device 005: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Thanks, yes I saw on stackoverflow much talk about "adb_usb.ini" and I have tried this already, but it doesn't seem to work for me. When I create this file in ~/.android folder containing the device PID "0x05c6" it still returns an empty list even after running "adb kill-server". Note, my host computer is Ubuntu 18.04. I've also tried this from Windows host machine, also, but no luck there either.
Wait a minute, my WSL2 Ubuntu distrbution (NOT docker) running on my Windows host CAN see the Qualcomm HDK device once I install the usbip tools as per https://learn.microsoft.com/en-us/windows/wsl/connect-usb. And this did require the ~/.android/adb_usb.ini file to work. But I need this to work in a docker container, but so far have been unable to make that work either from Linux or Windows host machine. I have 4 Qualcomm devices and so I would love to be able to have 4 docker container instances, each with access to one of those devices where each of those docker containers is also connected to an Azure Arc Kubernetes cluster so that I can send jobs to those containers from Azure ML Pipelines where those jobs measure Neural Network performance on the Qualcomm devices. It's a very compelling scenario for teams at Microsoft that are designing Ai models that run on Android phones and need a way to ensure those models are optimized for the Qualcomm chipset. I wonder if a Linux host can do a similar usbip trick that the above document describes...
Thanks, yes "adb -s" is how I'm sending work to individual devices. The udev rules won't work in the docker container because udev refuses to run in the docker container. Since I need to use Kubernetes containers for Azure Arc to work, I'm still trying to find a way to make the docker container recognize the adb devices. It is very weird because "lsusb" in the container can clearly see the devices, like this "Bus 004 Device 097: ID 05c6:901d Qualcomm, Inc." so I wonder why adb can't also see that. I'm wondering if there's simply some dependent package missing in my docker container that adb requires in order for it to work properly. I mean "adb" is running, it doesn't blow up, but I wonder. I wish someone could just point me to a Docker image that is already built and tested and "just works" ;-)