Frigate app: Fails to restart after config save

Sometimes a Frigate app update, cosmic rays, or other like events can lead to the app not being happy with your config file, followed by Frigate going into an error log spam rage cycle. For those of you who managed to get Frigate to work reliably, I have nothing but respect.

While waiting on a fix, I switched to a custom YAML app, which solved the issue – and a few other things only seemed to work this way per the docs.

Context: I’m on an AMD GPU. Initially I wasn’t using it for detection, but the docs recommend the stable-rocm image instead of the default. After switching, I also discovered the community app doesn’t map /dev/kfd, and without it hardware acceleration for detection won’t work.

In the end, I deployed via a custom Compose file:

services:
  frigate:
    container_name: frigate
    privileged: false
    restart: unless-stopped
    stop_grace_period: 30s
    image: ghcr.io/blakeblackshear/frigate:stable-rocm
    shm_size: "512mb"
    devices:
      - /dev/dri
      - /dev/kfd
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /mnt/SSDs/Applications/frigate/config:/config
      - /mnt/HDDs/Applications/frigate/media:/media/frigate
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "30193:8971"
      - "8554:8554"
      - "8555:8555/tcp"
      - "8555:8555/udp"
    environment:
      FRIGATE_RTSP_PASSWORD: "password"
      HSA_OVERRIDE_GFX_VERSION: "11.0.0"
x-portals:
  - host: 0.0.0.0
    name: Web UI
    path: /
    port: 30193
    scheme: https

I also added a few config tweaks:

detectors:
  onnx:
    type: onnx

model:
  model_type: yolo-generic
  width: 320
  height: 320
  input_tensor: nchw
  input_dtype: float
  path: /config/model_cache/yolov9-m.onnx
  labelmap_path: /labelmap/coco-80.txt

Finally, I set the app’s icon using the tips in How to change icon of custom app? - #31 by houndtt.

With these changes, the app now runs smoothly, and config saves/restarts are clean.

1 Like

As a quick update: thanks to the work in frigate: add kill cap by stavros-k · Pull Request #2998 · truenas/apps · GitHub, the Frigate app (v1.2.12, released today) now supports in-app restarts, and they’re working as expected.