blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
17.99k stars 1.64k forks source link

[Detector Support]: Connect 2 Coral USB - Frigate (crash) restart 6-7-8 times in day #6095

Closed antonbek89 closed 1 year ago

antonbek89 commented 1 year ago

Describe the problem you are having

Hey I have situation when I'm trying connect 2 Coral USB to my system, after couple of hour/s the docker crash and doing restart On the system tab I can see actualy the 2 Coral and they work for sure (the light is blinking both of them)

With one Coral USB everything working good for days/weeks I not have any logs to share from Frigate cause when its happened its new log

I used PC Mother board - H310 s2h 2.0 (if its relevant)

Version

0.12.0-DA3E197

Frigate config file

mqtt:
  host: 192.168.1.187
  user: "mqttuser"
  password: "test"

detectors:
  coral1:
    type: edgetpu
    device: usb:0
  coral2:
    type: edgetpu
    device: usb:1

cameras:
 GardenOne:
   ffmpeg:
#      hwaccel_args: preset-vaapi
      hwaccel_args: preset-nvidia-h264
      input_args:
         - -avoid_negative_ts
         - make_zero
         - -fflags
         - nobuffer+genpts+discardcorrupt
         - -flags
         - low_delay
         - -strict
         - experimental
         - -analyzeduration
         - 1000M
         - -probesize
         - 1000M
         - -rw_timeout
         - "5000000"
      inputs:
          - path: http://192.168.1.108/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=test&password=test
            roles:
              - record
              - rtmp
          - path: http://192.168.1.108/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=test&password=test
            roles:
              - detect
      output_args:
        record: preset-record-generic-audio-aac
   detect:
     width: 1920
     height: 1080
     fps: 20
   rtmp:
     enabled: false

   objects:
     track:
       - person
       - dog
       - cat
     filters:
       person:
         threshold: 0.70

   snapshots:
     enabled: true
     timestamp: false
     bounding_box: false
     crop: False
     height: 900
     retain:
       default: 14

   record:
     enabled: true
     retain:
       days: 4
     events:
       pre_capture: 10
       post_capture: 15
       objects:
         - person
         - cat
         - dog
       retain:
         default: 14

docker-compose file or Docker CLI command

version: "3.9"
services:
  frigate:
    container_name: frigateNvidia
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:stable
    deploy:    # <------------- Add this section
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1 # number of GPUs
              capabilities: [gpu]
https://coral.ai/docs/m2/get-started/#2a-on-linux

    devices:
      - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware

    shm_size: "512mb" # update for your cameras based on calculation above
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /home/a/Downloads/frigateNvidia/config/config.yml:/config/config.yml
      - /home/a/Downloads/frigateNvidia/media/frigate:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000

    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp

Relevant log output

2023-04-15 23:31:54.877705911  [INFO] Starting Frigate...
2023-04-15 23:31:55.783229555  [2023-04-15 23:31:55] frigate.app                    INFO    : Starting Frigate (0.12.0-da3e197)
2023-04-15 23:31:55.853959208  [2023-04-15 23:31:55] peewee_migrate                 INFO    : Starting migrations
2023-04-15 23:31:55.858807366  [2023-04-15 23:31:55] peewee_migrate                 INFO    : There is nothing to migrate
2023-04-15 23:31:55.872171298  [2023-04-15 23:31:55] detector.coral1                INFO    : Starting detection process: 365
2023-04-15 23:31:59.289409242  [2023-04-15 23:31:55] frigate.app                    INFO    : Output process started: 369
2023-04-15 23:32:00.294401820  [2023-04-15 23:31:55] detector.coral2                INFO    : Starting detection process: 367
2023-04-15 23:32:00.298019792  [2023-04-15 23:31:55] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb:0
2023-04-15 23:32:00.298024597  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for GardenOne: 377
2023-04-15 23:32:00.298030089  [2023-04-15 23:31:59] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-04-15 23:32:00.298031971  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for GardenTwo: 380
2023-04-15 23:32:00.298043771  [2023-04-15 23:31:55] frigate.comms.dispatcher       INFO    : Turning on recordings for Hall
2023-04-15 23:32:00.298045333  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for Garden: 384
2023-04-15 23:32:00.298046742  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for Entrance: 387
2023-04-15 23:32:00.298056980  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for test: 390
2023-04-15 23:32:00.298058231  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for Warehouse: 391
2023-04-15 23:32:00.298059376  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for test2: 392
2023-04-15 23:32:00.298065410  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for Hall: 393
2023-04-15 23:32:00.298066530  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for LivingRoom: 394
2023-04-15 23:32:00.298067714  [2023-04-15 23:31:55] frigate.app                    INFO    : Camera processor started for test3: 395
2023-04-15 23:32:00.298068791  [2023-04-15 23:31:55] frigate.app                    INFO    : Capture process started for GardenOne: 396
2023-04-15 23:32:00.298075625  [2023-04-15 23:31:55] frigate.app                    INFO    : Capture process started for GardenTwo: 397
2023-04-15 23:32:00.298076747  [2023-04-15 23:31:55] frigate.app                    INFO    : Capture process started for Garden: 399
2023-04-15 23:32:00.298077901  [2023-04-15 23:31:55] frigate.app                    INFO    : Capture process started for Entrance: 404
2023-04-15 23:32:00.298078992  [2023-04-15 23:31:55] frigate.app                    INFO    : Capture process started for test: 405
2023-04-15 23:32:00.298080038  [2023-04-15 23:31:55] frigate.app                    INFO    : Capture process started for Warehouse: 417
2023-04-15 23:32:00.298088312  [2023-04-15 23:31:55] frigate.app                    INFO    : Capture process started for test2: 420
2023-04-15 23:32:00.298089415  [2023-04-15 23:31:56] frigate.app                    INFO    : Capture process started for Hall: 423
2023-04-15 23:32:00.298090535  [2023-04-15 23:31:56] frigate.app                    INFO    : Capture process started for LivingRoom: 434
2023-04-15 23:32:00.298091735  [2023-04-15 23:31:56] frigate.app                    INFO    : Capture process started for test3: 444
2023-04-15 23:32:00.298693220  [2023-04-15 23:31:55] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb:1
2023-04-15 23:32:00.298695190  [2023-04-15 23:32:00] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-04-15 23:32:16.097532016  [2023-04-15 23:32:16] watchdog.GardenOne             INFO    : GardenOne exceeded fps limit. Exiting ffmpeg...
2023-04-15 23:32:16.097752044  [2023-04-15 23:32:16] watchdog.GardenOne             INFO    : Waiting for ffmpeg to exit gracefully...
2023-04-15 23:32:16.101472272  [2023-04-15 23:32:16] watchdog.GardenTwo             INFO    : GardenTwo exceeded fps limit. Exiting ffmpeg...
2023-04-15 23:32:16.101671471  [2023-04-15 23:32:16] watchdog.GardenTwo             INFO    : Waiting for ffmpeg to exit gracefully...
2023-04-15 23:32:16.167633506  [2023-04-15 23:32:16] frigate.video                  ERROR   : GardenTwo: Unable to read frames from ffmpeg process.
2023-04-15 23:32:16.167792246  [2023-04-15 23:32:16] frigate.video                  ERROR   : GardenTwo: Unable to read frames from ffmpeg process.
2023-04-15 23:32:16.167952280  [2023-04-15 23:32:16] frigate.video                  ERROR   : GardenTwo: ffmpeg process is not running. exiting capture thread...
2023-04-15 23:32:16.231483682  [2023-04-15 23:32:16] frigate.video                  ERROR   : GardenOne: Unable to read frames from ffmpeg process.
2023-04-15 23:32:16.231654162  [2023-04-15 23:32:16] frigate.video                  ERROR   : GardenOne: ffmpeg process is not running. exiting capture thread...

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

if it is only an issues with two corals then most likely it is a power issue and your system is not able to provide enough power for both

antonbek89 commented 1 year ago

I have 650w power supply How many Wat one Coral take ? And the problem is with the mother board (he don't give to sub port enough power) or with power supply ?

NickM-27 commented 1 year ago

the problem will be with the USB power delivery, power supply itself in your case would be irrelevant. You may want to see if you can split the USBs between two different USB BUS or try a powered USB hub.

abensimon86 commented 1 year ago

the problem will be with the USB power delivery, power supply itself in your case would be irrelevant. You may want to see if you can split the USBs between two different USB BUS or try a powered USB hub.

You right as usual (: I connected each Coral to different BUS usb and its work ok !

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.