I have been using Frigate for a couple years now as my NVR and for camera alerting. It’s been great to use but also frustrating at times to set up. It’s gotten better over the years, but it’s still not user-friendly and definitely not something you should set up for your parents or grandparents.
I used to run Frigate in Unraid, but I recently dropped it in favor of TrueNAS for performance reasons. With this, an opportunity arose to migrate Frigate into my ProxMox virtual environment. The benefit of doing this would mean I can easily back up my frigate environment, I can migrate it to another machine if it fails, and I can easily test configs without worrying about losing my current config.
The easiest way to run Frigate is via Proxmox Helper Scripts as an LXC container. However, I recommend against that for several reasons.
- Upgrading Frigate isn’t easy. Sure, there’s an ‘upgrade’ command that you can run, but you don’t really have much control beyond that.
- Altering the config isn’t as straightforward.
- For some reason, detect performance isn’t as great as running in Docker mode.
Instead, what I recommend doing is running Frigate in a Docker container instead. This gives you several benefits:
- You can easily switch back and forth between versions with Docker + Compose
- Using Compose, you can customize the installation a bit easier
- You can still take advantage of GPU resource sharing by running it in an LXC
First, I use a Coral TPU unit installed in my M2 Wifi PCI slot. So, drivers need to be installed on the PVE Host. On the PVM host console, run the following:
|
|
Then install pve-headers and the PCIE driver and TPU runtime packages
|
|
Reboot the node (The entire system), then run:
|
|
It should return something like this:
|
|
Then verify that the driver loaded:
|
|
That should return:
|
|
The latest proxmox kernel breaks many of the coral drivers. To fix:
|
|
Then navigate to home and load the gasket driver
|
|
Perform all updates again
|
|
Then run ls /dev/apex_0
again and verify that it exists
Create Docker Image
Next, you’ll need to create a privileged LXC docker, and install portainer. (here’s where I did use Proxmox Helper Scripts):
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/docker.sh)"
In the host console, edit the hardware passthrough details:
|
|
Add in the following items to the config (make sure nothing is duplicated)
|
|
In portainer, create a frigate stack using the following docker compose:
|
|
Start it up and go to the web console at port 5000 to make sure the TPU and GPU are detected. Good to go!