Having troubles to use my Coral TPU USB stick. Weird because when I was using it in the past - while experimenting with my own js tensor-based code - it worked fine.
I moved the Frigate object detection (Tensorflow) calculations from my CPU to the Google Coral TPU USB stick:
detectors:
#cpu1:
# type: cpu
# num_threads: 3
coral:
type: edgetpu
device: usb:1
But now I get this error when starting up the Frigate Docker container:
Failed to load delegate from libedgetpu.so.1.0
My Coral TPU USB stick is detected as device 004 on my Raspberry:
$ lsusb
Bus 002 Device 003: ID 04e8:61f5 Samsung Electronics Co., Ltd Portable SSD T5
Bus 002 Device 004: ID 18d1:9302 Google Inc.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
And it can also be detected in Docker, although for some reason it shows no name for device 004:
$ sudo docker run --rm --privileged -v /dev/bus/usb:/dev/bus/usb busybox lsusb
Bus 002 Device 004: ID 18d1:9302
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.51+rpt-rpi-v8 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 2109:3431 USB2.0 Hub
Bus 002 Device 003: ID 04e8:61f5 Samsung Portable SSD T5
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.51+rpt-rpi-v8 xhci-hcd xHCI Host Controller
And I pass all the USB devices to the Frigate container in my Docker compose yaml file:
services:
frigate:
container_name: frigate
privileged: true
image: ghcr.io/blakeblackshear/frigate:stable
devices:
- /dev/bus/usb:/dev/bus/usb # Passes all the USB devices
The privileged
does even turn protection mode off (which isn't very secure), to allow the container to access all devices on the host. But even that doesn't help.
I have plugged the USB stick in and out again, but now the "Google Inc" description is replaced by something else:
$ lsusb
Bus 002 Device 003: ID 04e8:61f5 Samsung Electronics Co., Ltd Portable SSD T5
Bus 002 Device 005: ID 1a6e:089a Global Unichip Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
In other discussions (e.g. here) they seem to link this problem to power issues. Seems that the Coral TPU stick consumers much more current as the Raspberry Pi 4 can offer. But then again, I see all over the place that most USB hubs are not usable, because their chipset does "backpower". If I understand correctly, that would cause the Raspberry not to reboot automatically after a power down.
I have completely run out of creativity
What a waste of time...
Does anybody have some tips?
Thanks!!