- Edited
jakaskerl not sure if it is a power issue since it works on the same computer with the same cables outside the docker container.
jakaskerl not sure if it is a power issue since it works on the same computer with the same cables outside the docker container.
I also specifically tried giving access to the device (Intel Movidus MyriadX) but no luck:
docker run --rm --privileged -v /dev/bus/usb/001/039:/dev/bus/usb/001/039 --device-cgroup-rule='c 189:* rmw' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix luxonis/depthai-library:latest python3 /depthai-python/examples/ColorCamera/rgb_preview.py
Output:
Traceback (most recent call last):
File "/depthai-python/examples/ColorCamera/rgb_preview.py", line 24, in <module>
with dai.Device(pipeline) as device:
RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND
@jakaskerl or @Luxonis-Adam will it be possible to schedule a quick call to see what might be off? I am out of options at this point. I tried it on 2 different PCs (one running Ubuntu 20 and one running Ubuntu 22) but no luck.
can you just do an 'lsusb' inside the container? Does the device show up there?
marcow@feather7:~$ xhost +; docker pull luxonis/depthai-library && docker run --rm --privileged -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix luxonis/depthai-library:latest bash -c "apt-get install usbutils && lsusb"
access control disabled, clients can connect from any host
Using default tag: latest
latest: Pulling from luxonis/depthai-library
Digest: sha256:12d0ddd4abacc82dd0239415bd25e6ef0c37193672f86aca6db7b9ea870b1149
Status: Image is up to date for luxonis/depthai-library:latest
docker.io/luxonis/depthai-library:latest
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
usbutils
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 79.3 kB of archives.
After this operation, 333 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 usbutils amd64 1:013-3 [79.3 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 79.3 kB in 0s (543 kB/s)
Selecting previously unselected package usbutils.
(Reading database ... 45067 files and directories currently installed.)
Preparing to unpack .../usbutils_1%3a013-3_amd64.deb ...
Unpacking usbutils (1:013-3) ...
Setting up usbutils (1:013-3) ...
Processing triggers for man-db (2.9.4-2) ...
Bus 004 Device 001: ID 1d6b:0003 Linux 6.8.0-45-generic xhci-hcd xHCI Host Controller
Bus 003 Device 001: ID 1d6b:0002 Linux 6.8.0-45-generic xhci-hcd xHCI Host Controller
Bus 002 Device 001: ID 1d6b:0003 Linux 6.8.0-45-generic xhci-hcd xHCI Host Controller
Bus 001 Device 041: ID 03e7:2485 Movidius Ltd. Movidius MyriadX
Bus 001 Device 003: ID 174f:1812 Integrated Camera
Bus 001 Device 002: ID 06cb:0126
Bus 001 Device 005: ID 8087:0033
Bus 001 Device 001: ID 1d6b:0002 Linux 6.8.0-45-generic xhci-hcd xHCI Host Controller
marcow@feather7:~$
AadiKothari
If what @mw46d said works, check the logs with dmesg
.
The device works in one mode -03e7:2485 Movidius Ltd. Movidius MyriadX
when ready to accept connections, then 03e7:f63b 03e7 Luxonis Device
when it is working (booted, running an app). It reconnects between these two states which could cause it not to be found again.
Thanks,
Jaka
So I was able to see `Movidius Ltd. Movidius MyriadXinside the container.
dmesg logs when running docker command:
[11458.646754] usb 1-11.4.2: USB disconnect, device number 15
[11459.465117] usb 4-1.4.2: new SuperSpeed USB device number 13 using xhci_hcd
[11459.485888] usb 4-1.4.2: New USB device found, idVendor=03e7, idProduct=f63b, bcdDevice= 1.00
[11459.485892] usb 4-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11459.485893] usb 4-1.4.2: Product: Luxonis Device
[11459.485893] usb 4-1.4.2: Manufacturer: Intel Corporation
[11459.485894] usb 4-1.4.2: SerialNumber: 18443010E1C3341300
dmesg logs after the docker command errored out:
[11397.176981] usb 1-11.4.2: new high-speed USB device number 15 using xhci_hcd
[11397.277553] usb 1-11.4.2: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01
[11397.277561] usb 1-11.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11397.277564] usb 1-11.4.2: Product: Movidius MyriadX
[11397.277565] usb 1-11.4.2: Manufacturer: Movidius Ltd.
[11397.277567] usb 1-11.4.2: SerialNumber: 03e72485
[11397.429049] usb 4-1.4.2: USB disconnect, device number 12
[11402.614106] docker0: port 1(veth4311fef) entered disabled state
[11402.614229] veth2920233: renamed from eth0
[11402.683207] docker0: port 1(veth4311fef) entered disabled state
[11402.684122] device veth4311fef left promiscuous mode
[11402.684130] docker0: port 1(veth4311fef) entered disabled state
One more things I tried (and it WORKED!?) is using docker command in root mode instead of rootless (I have docker setup in rootless on ubuntu). Tried docker command that worked:
sudo docker run --rm --privileged -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix luxonis/depthai-library:latest python3 /depthai-python/examples/ColorCamera/rgb_preview.py
dmesg log for the same:
[11690.583268] usb 1-11.4.2: USB disconnect, device number 17
[11691.356733] usb 4-1.4.2: new SuperSpeed USB device number 15 using xhci_hcd
[11691.377736] usb 4-1.4.2: New USB device found, idVendor=03e7, idProduct=f63b, bcdDevice= 1.00
[11691.377744] usb 4-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11691.377747] usb 4-1.4.2: Product: Luxonis Device
[11691.377749] usb 4-1.4.2: Manufacturer: Intel Corporation
[11691.377750] usb 4-1.4.2: SerialNumber: 18443010E1C3341300
I guess now the question comes down to how to make the same work in rootless mode?
What does the id
command tell you about your normal user? Is that user a member of the docker group?
marcow@feather7:~$ id
uid=80288(marcow) gid=10(uucp) groups=10(uucp),4(adm),20(dialout),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),133(lxd),134(sambashare),136(vboxusers),999(docker)
Yes:
id
uid=1000(aadi) gid=1000(aadi) groups=1000(aadi),4(adm),20(dialout),24(cdrom),27(sudo),30(dip),46(plugdev),108(kvm),120(lpadmin),133(lxd),134(sambashare),998(docker)
AadiKothari
Try adding this command either inside docker or outside in the OS:
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
Thanks,
Jaka
Tried outside in the OS, did not work. Same issue
AadiKothari
And inside the container? The passthrough clearly works, just seems to be an issue of permissions.
Thanks,
Jaka
This fails inside the container since I do not have access to the host's device management system:
udevadm control --reload-rules
Failed to send reload request: No such file or directory
AadiKothari
I reran your exact setup and command and I am getting no issues.
Does docker have RW perms?
ls -l /var/run/docker.sock
It works on sudo? Otherwise the error could just be power related.
I know it sounds stupid, but generally when setting docker perms, it is best to either logout or restart the device to get the settings to apply.
Thanks,
Jaka