Adding Coral TPU (USB) to frigate APP

GerritTSnail

Dabbler
Joined
Nov 12, 2022
Messages
11
I am starting a new thread about this since most other are talking about pcie version TPUs or not using the chart frigate app.

This problem is also crossposted to (partial solutions already reached) :
https://github.com/blakeblackshear/frigate/issues/5542
https://www.reddit.com/r/truenas/comments/1168n6e/comment/j95jnsp/?context=3


I am trying to add a coral TPU (USB version) to the chart app frigate.

First problem has been solved, you can best pass through the entire usb bus (cite: https://github.com/NickM-27)
1676838038159.png


Now we need driver for the TPU since it just shows up as an urecognised device.
https://coral.ai/docs/accelerator/get-started/#requirements
I installed this using the shell in the docker container itself and replugged the TPU as stated in the guide. The TPU still does not show up in the container but i get these errors on the truenas host. It has been confirmed to me this is normal.
cap1

So the conclusion seems to be the drivers need to be installed on the truenas host itself.
However, I noticed apt became disabled and all post on this topic state not to install thing yourself on an "appliance" like truenas.
Now what should i do?
What risks does installing this on the host realistically bring ( apt update and installing usbutils, curl, gnupg2 and the tpu drivers)?
I understand that doing things like apt upgrade could f things up but could the things above?
An lastly how would i automate this install after updates?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I can imagine that there will be more than just this app with the potential for using a TPU, so perhaps you should aim to have it included in the appliance by logging a request in Jira.
 

GerritTSnail

Dabbler
Joined
Nov 12, 2022
Messages
11
I can imagine that there will be more than just this app with the potential for using a TPU, so perhaps you should aim to have it included in the appliance by logging a request in Jira.
I will do but what should i do in the meantime? Would having it already installed on the host cause problems when they add it?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Not much danger in having a go, since you can always just rebuild and restore config.
 

GerritTSnail

Dabbler
Joined
Nov 12, 2022
Messages
11
Not much danger in having a go, since you can always just rebuild and restore config.
Thanks i will do. Just to make sure, if i make a backup now before I start trying thing out i can always get back to a clean rebuild. But the backups I make after the installs of the drivers,... can also not be affected by these installs?
I am just really unsure about trying things out on my primary server. (I periodically backup the configs and have a weekly offsite backups so maybe i should not be freaking out so much haha)
 

GerritTSnail

Dabbler
Joined
Nov 12, 2022
Messages
11
So this thing got even less understandable and i am going mad over it.
I installed the drivers on the host and the tpu is detected OK
lsusb host

In the frigate container i can no matter what make it being detected correctly.
lsusb frigate

Even weirder, a reddit user also using the chart frigate app states he did not need to install driver. They were included in the docker container.
https://www.reddit.com/r/truenas/comments/1168n6e/comment/j9ks5y2/?context=3

I am not able to make anything of this.
 

simdim

Explorer
Joined
Mar 12, 2019
Messages
75
I know this is stale , but I just got USB Coral to run in frigate APP, is there any consensus how to make it work?
 

FalseSAN

Cadet
Joined
Dec 8, 2023
Messages
3
Me too. waiting for some action.

I installed Frigate and had everything working fine. Detection was amazing, with TruNAS barely breaking a sweat. It worked fine for over a week, then one reboot and it was all over. Now Coral is no longer detected. This is very frustrating since Frigate is advertised with and build for coral. It's like having a bike without the front wheel.
 

simdim

Explorer
Joined
Mar 12, 2019
Messages
75
I had solved it by offering complete /dev to frigate

Screenshot 2023-12-07 at 5.47.29 PM.png


And it works like charm
Screenshot 2023-12-08 at 5.17.12 PM.png
 

FalseSAN

Cadet
Joined
Dec 8, 2023
Messages
3
What version of scale are you running? I have a checkbox to mount USB bus, and a place for env var after that. It doesn't look like yours
I'm running TrueNAS-SCALE-23.10.0.1
 

simdim

Explorer
Joined
Mar 12, 2019
Messages
75
I am running TrueCharts version:
Name:
frigate
App Version:
0.12.1
Chart Version:
10.1.9

On Scale TrueNAS-SCALE-23.10.0.1

Did not have any luck with TrueNAS version
 

dannas

Cadet
Joined
Jan 12, 2022
Messages
4
I've been staring at this so long I don't know which way is up. Simdim, did you install drivers, or make any changes other than mapping /dev /dev?
 

simdim

Explorer
Joined
Mar 12, 2019
Messages
75
I've been staring at this so long I don't know which way is up. Simdim, did you install drivers, or make any changes other than mapping /dev /dev?
No changes, no drivers just /dev /dev . Truecharts app was another critical component.
 

FalseSAN

Cadet
Joined
Dec 8, 2023
Messages
3
No changes, no drivers just /dev /dev . Truecharts app was another critical component.
This didn't work for me. I spent hours trying to get Truechart version to see Coral. I finally tried going back to the truenas charts version, and it worked on the second try. I worry it will fail at some reboot down the line, but at least its working again for now. I really need to mount the data directory somewhere else so it will persist across the inevitable re-installs. :mad:
 
Joined
Mar 22, 2020
Messages
61
I have also tried to get the coral usb to work but to no luck. How did you do who was able to get it to work? Just install the frigate app in truechart or truenas version and not installing any drivers in truenas scale? What other things did you do to make it work? Very frustrated to get the usb stick to work on the truenas scale with the frigate app at the moment :-(
(running TrueNAS-22.12.3.3 at the moment)
 

li_chang

Dabbler
Joined
May 31, 2017
Messages
35
I have also tried to get the coral usb to work but to no luck. How did you do who was able to get it to work? Just install the frigate app in truechart or truenas version and not installing any drivers in truenas scale? What other things did you do to make it work? Very frustrated to get the usb stick to work on the truenas scale with the frigate app at the moment :-(
(running TrueNAS-22.12.3.3 at the moment)
Hi,

Have you tried installing via "Launch Docker Image" with "Privileged Mode" enabled? I've been running two Frigate containers in two different hosts for months with Coral USB and it's working.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Except that Launch Docker no longer exists in Cobia
 
Joined
Mar 22, 2020
Messages
61
Hi,

Have you tried installing via "Launch Docker Image" with "Privileged Mode" enabled? I've been running two Frigate containers in two different hosts for months with Coral USB and it's working.
Guess you are running truecharts version then? Not possible to use privileged mode on truenas version
And have you installed the Coral USB drivers on the truenas server or how does it recognize the coral device otherwise?

Edit: I havent tried to do it via launch docker image, just through the normal app install. How do I do it through launch docker image? Is there some guide somewhere to find out how that works? And does that fix the Coral USB driver issue then?


1702574923632.png
 
Last edited:
Top