Coral TPU configuration with Frigate

ajocius

New Member
Oct 1, 2023
16
4
3
O have installed Docker LXC following instructions on this website https://www.homeautomationguy.io/blog/running-frigate-on-proxmox.

I am not sure about mapping through the USB Coral TPU and Hardware Acceleration part. I have added few lines as instructed:
Code:
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0, 0
lxc.mount.entry: /dev/bus/usb/002/ dev/bus/usb/002/ none bind,optional,create=dir 0,0

First line is for hardware acceleration, second one is for Coral TPU. But how do I know if this needs to be adjusted for my hardware and USB port? Is there any way to see if Coral TPU is even recognized by my Proxmox server (plugged via USB) and if it has to be 002? I suspect that something is wrong with my configuration as starting Frigate fails and here is what I can see in the log:

2023-10-23 20:45:48.090019684 [2023-10-23 20:45:48] frigate.app INFO : Starting Frigate (0.12.1-367d724) 2023-10-23 20:45:48.105793000 [2023-10-23 20:45:48] peewee_migrate INFO : Starting migrations 2023-10-23 20:45:48.129087759 [2023-10-23 20:45:48] peewee_migrate INFO : There is nothing to migrate 2023-10-23 20:45:48.165061694 [2023-10-23 20:45:48] frigate.app INFO : Output process started: 283 2023-10-23 20:45:48.180081569 [2023-10-23 20:45:48] frigate.app INFO : Camera processor started for FrontCam: 287 2023-10-23 20:45:48.191474542 [2023-10-23 20:45:48] frigate.app INFO : Capture process started for FrontCam: 289 2023-10-23 20:45:56.879212631 [INFO] Starting go2rtc healthcheck service... 2023-10-23 20:46:13.465781662 [2023-10-23 20:45:48] detector.coral INFO : Starting detection process: 282 2023-10-23 20:46:13.465788145 [2023-10-23 20:45:48] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb 2023-10-23 20:46:13.465796853 [2023-10-23 20:46:13] 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-10-23 20:46:13.466039184 Process detector:coral: 2023-10-23 20:46:13.467375827 Traceback (most recent call last): 2023-10-23 20:46:13.467658655 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate 2023-10-23 20:46:13.467662477 delegate = Delegate(library, options) 2023-10-23 20:46:13.467664746 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in __init__ 2023-10-23 20:46:13.467666532 raise ValueError(capture.message) 2023-10-23 20:46:13.467668132 ValueError
 
O have installed Docker LXC following instructions on this website https://www.homeautomationguy.io/blog/running-frigate-on-proxmox.
The Proxmox manual urges you not to do that and run Docket in a VM instead: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_pct
I am not sure about mapping through the USB Coral TPU and Hardware Acceleration part. I have added few lines as instructed:
Code:
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0, 0
lxc.mount.entry: /dev/bus/usb/002/ dev/bus/usb/002/ none bind,optional,create=dir 0,0

First line is for hardware acceleration, second one is for Coral TPU. But how do I know if this needs to be adjusted for my hardware and USB port?
Yes, your USB device might not be connected to USB bus 002. Also, such a path is not stable and you might want to write some udev rules to make a stable path instead.
Is there any way to see if Coral TPU is even recognized by my Proxmox server (plugged via USB) and if it has to be 002? I suspect that something is wrong with my configuration as starting Frigate fails and here is what I can see in the log:
Use commands like lsusb and lsusb -t to see all connected USB devices and how they are connected.
 
I will try other options (docker in VM), just thought of docker container is using less of my HW resources, plus I found that kind of step by step guide, that I followed. I have now followed instruction to add Edge TPU runtime following guide here https://coral.ai/docs/accelerator/get-started/#runtime-on-linux .

Log seems to indicate that it finds USB device, does not give any error messages, however I can not open Frigate page (with port 5000). Frigate container log provides rather mystical errors when I try to do that:

2023-10-30 20:17:18.970738688 [INFO] Starting Frigate... 2023-10-30 20:17:18.971358305 [INFO] Preparing go2rtc config... s6-rc: info: service legacy-services: starting 2023-10-30 20:17:18.978443004 [INFO] Starting NGINX... s6-rc: info: service legacy-services successfully started 2023-10-30 20:17:19.635210906 [INFO] Starting go2rtc... 2023-10-30 20:17:19.740910563 20:17:19.740 INF go2rtc version 1.2.0 linux/amd64 2023-10-30 20:17:19.741595201 20:17:19.741 INF [api] listen addr=:1984 2023-10-30 20:17:19.742040245 20:17:19.741 INF [rtsp] listen addr=:8554 2023-10-30 20:17:19.742464339 20:17:19.742 INF [srtp] listen addr=:8443 2023-10-30 20:17:19.742866478 20:17:19.742 INF [webrtc] listen addr=:8555 2023-10-30 20:17:20.688288945 [2023-10-30 20:17:20] frigate.app INFO : Starting Frigate (0.12.1-367d724) 2023-10-30 20:17:20.705731818 [2023-10-30 20:17:20] peewee_migrate INFO : Starting migrations 2023-10-30 20:17:20.748920539 [2023-10-30 20:17:20] peewee_migrate INFO : There is nothing to migrate 2023-10-30 20:17:20.767836226 [2023-10-30 20:17:20] frigate.app INFO : Output process started: 282 2023-10-30 20:17:20.783842926 [2023-10-30 20:17:20] frigate.app INFO : Camera processor started for FrontCam: 286 2023-10-30 20:17:20.792952221 [2023-10-30 20:17:20] frigate.app INFO : Capture process started for FrontCam: 287 2023-10-30 20:17:23.440651795 [2023-10-30 20:17:20] detector.coral INFO : Starting detection process: 281 2023-10-30 20:17:23.452239774 [2023-10-30 20:17:20] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb 2023-10-30 20:17:23.462833213 [2023-10-30 20:17:23] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found 2023-10-30 20:17:28.987698725 [INFO] Starting go2rtc healthcheck service... 2023-10-30 20:18:34.499546824 192.168.1.42 - - [30/Oct/2023:20:18:34 +0100] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03}\x89\xAD\xA1\x1E\x954L\x98\xC0\xA7\xC8/\xFB;e|_\x04\xFE" 400 157 "-" "-" "-" 2023-10-30 20:18:34.501630789 192.168.1.42 - - [30/Oct/2023:20:18:34 +0100] "\x16\x03\x01\x02\x1A\x01\x00\x02\x16\x03\x03\x5C.\xF3*Ll\x82\xD5\xE5n1\xB2\xAA;o\xC4&\xFB\xA3\x80\xE1\xEF\xDB\x0C\xF4a7\x16M\xBB\x90\xFB =\x8A>\x15\x95\xB4\xCF\x17!h\xFA\xDA\xB0U\xA6\xCE~\xD3\x12o\x94\x16\x84\x86FwJ\xA1P\x81Rg\x00 \xFA\xFA\x13\x01\x13\x02\x13\x03\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x13\xC0\x14\x00\x9C\x00\x9D\x00/\x005\x01\x00\x01\xAD**\x00\x00\x00#\x00\x00\x00\x17\x00\x00\xFF\x01\x00\x01\x00\x003\x00+\x00)\xAA\xAA\x00\x01\x00\x00\x1D\x00 \xD0?e\xB6\x82\x9Ajc\xB0Y\xF9\xFE*n\xC1G\x02<\xDA\x8D;\xAB(\x80\xE3\xEA\xF2NU" 400 157 "-" "-" "-" 2023-10-30 20:18:34.505393400 192.168.1.42 - - [30/Oct/2023:20:18:34 +0100] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03\xCE\xBE^\xBA\xAD\x08(\x1A\x9E;G\xB9\x07\xBA\xDF\x10\xC8\xF0\xB5\x7F2\x14\xE5=18%\xC9\xE2\x10=\xCB \xD9\xC7\xFF\x04 q\x95&\xBA/\xC4\x16\xA0-\xE3\x15\xD72#/\xA2\x03F\x98\xD4\xC7\x9F\xA2.)\x90D\x00 JJ\x13\x01\x13\x02\x13\x03\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x13\xC0\x14\x00\x9C\x00\x9D\x00/\x005\x01\x00\x01\x93jj\x00\x00Di\x00\x05\x00\x03\x02h2\x00\x1B\x00\x03\x02\x00\x02\x00\x17\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x003\x00+\x00)\xCA\xCA\x00\x01\x00\x00\x1D\x00 \xB5\xF9\x84#\xC9\x99-" 400 157 "-" "-" "-" 2023-10-30 20:18:34.505930233 192.168.1.42 - - [30/Oct/2023:20:18:34 +0100] "\x16\x03\x01\x02:\x01\x00\x026\x03\x03o\xC4H\xA0\x06\x10`\xF9\x96&\xF83\x90\x15,e\xD6\xBC\x00~\x8A\x08\x15\xF85\x18F\x12\xF1\xAB\xE9\xEB \xF5\x1DB\xC2\x14]t\xEA\xF3\xAAJ(\xCEv5\x7F\xB9\xDB8\xCD\x9E[\x16\xFBm\xDC\xCDQh- \xCD\x00 **\x13\x01\x13\x02\x13\x03\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x13\xC0\x14\x00\x9C\x00\x9D\x00/\x005\x01\x00\x01\xCD\xBA\xBA\x00\x00\x00\x0B\x00\x02\x01\x00\x00+\x00\x07\x06zz\x03\x04\x03\x03\x00\x05\x00\x05\x01\x00\x00\x00\x00Di\x00\x05\x00\x03\x02h2\xFF\x01\x00\x01\x00\x00#\x00\x00\x00\x17\x00\x00\x00\x12\x00\x00\x00" 400 157 "-" "-" "-" 2023-10-30 20:18:34.508855707 192.168.1.42 - - [30/Oct/2023:20:18:34 +0100] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03DT\x96\x04\xB4>\x16$\xB2\x9B\xEE\xDA+Z\xE5\xD4\x1F\xB9;\x80\xC6" 400 157 "-" "-" "-" 2023-10-30 20:18:34.509245796 192.168.1.42 - - [30/Oct/2023:20:18:34 +0100] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03G]\xF7\xDB\xCE\xD8\xBD\xB7H#|\x1A\x0F\x12\xB4\xA6Y>\xD5\xC2\x96" 400 157 "-" "-" "-"
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!