mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 22:57:40 +03:00
When running inside LXC containers (e.g. Proxmox), onnxruntime's thread pool tries to call pthread_setaffinity_np() which fails with EINVAL (error 22). Setting intra/inter_op_num_threads=1 when OMP_NUM_THREADS=1 is set prevents this error and stabilizes ML inference (face_recognition, semantic_search, classification) in containerized environments. Document OMP_NUM_THREADS=1 in docker-compose.yml as a commented option for LXC deployments. Fixes #22620
47 lines
1.7 KiB
YAML
47 lines
1.7 KiB
YAML
services:
|
|
devcontainer:
|
|
container_name: frigate-devcontainer
|
|
# Check host system's actual render/video/plugdev group IDs with 'getent group render', 'getent group video', and 'getent group plugdev'
|
|
# Must add these exact IDs in container's group_add section or OpenVINO GPU acceleration will fail
|
|
group_add:
|
|
- "109" # render
|
|
- "110" # render
|
|
- "44" # video
|
|
- "46" # plugdev
|
|
shm_size: "256mb"
|
|
build:
|
|
context: .
|
|
dockerfile: docker/main/Dockerfile
|
|
# Use target devcontainer-trt for TensorRT dev
|
|
target: devcontainer
|
|
## Uncomment this block for nvidia gpu support
|
|
# deploy:
|
|
# resources:
|
|
# reservations:
|
|
# devices:
|
|
# - driver: nvidia
|
|
# count: 1
|
|
# capabilities: [gpu]
|
|
environment:
|
|
YOLO_MODELS: ""
|
|
# Set OMP_NUM_THREADS=1 when running in LXC containers (e.g. Proxmox) to prevent
|
|
# onnxruntime from calling pthread_setaffinity_np(), which fails in LXC with EINVAL.
|
|
# This affects face_recognition, semantic_search, and classification features.
|
|
# OMP_NUM_THREADS: "1"
|
|
# devices:
|
|
# - /dev/bus/usb:/dev/bus/usb # Uncomment for Google Coral USB
|
|
# - /dev/dri:/dev/dri # for intel hwaccel, needs to be updated for your hardware
|
|
volumes:
|
|
- .:/workspace/frigate:cached
|
|
- ./web/dist:/opt/frigate/web:cached
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- ./config:/config
|
|
- ./debug:/media/frigate
|
|
# - /dev/bus/usb:/dev/bus/usb # Uncomment for Google Coral USB
|
|
mqtt:
|
|
container_name: mqtt
|
|
image: eclipse-mosquitto:2.0
|
|
command: mosquitto -c /mosquitto-no-auth.conf # enable no-auth mode
|
|
ports:
|
|
- "1883:1883"
|