Coral USB on Proxmox LXC
See original GitHub issueHello,
Can’t get Frigate working with Google Coral USB accelerator. I am running Proxmox 7.0, inside I have LXC container running Debian 10 turnkey core 16 image. Inside Debian I am running Frigate docker container. In log files I allways get error “No EdgeTPU detected”.
Proxmox shall:
root@proxmox:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 004: ID 1a6e:089a Global Unichip Corp.
Bus 004 Device 003: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 004 Device 002: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@proxmox:~# ls -al /dev/bus/usb/004/004
crw-rw-rw- 1 root plugdev 189, 387 Sep 19 11:15 /dev/bus/usb/004/004
Proxmox udev rule:
root@proxmox:~# nano /etc/udev/rules.d/98-coral.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a6e", ATTRS{idProduct}=="089a", OWNER="root", SYMLINK+="coral", MODE="0666", GROUP="plugdev"
root@proxmox:~# ls -al /dev/coral
lrwxrwxrwx 1 root root 15 Sep 19 11:54 /dev/coral -> bus/usb/004/004
LXC container config:
root@proxmox:~# nano /etc/pve/lxc/102.conf
GNU nano 5.4
arch: amd64
cores: 4
features: nesting=1
hostname: Frigate
memory: 8192
nameserver: 192.168.31.1
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=22:AA:3E:DC:53:0C,ip=dhcp,ip6=dhcp,type=veth
onboot: 1
ostype: debian
parent: Frigate_Neolink
rootfs: local-lvm:vm-102-disk-0,size=150G
searchdomain: 192.168.31.1
swap: 1024
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/coral dev/bus/usb/coral none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
[Frigate_Neolink]
arch: amd64
cores: 4
features: nesting=1
hostname: Frigate
memory: 8192
nameserver: 192.168.31.1
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=22:AA:3E:DC:53:0C,ip=dhcp,ip6=dhcp,type=veth
ostype: debian
rootfs: local-lvm:vm-102-disk-0,size=150G
searchdomain: 192.168.31.1
snaptime: 1631817381
swap: 1024
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:
Inside LXC container:
root@Frigate ~# ls -al /dev/bus/usb/coral
crw-rw-rw- 1 root plugdev 189, 387 Sep 19 08:54 /dev/bus/usb/coral
Config file Include your full config file wrapped in triple back ticks.
version: '3.9'
services:
frigate:
container_name: frigate
privileged: true
restart: unless-stopped
image: blakeblackshear/frigate:stable-amd64
devices:
- /dev/bus/usb:/dev/bus/usb
- /dev/dri/renderD128
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/frigate/frigate.yml:/config/config.yml:ro
- /media/frigate:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- '5000:5000'
- '1935:1935'
environment:
FRIGATE_RTSP_PASSWORD: 'pass1'
build:
context: .
shm_size: '256m'
shm_size: '256m'
Config file Include your full config file wrapped in triple back ticks.
detectors:
coral:
type: edgetpu
device: usb
mqtt:
host: 192.168.31.3
port: 1883
topic_prefix: frigate
client_id: Frigate
user: Frigate
password: pass
stats_interval: 60
ffmpeg:
input_args:
- -avoid_negative_ts
- make_zero
- -fflags
- - nobuffer
- -flags
- low_delay
- -strict
- experimental
- -fflags
- +genpts+discardcorrupt
- -rw_timeout
- "5000000"
- -use_wallclock_as_timestamps
- "1"
hwaccel_args:
- -hwaccel
- qsv
- -qsv_device
- /dev/dri/renderD128
cameras:
parking:
ffmpeg:
inputs:
- path: rtmp://192.168.x.x/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=x
roles:
- clips
- detect
width: 2560
height: 1920
fps: 7
objects:
track:
- person
- car
- dog
filters:
person:
min_area: 1000
min_score: 0.5
threshold: 0.75
car:
min_area: 50000
min_score: 0.5
threshold: 0.75
dog:
min_area: 1000
min_score: 0.5
threshold: 0.75
snapshots:
enabled: True
crop: True
timestamp: False
bounding_box: True
retain:
default: 14
rtmp:
enabled: False
clips:
enabled: True
retain:
default: 14
motion:
contour_area: 100
threshold: 26
mask:
- 1628,0,1324,361,930,839,445,1518,842,1920,0,1920,0,0
- 2560,1920,2560,988,2260,1838,1802,1838,1790,1920
door:
ffmpeg:
inputs:
- path: rtmp://192.168.x.x/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=x
roles:
- clips
- detect
width: 2560
height: 1920
fps: 7
objects:
track:
- person
- dog
filters:
person:
min_area: 500
min_score: 0.5
threshold: 0.75
dog:
min_area: 50
min_score: 0.5
threshold: 0.75
snapshots:
enabled: True
timestamp: False
crop: True
bounding_box: True
retain:
default: 14
rtmp:
enabled: False
clips:
enabled: True
retain:
default: 14
motion:
contour_area: 100
threshold: 26
mask:
- 726,402,463,731,315,944,0,1427,0,487,0,0,558,0,1079,0
- 1727,0,2560,0,2560,1920,1288,1920,1401,1445,1707,1473,1738,949,1741,552,1740,347
Frigate container logs
Starting migrations
peewee_migrate INFO : Starting migrations
There is nothing to migrate
peewee_migrate INFO : There is nothing to migrate
frigate.mqtt INFO : MQTT connected
detector.coral INFO : Starting detection process: 34
frigate.app INFO : Camera processor started for parking: 38
frigate.edgetpu INFO : Attempting to load TPU as usb
frigate.app INFO : Camera processor started for door: 43
Process detector:coral:
frigate.edgetpu INFO : No EdgeTPU detected.
frigate.app INFO : Camera processor started for entrance: 44
frigate.app INFO : Capture process started for parking: 46
frigate.app INFO : Capture process started for door: 51
frigate.app INFO : Capture process started for entrance: 53
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 152, in load_delegate
delegate = Delegate(library, options)
File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 111, in __init__
raise ValueError(capture.message)
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/frigate/frigate/edgetpu.py", line 124, in run_detector
object_detector = LocalObjectDetector(tf_device=tf_device, num_threads=num_threads)
File "/opt/frigate/frigate/edgetpu.py", line 63, in __init__
edge_tpu_delegate = load_delegate('libedgetpu.so.1.0', device_config)
File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 154, in load_delegate
raise ValueError('Failed to load delegate from {}\n{}'.format(
ValueError: Failed to load delegate from libedgetpu.so.1.0
Computer Hardware
- NUC8i7HVK
- OS: Debian
- Install method: Docker Compose
- Virtualization: Proxmox LXC
- Coral Version: USB
- Network Setup: Wired
Camera Info:
- Manufacturer: Reolink
- Model: RLC-520
- Resolution: 2k
- FPS: 7
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Google Coral USB + Frigate + PROXMOX
Part 6 - Configure LXC to pass through the Coral · In the host, verify which USB bus the coral is on. ·...
Read more >LXC container and Google Coral passthrough - Proxmox forums
i created LXC container from debian 10 and trying to passthrough the USB Coral device to it, buth i cant get it to...
Read more >Proxmox + Frigate + Coral USB passthrough? : r/homeassistant
I am running proxmox on a Dell 720 and have a frigate container. I agree that passing the whole port is the way...
Read more >Home Assistant | Pros/cons running Frigate in HA as an add ...
Any ideas how to pas Coral USB to frigate? I am running proxmox. HA is running on VM. Frigate is running on CT,...
Read more >USB Passthrough to an LXC (Proxmox) - Medium
The idea of USB pass through to an LXC container can be done by “mounting” the device inside the container space. However, it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After millios retries just got it working with following LXC config:
Running test model:
Frigate logs:
Unfortunately, as soon as some motion appears, live cam stream inside frigate gets stuck, in logs I find this:
USB devices logs
Old thread but to me it seems to show as Global Unichip Corp after reboot or disconnect of the device. It changes to Google Inc. after the first usage (e.g. running the example inference script).