Hello,
Running currently Docker Desktop on Debian 11. Used Portainer to install and manage container which runs Frigate NVR and want to pass through Google USB Coral EdgeTPU. I installed the USB Coral on the host as per coral.ai/setup and tested successfully. Is there something I need to do to get the container to see the USB device installed? I cannot find anything in the documentation or other support records (that worked for me at least). Any assistance would be most appreciated.
My docker compose
version: “3.9”
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "128mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /home/user1/frigate/config.yml:/config/config.yml
- /home/userr1/storage:/media/frigate
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8554:8554" #RSTP feeds
- "1935:1935" # RTMP feeds
environment:
FRIGATE_RTSP_PASSWORD: "supersecret"
TZ: "Pacific/Auckland"
Running lsusb on host sees the Google device.
user1@deb:~/coral/pycoral$ lsusb
Bus 003 Device 003: ID 0424:2660 Microchip Technology, Inc. (formerly SMSC) Hub
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 004: ID 18d1:9302 Google Inc.
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 007: ID 045e:07b2 Microsoft Corp. 2.4GHz Transceiver v8.0 used by mouse Wireless Desktop 900
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
user1@deb:~/coral/pycoral$ ls -la /dev/bus/usb/005
total 0
drwxr-xr-x 2 root root 80 Apr 29 09:31 .
drwxr-xr-x 7 root root 140 Apr 29 08:48 …
crw-rw-r-- 1 root root 189, 512 Apr 29 08:49 001
crw-rw---- 1 root plugdev 189, 515 Apr 29 09:32 004
Running lsusb in the container:
lsusb
unable to initialize libusb: -99
From what I can gather, this error indicates no USB controller can be seen by the container. I have added - /dev/bus/usb:/dev/bus/usb as a volume because I saw others with the same issue but didnt work for me.
Container log snip
2023-05-06 11:29:39.245169682 [INFO] Starting go2rtc…
2023-05-06 11:29:39.582140956 23:29:39.573 INF go2rtc version 1.2.0 linux/amd64
2023-05-06 11:29:39.582147590 23:29:39.573 INF [api] listen addr=:1984
2023-05-06 11:29:39.582150923 23:29:39.573 INF [rtsp] listen addr=:8554
2023-05-06 11:29:39.582153691 23:29:39.574 INF [srtp] listen addr=:8443
2023-05-06 11:29:39.582156377 23:29:39.574 INF [webrtc] listen addr=:8555
2023-05-06 11:29:41.126717402 2023/05/06 23:29:41 [error] 128#128: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.21.0.1, server: , request: “GET /api/stats HTTP/1.1”, upstream: “http://127.0.0.1:5001/stats”, host: “192.168.1.168:5000”
2023-05-06 11:29:41.127188302 172.21.0.1 - - [06/May/2023:23:29:41 +1200] “GET /api/stats HTTP/1.1” 502 157 “-” “HomeAssistant/2023.4.6 aiohttp/3.8.4 Python/3.10” “-”
2023-05-06 11:29:41.994963847 [2023-05-06 23:29:41] frigate.app INFO : Starting Frigate (0.12.0-da3e197)
2023-05-06 11:29:42.047104535 [2023-05-06 23:29:42] peewee_migrate INFO : Starting migrations
2023-05-06 11:29:42.346720996 [2023-05-06 23:29:42] peewee_migrate INFO : There is nothing to migrate
2023-05-06 11:29:42.552684223 [2023-05-06 23:29:42] frigate.app INFO : Output process started: 216
2023-05-06 11:29:42.586537328 [2023-05-06 23:29:42] frigate.app INFO : Camera processor started for front_camera: 220
2023-05-06 11:29:42.614108798 [2023-05-06 23:29:42] frigate.app INFO : Capture process started for front_camera: 222
2023-05-06 11:29:42.639764828 [2023-05-06 23:29:42] detector.coral INFO : Starting detection process: 215
2023-05-06 11:29:42.639771761 [2023-05-06 23:29:42] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2023-05-06 11:29:42.682997016 Process detector:coral:
2023-05-06 11:29:42.685473089 Traceback (most recent call last):
2023-05-06 11:29:42.685548645 File “/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py”, line 160, in load_delegate
2023-05-06 11:29:42.685551540 delegate = Delegate(library, options)
2023-05-06 11:29:42.685581769 File “/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py”, line 119, in init
2023-05-06 11:29:42.685584049 raise ValueError(capture.message)
2023-05-06 11:29:42.685639324 ValueError
2023-05-06 11:29:42.685683663
2023-05-06 11:29:42.685686098 During handling of the above exception, another exception occurred:
2023-05-06 11:29:42.685722319
2023-05-06 11:29:42.685755310 Traceback (most recent call last):
2023-05-06 11:29:42.685822304 File “/usr/lib/python3.9/multiprocessing/process.py”, line 315, in _bootstrap
2023-05-06 11:29:42.685824551 self.run()
2023-05-06 11:29:42.685851809 File “/usr/lib/python3.9/multiprocessing/process.py”, line 108, in run
2023-05-06 11:29:42.685854075 self._target(*self._args, **self._kwargs)
2023-05-06 11:29:42.685878938 File “/opt/frigate/frigate/object_detection.py”, line 98, in run_detector
2023-05-06 11:29:42.685881196 object_detector = LocalObjectDetector(detector_config=detector_config)
2023-05-06 11:29:42.685905304 File “/opt/frigate/frigate/object_detection.py”, line 52, in init
2023-05-06 11:29:42.685907548 self.detect_api = create_detector(detector_config)
2023-05-06 11:29:42.685931616 File “/opt/frigate/frigate/detectors/init.py”, line 24, in create_detector
2023-05-06 11:29:42.685933659 return api(detector_config)
2023-05-06 11:29:42.685957855 File “/opt/frigate/frigate/detectors/plugins/edgetpu_tfl.py”, line 37, in init
2023-05-06 11:29:42.685960142 edge_tpu_delegate = load_delegate(“libedgetpu.so.1.0”, device_config)
2023-05-06 11:29:42.686024205 File “/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py”, line 162, in load_delegate
2023-05-06 11:29:42.686026797 raise ValueError(‘Failed to load delegate from {}\n{}’.format(
2023-05-06 11:29:42.686067376 ValueError: Failed to load delegate from libedgetpu.so.1.0
2023-05-06 11:29:42.686069578
2023-05-06 11:29:42.692751237 [2023-05-06 23:29:42] frigate.detectors.plugins.edgetpu_tfl ERROR : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.
2023-05-06 11:29:48.181040929 [INFO] Starting go2rtc healthcheck service…
2023-05-06 11:29:49.583437714 172.21.0.1 - - [06/May/2023:23:29:49 +1200] “GET /api/stats HTTP/1.1” 200 2042 “-” “HomeAssistant/2023.4.6 aiohttp/3.8.4 Python/3.10” “-”
2023-05-06 11:29:57.696914666 172.21.0.1 - - [06/May/2023:23:29:57 +1200] “GET /api/stats HTTP/1.1” 200 2019 “-” “HomeAssistant/2023.4.6 aiohttp/3.8.4 Python/3.10” “-”
2023-05-06 11:30:03.354503338 [2023-05-06 23:30:03] frigate.watchdog INFO : Detection appears to have stopped. Exiting Frigate…
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: service go2rtc-healthcheck: stopping
2023-05-06 11:30:03.399838596 [INFO] The go2rtc-healthcheck service exited with code 256 (by signal 15)
s6-rc: info: service go2rtc-healthcheck successfully stopped
2023-05-06 11:30:03.442368022 [INFO] Service NGINX exited with code 0 (by signal 0)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service nginx-log: stopping
s6-rc: info: service frigate: stopping
2023-05-06 11:30:03.469810857 [2023-05-06 23:30:03] frigate.app INFO : Stopping…
2023-05-06 11:30:03.473717631 [2023-05-06 23:30:03] frigate.storage INFO : Exiting storage maintainer…
2023-05-06 11:30:03.482368209 [2023-05-06 23:30:03] frigate.events INFO : Exiting event cleanup…
2023-05-06 11:30:03.483147508 [2023-05-06 23:30:03] frigate.record INFO : Exiting recording cleanup…
2023-05-06 11:30:03.483715970 [2023-05-06 23:30:03] frigate.stats INFO : Exiting stats emitter…
2023-05-06 11:30:03.484594025 [2023-05-06 23:30:03] frigate.record INFO : Exiting recording maintenance…
2023-05-06 11:30:03.485691124 [2023-05-06 23:30:03] frigate.watchdog INFO : Exiting watchdog…
2023-05-06 11:30:03.497716917 [2023-05-06 23:30:03] frigate.object_processing INFO : Exiting object processor…
s6-rc: info: service nginx-log successfully stopped
2023-05-06 11:30:03.562058750 [2023-05-06 23:30:03] frigate.comms.ws INFO : Exiting websocket client…
2023-05-06 11:30:03.593218732 [2023-05-06 23:30:03] frigate.events INFO : Exiting event processor…
2023-05-06 11:30:03.594393346 [2023-05-06 23:30:03] peewee.sqliteq INFO : writer received shutdown request, exiting.
2023-05-06 11:30:03.608643421 [2023-05-06 23:30:03] watchdog.front_camera INFO : Terminating the existing ffmpeg process…
2023-05-06 11:30:03.609421209 [2023-05-06 23:30:03] watchdog.front_camera INFO : Waiting for ffmpeg to exit gracefully…
2023-05-06 11:30:08.991038579 /usr/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 5 leaked shared_memory objects to clean up at shutdown
2023-05-06 11:30:08.991045298 warnings.warn('resource_tracker: There appear to be %d ’
2023-05-06 11:30:09.018562844 [INFO] Service Frigate exited with code 0 (by signal 0)
s6-rc: info: service frigate successfully stopped
s6-rc: info: service go2rtc: stopping
s6-rc: info: service frigate-log: stopping
2023-05-06 11:30:09.021747651 exit OK
s6-rc: info: service frigate-log successfully stopped
2023-05-06 11:30:09.036545709 [INFO] The go2rtc service exited with code 0 (by signal 0)
s6-rc: info: service go2rtc successfully stopped
s6-rc: info: service go2rtc-log: stopping
s6-rc: info: service go2rtc-log successfully stopped
s6-rc: info: service log-prepare: stopping
s6-rc: info: service s6rc-fdholder: stopping
s6-rc: info: service log-prepare successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service s6rc-fdholder successfully stopped
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
EdgeTPU is not found