[Bug]: GenAI stops working when detection is stuck and restarted #18283
-
Checklist
Describe the problem you are havingEvery now and then my detection process restarts. In the log a message appears that detection seems to be stuck after which the process is restarted. From that moment on GenAI doesn't work anymore until I restart Frigate. Setup: The issue is not that detection gets stuck. I've had that on a NUC as well. The problem is that GenAI stops working after the detection process is restarted. Steps to reproduceN/A Version0.15.0-6cb5cfb In which browser(s) are you experiencing the issue with?Safari Frigate config filetls:
enabled: False
mqtt:
host: IP
user: USER
password: PASSWORD
client_id: frigate
database:
path: /db/frigate.db
detectors:
coral1:
type: edgetpu
ffmpeg:
hwaccel_args: preset-intel-qsv-h264
input_args: preset-rtsp-restream
birdseye:
enabled: true
mode: continuous
objects:
track:
- person
filters:
person:
threshold: 0.7
min_area: 5000
max_area: 100000
detect:
width: 1280
height: 720
record:
enabled: true
retain:
days: 14
mode: all
alerts:
retain:
days: 31
mode: motion
pre_capture: 3
post_capture: 10
detections:
retain:
days: 31
mode: motion
pre_capture: 3
post_capture: 10
snapshots:
enabled: true
retain:
default: 31
review:
alerts:
labels:
- person
- car
- bicycle
ui:
time_format: 24hour
genai:
enabled: True
provider: ollama
base_url: http://IP:11434
model: qwen2.5vl:7b-q8_0
# prompt: "Analyze the {label} in these images from the {camera} security camera. Focus on the actions, behavior, and potential intent of the {label}, rather than just describing its appearance."
object_prompts:
person: "Examine the main person in these images. Your answer should be in bullet points: - Activity: Short description of what they are doing and what might their actions suggest about their intent (e.g., approaching a door, leaving an area, standing still)? Do not describe the surroundings or static details. - Clothes: A list of the clothes and their colors. - Delivery: If the person is from a delivery company (is the person carrying one or more packages of letters?"
car: "Observe the primary vehicle in these images. Focus on its movement, direction, or purpose (e.g., parking, approaching, circling). If it's a delivery vehicle, mention the company. Mention the licence plate when visible."
bicycle: "Examine the bicycle in these images. Focus on its movement, direction, or purpose (e.g., cycling by, approaching, stopping). Describe the person riding the bicycle. Give a list of the clothes and their colors. If its a person from a delivery company, name the company. To help you determine the company: a person with mainly orange clothes is from PostNL. A person wearing a combination of red en yellow is from DHL."
go2rtc:
streams:
Parkeerplaats:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Parkeerplaats_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
Oprit_voor:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Oprit_voor_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
Voordeur:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Voordeur_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
Oprit_achter:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Oprit_achter_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
Garage_voor:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Garage_voor_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
Garage_achter:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Garage_achter_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
Achtertuin:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Achtertuin_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
Dak_serre:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/101
Dak_serre_sub:
- rtsp://USER:PASSWORD@IP:554/Streaming/Channels/102
cameras:
### PARKEERPLAATS #################################################################
Parkeerplaats:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Parkeerplaats
roles:
- record
- path: rtsp://127.0.0.1:8554/Parkeerplaats_sub
roles:
- detect
review:
detections:
required_zones: Parkeerplaats_straat
alerts:
required_zones: Parkeerplaats_oprit
objects:
track:
- person
- bicycle
- car
filters:
person:
mask: 0.846,1,1,1,1,0.697,0.871,0.737
threshold: 0.7
min_area: 5000
max_area: 100000
zones:
Parkeerplaats_oprit:
coordinates: 1,0.309,1,1,0,1,0,0.474,0,0.329
inertia: 3
loitering_time: 0
objects:
- bicycle
- person
Parkeerplaats_straat:
coordinates: 1,0,1,0.291,0,0.309,0,0
inertia: 3
loitering_time: 0
motion:
mask:
- 0,0.005,0.247,0,0.244,0.048,0.161,0.044,0.173,0.157,0.224,0.15,0.168,0.221,0,0.587
- 1,0,0.782,0,0.769,0.146,0.88,0.449,1,0.525
ui:
order: 1
birdseye:
order: 1
### OPRIT VOOR #################################################################
Oprit_voor:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Oprit_voor
roles:
- record
- path: rtsp://127.0.0.1:8554/Oprit_voor_sub
roles:
- detect
motion:
mask:
- 0,25,0,0,309,0,310,29
ui:
order: 2
birdseye:
order: 2
### VOORDEUR #################################################################
Voordeur:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Voordeur
roles:
- record
- path: rtsp://127.0.0.1:8554/Voordeur_sub
roles:
- detect
motion:
mask: 0,0,0.244,0,0.246,0.051,0,0.054
ui:
order: 3
birdseye:
order: 3
### OPRIT ACHTER #################################################################
Oprit_achter:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Oprit_achter
roles:
- record
- path: rtsp://127.0.0.1:8554/Oprit_achter_sub
roles:
- detect
objects:
filters:
person:
threshold: 0.7
min_area: 5000
max_area: 100000
motion:
mask:
- 0,693,0,659,305,656,308,684
- 0,466,0,28,41,45,64,435
ui:
order: 4
birdseye:
order: 4
### GARAGE VOOR #################################################################
Garage_voor:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Garage_voor
roles:
- record
- path: rtsp://127.0.0.1:8554/Garage_voor_sub
roles:
- detect
objects:
track:
- person
filters:
person:
threshold: 0.8
min_area: 5000
max_area: 100000
motion:
mask:
- 0,0,0,37,367,39,369,0
ui:
order: 5
birdseye:
order: 5
### GARAGE ACHTER #################################################################
Garage_achter:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Garage_achter
roles:
- record
- path: rtsp://127.0.0.1:8554/Garage_achter_sub
roles:
- detect
objects:
track:
- person
filters:
person:
threshold: 0.8
min_area: 5000
max_area: 100000
motion:
mask: 0,0,0,0.036,0.243,0.036,0.244,0
ui:
order: 6
birdseye:
order: 6
### ACHTERTUIN #################################################################
Achtertuin:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Achtertuin
roles:
- record
- path: rtsp://127.0.0.1:8554/Achtertuin_sub
roles:
- detect
motion:
mask: 0.242,0,0,0,0,0.054,0.242,0.046
ui:
order: 7
birdseye:
order: 7
### DAK SERRE #################################################################
Dak_serre:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/Dak_serre
roles:
- record
- path: rtsp://127.0.0.1:8554/Dak_serre_sub
roles:
- detect
motion:
mask: 0,0,0.242,0,0.243,0.04,0,0.037
objects:
track:
- person
filters:
person:
threshold: 0.7
min_area: 5000
max_area: 100000
mask: 0.594,0.331,0.709,0.323,0.703,0.565,0.595,0.57
ui:
order: 8
birdseye:
order: 8
version: 0.15-1
camera_groups:
Voortuin:
order: 1
icon: LuCar
cameras:
- Oprit_achter
- Oprit_voor
- Parkeerplaats
- Voordeur
Achtertuin:
order: 2
icon: LuTreeDeciduous
cameras:
- Achtertuin
- Dak_serre
Garage:
order: 3
icon: LuBike
cameras:
- Garage_achter
- Garage_voor
semantic_search:
enabled: true
reindex: false
model_size: largedocker-compose file or Docker CLI commandfrigate:
container_name: frigate
privileged: true
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "512mb"
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/config:/config
- /media/frigate:/media/frigate
- /opt/frigate/db:/db
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 4000000000
ports:
- 5000:5000
- 1935:1935
- 8554:8554Relevant Frigate log output2025-05-18 11:36:53.503667817 [2025-05-18 11:36:53] frigate.app INFO : Embedding process started: 350
2025-05-18 11:36:53.512838285 [2025-05-18 11:36:53] frigate.app INFO : Output process started: 373
2025-05-18 11:36:53.613501797 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Parkeerplaats: 387
2025-05-18 11:36:53.613504069 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Oprit_voor: 388
2025-05-18 11:36:53.630086298 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Voordeur: 403
2025-05-18 11:36:53.639429137 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Oprit_achter: 407
2025-05-18 11:36:53.640633719 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Garage_voor: 412
2025-05-18 11:36:53.648880850 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Garage_achter: 417
2025-05-18 11:36:53.663081990 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Achtertuin: 429
2025-05-18 11:36:53.663084173 [2025-05-18 11:36:53] frigate.app INFO : Camera processor started for Dak_serre: 435
2025-05-18 11:36:53.682609178 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Parkeerplaats: 452
2025-05-18 11:36:53.689662062 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Oprit_voor: 456
2025-05-18 11:36:53.697613573 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Voordeur: 459
2025-05-18 11:36:53.702332707 �[1;31m2025-05-18 11:36:53.700057350 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 461, index: 1, mask: {8, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.702335087 �[1;31m2025-05-18 11:36:53.700750481 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 462, index: 2, mask: {9, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.702503605 �[1;31m2025-05-18 11:36:53.702394387 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 463, index: 3, mask: {10, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.705364056 �[1;31m2025-05-18 11:36:53.705357028 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 464, index: 4, mask: {11, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.710710242 �[1;31m2025-05-18 11:36:53.709341324 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 465, index: 5, mask: {2, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.712597114 �[1;31m2025-05-18 11:36:53.712534409 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 466, index: 6, mask: {3, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.716350665 �[1;31m2025-05-18 11:36:53.716339223 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 468, index: 8, mask: {5, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.716823738 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Oprit_achter: 481
2025-05-18 11:36:53.717463969 �[1;31m2025-05-18 11:36:53.717445639 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 469, index: 9, mask: {12, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.719446327 �[1;31m2025-05-18 11:36:53.719437837 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 470, index: 10, mask: {13, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.724503342 �[1;31m2025-05-18 11:36:53.724493599 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 471, index: 11, mask: {14, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.726542282 �[1;31m2025-05-18 11:36:53.726534459 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 472, index: 12, mask: {15, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.729656114 �[1;31m2025-05-18 11:36:53.729541211 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 473, index: 13, mask: {16, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.738344679 �[1;31m2025-05-18 11:36:53.738334130 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 474, index: 14, mask: {17, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.750349246 �[1;31m2025-05-18 11:36:53.750334887 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 475, index: 15, mask: {18, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.755342308 �[1;31m2025-05-18 11:36:53.755331737 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 476, index: 16, mask: {19, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.760349977 �[1;31m2025-05-18 11:36:53.760333848 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 477, index: 17, mask: {6, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.760635155 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Garage_voor: 485
2025-05-18 11:36:53.760744596 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Garage_achter: 487
2025-05-18 11:36:53.764402376 �[1;31m2025-05-18 11:36:53.764332324 [E:onnxruntime:Default, env.cc:234 ThreadMain] pthread_setaffinity_np failed for thread: 478, index: 18, mask: {7, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m
2025-05-18 11:36:53.849576966 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Achtertuin: 494
2025-05-18 11:36:53.849578922 [2025-05-18 11:36:53] frigate.app INFO : Capture process started for Dak_serre: 513
2025-05-18 11:36:54.053528645 [2025-05-18 11:36:53] frigate.api.fastapi_app INFO : Starting FastAPI app
2025-05-18 11:36:54.336210345 [2025-05-18 11:36:54] frigate.api.fastapi_app INFO : FastAPI started
2025-05-18 11:36:55.878134737 [2025-05-18 11:36:55] httpx INFO : HTTP Request: POST http://192.168.3.41:11434/api/show "HTTP/1.1 200 OK"
2025-05-18 11:36:56.222744867 [2025-05-18 11:36:53] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as auto
2025-05-18 11:36:56.226146910 [2025-05-18 11:36:56] frigate.detectors.plugins.edgetpu_tfl INFO : TPU foundRelevant go2rtc log outputN/AOperating systemProxmox Install methodDocker Compose Network connectionWired Camera make and modelAnnke Screenshots of the Frigate UI's System metrics pages
Any other information that may be helpfulI just restarted frigate, so the message that detection appears to be stuck is gone. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 16 replies
-
|
We will need to see logs when this happens, these two processes are entirely unrelated so it seems odd one would affect the other |
Beta Was this translation helpful? Give feedback.
-
|
@NickM-27 Thanks for the reply. This morning it happened again. Please find attached the log file, a screenshot right before detection got stuck and a screenshot of the first event after the detection proces was restarted. The first screenshots does contain a GenAI description and the second one doesn't. If the processes are unrelated, maybe it is al problem with my setup.
|
Beta Was this translation helpful? Give feedback.
-
|
You should check your Ollama logs. All Frigate is doing is passing off a request to your Ollama server through the Ollama API. |
Beta Was this translation helpful? Give feedback.
-
|
I checked the Ollama logs. My interpretation is that at 8:23 the Ollama server loads the model and responds (screenshot 1 of previous post). At 8:27 it is not getting a request from Frigate (screenshot 2 of previous post). I'm not expecting full support on Frigate and Ollama from you. So if you think it might be my setup or something else I thank you for the replies and will close the issue. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks again for the quick reply! I made a mistake in my post regarding the GPU. That is passed to the Ollama LXC, not the Frigate LXC. I'll turn the logger and see if anything comes up. |
Beta Was this translation helpful? Give feedback.
-
|
I seem to have the same problem, did you solve yours? I've tried with both local ollama as well as Gemini. Running 0.16.1. |
Beta Was this translation helpful? Give feedback.





@hawkeye217 You are absolutely correct. This is the problem indeed. The command:
dmesg | grep frigatecontains the messageMemory cgroup out of memory: Killed process 19071 (frigate.embeddi) total-vm:15678032kB, anon-rss:3506692kB, file-rss:1520kB, shmem-rss:0kB, UID:100000 pgtables:9084kB oom_score_adj:0.I increased the memory of the LXC to 12GB (7 camera's 4MP and 1 4K with all embeddings enabled with the large models) and will check if this solves the problem. Thanks!
@mk1blacklimited : maybe this will solve your problem as well.
EDIT:
To be complete, should anyone else have the same problem and find this tread. I had some corrupt/missing clips. They were causing a problem with the sp…