From 273d6191bd7e14173c29d81a98f74da9c2fc88c2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 01:07:21 +0000 Subject: [PATCH] Add VM config examples and Frigate NVR setup vm-configs/: - 100-frigate.conf.example: Frigate VM with Quadro P2200 #1, Coral USB, bays 1-8 - 101.conf.example: GPU VM with Quadro P2200 #2, bays 9-10 - 102.conf.example: Utility VM, bays 11-12 frigate/: - docker-compose.yml: nvidia runtime + Coral USB passthrough, healthcheck - config.yml: NVDEC hwaccel (preset-nvidia-h264), Coral USB detector, motion-based recording retain, per-object score thresholds https://claude.ai/code/session_01TxTSnxDjgEVuNztdsWQjMD --- frigate/config.yml | 94 +++++++++++++++++++++++++++++ frigate/docker-compose.yml | 39 ++++++++++++ vm-configs/100-frigate.conf.example | 55 +++++++++++++++++ vm-configs/101.conf.example | 35 +++++++++++ vm-configs/102.conf.example | 30 +++++++++ 5 files changed, 253 insertions(+) create mode 100644 frigate/config.yml create mode 100644 frigate/docker-compose.yml create mode 100644 vm-configs/100-frigate.conf.example create mode 100644 vm-configs/101.conf.example create mode 100644 vm-configs/102.conf.example diff --git a/frigate/config.yml b/frigate/config.yml new file mode 100644 index 0000000..6f4eb55 --- /dev/null +++ b/frigate/config.yml @@ -0,0 +1,94 @@ +# Frigate NVR configuration — VM 100 (Quadro P2200 + Google Coral USB) +# Docs: https://docs.frigate.video/configuration/ + +mqtt: + enabled: false # set to true and fill in host/port if you use Home Assistant or MQTT + +# ── Object detection ───────────────────────────────────────────────────────── +# Coral USB handles all inference; CPU usage for detection is near zero. +detectors: + coral: + type: edgetpu + device: usb + +# ── FFmpeg hardware decode (Quadro P2200 NVDEC) ─────────────────────────────── +# These presets tell ffmpeg to use the GPU for H.264/H.265 decode. +# CPU usage per stream drops from ~15–30% to ~1–2%. +ffmpeg: + hwaccel_args: preset-nvidia-h264 # default for H.264 cameras + # Per-camera override available if some cameras use H.265 — see cameras section below + +# ── Global detect settings ─────────────────────────────────────────────────── +detect: + enabled: true + width: 1280 + height: 720 + fps: 5 # Coral processes 5 fps for detection; recording captures full stream + +# ── Recording ──────────────────────────────────────────────────────────────── +record: + enabled: true + retain: + days: 7 + mode: motion # only keep segments with motion (saves disk) + events: + retain: + default: 14 # keep event clips for 14 days regardless of motion-only rule + mode: active_objects + +# ── Snapshots ──────────────────────────────────────────────────────────────── +snapshots: + enabled: true + timestamp: true + bounding_box: true + retain: + default: 14 + +# ── Object filter defaults ──────────────────────────────────────────────────── +objects: + track: + - person + - car + - dog + - cat + filters: + person: + min_area: 1500 # ignore very small detections (reduces false positives) + min_score: 0.6 + threshold: 0.7 + +# ── Cameras ────────────────────────────────────────────────────────────────── +# Add one entry per camera. Duplicate and adjust as needed. +# Use {FRIGATE_RTSP_PASSWORD} to reference the env var from docker-compose.yml. + +cameras: + front_door: + ffmpeg: + inputs: + - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.1.XXX/stream1 + roles: + - detect + - record + # Uncomment to override hwaccel for H.265 cameras: + # ffmpeg: + # hwaccel_args: preset-nvidia-h265 + + # back_yard: + # ffmpeg: + # inputs: + # - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.1.XXX/stream1 + # roles: + # - detect + # - record + +# ── Birdseye view (optional multi-camera overview) ──────────────────────────── +birdseye: + enabled: true + mode: motion # only show cameras with recent motion + +# ── Telemetry / stats ───────────────────────────────────────────────────────── +telemetry: + stats: + amd_gpu_stats: false + intel_gpu_stats: false + network_bandwidth: false diff --git a/frigate/docker-compose.yml b/frigate/docker-compose.yml new file mode 100644 index 0000000..fdf558d --- /dev/null +++ b/frigate/docker-compose.yml @@ -0,0 +1,39 @@ +services: + frigate: + container_name: frigate + image: ghcr.io/blakeblackshear/frigate:stable + restart: unless-stopped + privileged: true # needed for Coral USB device access + runtime: nvidia # NVIDIA Container Toolkit — enables NVDEC in ffmpeg + + shm_size: "256mb" # shared memory for decoded frame buffers + # increase to 512mb if running 8+ cameras + + environment: + NVIDIA_VISIBLE_DEVICES: all + NVIDIA_DRIVER_CAPABILITIES: compute,utility,video + # Set RTSP credentials here and reference as {FRIGATE_RTSP_PASSWORD} in config.yml + FRIGATE_RTSP_PASSWORD: "changeme" + + devices: + # Coral USB — exposes full USB bus so both pre/post-init VID:PIDs work + - /dev/bus/usb:/dev/bus/usb + + volumes: + - /etc/localtime:/etc/localtime:ro + - ./config.yml:/config/config.yml:ro + - /mnt/frigate:/media/frigate # recordings and snapshots — point at your drive mount + + ports: + - "5000:5000" # Frigate web UI + - "8554:8554" # RTSP restream + - "8555:8555/tcp" # WebRTC + - "8555:8555/udp" # WebRTC + + # healthcheck so docker knows when Frigate is actually ready + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5000/api/version"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s diff --git a/vm-configs/100-frigate.conf.example b/vm-configs/100-frigate.conf.example new file mode 100644 index 0000000..c595f9a --- /dev/null +++ b/vm-configs/100-frigate.conf.example @@ -0,0 +1,55 @@ +# Proxmox VM 100 — Frigate NVR +# +# Copy to /etc/pve/qemu-server/100.conf after filling in: +# - hostpci0: real PCI address from gpu-passthrough-setup.sh output +# - scsi1–scsi8: real /dev/disk/by-id paths from build-bay-map.sh output +# - net0: real MAC (Proxmox generates one; leave it if creating via UI) +# +# Requirements on the Proxmox host before starting this VM: +# 1. scripts/perc-nonraid.sh — drives in non-RAID mode +# 2. scripts/gpu-passthrough-setup.sh — IOMMU + vfio-pci active, host rebooted +# 3. Coral USB plugged in + +agent: 1 +bios: ovmf +boot: order=scsi0 +cores: 8 +cpu: host +machine: q35 +memory: 16384 +name: frigate +numa: 0 +ostype: l26 +scsihw: virtio-scsi-single +sockets: 1 + +# OS disk — on Proxmox local storage, adjust pool name as needed +scsi0: local-lvm:vm-100-disk-0,cache=writeback,size=64G + +# Data drives — bays 1–8, raw disk passthrough +# Fill in by-id paths from build-bay-map.sh +scsi1: /dev/disk/by-id/PLACEHOLDER_BAY1,size=0 +scsi2: /dev/disk/by-id/PLACEHOLDER_BAY2,size=0 +scsi3: /dev/disk/by-id/PLACEHOLDER_BAY3,size=0 +scsi4: /dev/disk/by-id/PLACEHOLDER_BAY4,size=0 +scsi5: /dev/disk/by-id/PLACEHOLDER_BAY5,size=0 +scsi6: /dev/disk/by-id/PLACEHOLDER_BAY6,size=0 +scsi7: /dev/disk/by-id/PLACEHOLDER_BAY7,size=0 +scsi8: /dev/disk/by-id/PLACEHOLDER_BAY8,size=0 + +# Quadro P2200 #1 — GPU passthrough +# Replace XX:00 with real PCI address (e.g. 03:00) +# pcie=1 uses PCIe bus; x-vga=1 passes primary display output +# Proxmox auto-includes the HDMI audio sibling (XX:00.1) +hostpci0: 0000:XX:00,pcie=1,x-vga=1 + +# Google Coral USB — pass both VID:PID values +# Coral re-enumerates after first inference load: 1a6e:089a → 18d1:9302 +usb0: host=1a6e:089a +usb1: host=18d1:9302 + +# Network +net0: virtio=BC:24:11:00:00:64,bridge=vmbr0,firewall=1 + +# EFI disk (required for OVMF/UEFI boot with q35 machine) +efidisk0: local-lvm:vm-100-disk-1,efitype=4m,pre-enrolled-keys=0,size=4M diff --git a/vm-configs/101.conf.example b/vm-configs/101.conf.example new file mode 100644 index 0000000..f763295 --- /dev/null +++ b/vm-configs/101.conf.example @@ -0,0 +1,35 @@ +# Proxmox VM 101 — General purpose with GPU +# +# Copy to /etc/pve/qemu-server/101.conf after filling in: +# - hostpci0: real PCI address of Quadro P2200 #2 +# - scsi1–scsi2: real /dev/disk/by-id paths for bays 9–10 + +agent: 1 +bios: ovmf +boot: order=scsi0 +cores: 8 +cpu: host +machine: q35 +memory: 16384 +name: vm101 +numa: 0 +ostype: l26 +scsihw: virtio-scsi-single +sockets: 1 + +# OS disk +scsi0: local-lvm:vm-101-disk-0,cache=writeback,size=64G + +# Data drives — bays 9–10 +scsi1: /dev/disk/by-id/PLACEHOLDER_BAY9,size=0 +scsi2: /dev/disk/by-id/PLACEHOLDER_BAY10,size=0 + +# Quadro P2200 #2 +# Replace XX:00 with real PCI address from gpu-passthrough-setup.sh output +hostpci0: 0000:XX:00,pcie=1,x-vga=1 + +# Network +net0: virtio=BC:24:11:00:00:65,bridge=vmbr0,firewall=1 + +# EFI disk +efidisk0: local-lvm:vm-101-disk-1,efitype=4m,pre-enrolled-keys=0,size=4M diff --git a/vm-configs/102.conf.example b/vm-configs/102.conf.example new file mode 100644 index 0000000..674e285 --- /dev/null +++ b/vm-configs/102.conf.example @@ -0,0 +1,30 @@ +# Proxmox VM 102 — Storage / utility VM +# +# Copy to /etc/pve/qemu-server/102.conf after filling in: +# - scsi1–scsi2: real /dev/disk/by-id paths for bays 11–12 + +agent: 1 +bios: ovmf +boot: order=scsi0 +cores: 4 +cpu: host +machine: q35 +memory: 8192 +name: vm102 +numa: 0 +ostype: l26 +scsihw: virtio-scsi-single +sockets: 1 + +# OS disk +scsi0: local-lvm:vm-102-disk-0,cache=writeback,size=32G + +# Data drives — bays 11–12 +scsi1: /dev/disk/by-id/PLACEHOLDER_BAY11,size=0 +scsi2: /dev/disk/by-id/PLACEHOLDER_BAY12,size=0 + +# Network +net0: virtio=BC:24:11:00:00:66,bridge=vmbr0,firewall=1 + +# EFI disk +efidisk0: local-lvm:vm-102-disk-1,efitype=4m,pre-enrolled-keys=0,size=4M