I am trying to run depthai in WSL2.
I have gotten maddening close...RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND
Every time it fails, it removes the device from WSL and I have to reattach it.
Set udev rules
(depthai_p3venv) mike@MSI:~/oak/depthai/depthai$ echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"
(depthai_p3venv) mike@MSI:~/oak/depthai/depthai$ sudo udevadm control --reload-rules && sudo udevadm trigger
PLUG IN CAMERA AT THIS POINT
Attach USB device to WSL Distro
IN POWERSHELL: usbipd wsl attach --busid 1-4
Verify USB device is present in Linux
(depthai_p3venv) mike@MSI:~/oak/depthai/depthai$ lsusb | grep 03e7
Bus 001 Device 014: ID 03e7:2485 Intel Movidius MyriadX
Start DepthAI (tried using usb3 and usb2)
(depthai_p3venv) mike@MSI:~/oak/depthai/depthai$ python depthai_demo.py -usbs usb2
Fails to find device after rebooting:
Using depthai module from: /home/mike/oak/depthai/python/depthai_p3venv/lib/python3.8/site-packages/depthai.cpython-38-x86_64-linux-gnu.so
Depthai version installed: 2.15.4.0
Setting up demo...
Available devices:
[0] 19443010E163EF1200 [X_LINK_UNBOOTED]
File "depthai_demo.py", line 677, in run
self.instance.run_all(self.conf)
File "depthai_demo.py", line 128, in run_all
self.setup(conf)
File "depthai_demo.py", line 211, in setup
self._device = dai.Device(self._pm.pipeline.getOpenVINOVersion(), self._deviceInfo, usb2Mode=self._conf.args.usbSpeed == "usb2")
RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND
Results of dmesg -w:
[ 2876.534317] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3)
[ 2876.534319] vhci_hcd vhci_hcd.0: devid(65540) speed(3) speed_str(high-speed)
[ 2876.534345] vhci_hcd vhci_hcd.0: Device attached
[ 2876.882470] usb 1-1: new high-speed USB device number 12 using vhci_hcd
[ 2877.032357] usb 1-1: SetAddress Request (12) to port 0
[ 2877.064829] usb 1-1: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01
[ 2877.064831] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2877.064832] usb 1-1: Product: Movidius MyriadX
[ 2877.064833] usb 1-1: Manufacturer: Movidius Ltd.
[ 2877.064833] usb 1-1: SerialNumber: 03e72485
[ 2906.790263] vhci_hcd: connection closed
[ 2906.790419] vhci_hcd: stop threads
[ 2906.790421] vhci_hcd: release socket
[ 2906.790425] vhci_hcd: disconnect device
[ 2906.790446] usb 1-1: USB disconnect, device number 12