frigate: [Detector Support]: Fatal Python error: Segmentation fault

Describe the problem you are having

Launching v13 with NVIDIA branch causes a bootloop with the above error and no other explanation. I was told in a different support ticket that my NVIDIA driver version was too new

I have since downgraded to Driver v535.129.03 which is supposedly stable according to the last ticket I opened (https://github.com/blakeblackshear/frigate/issues/9575)

The error still is present.

Version

v13

Frigate config file

mqtt:
  enabled: true
  host: 192.168.1.102
  user: frigate
  password: PASSWORD

# detectors:
#  cpu1:
#    type: cpu
#    num_threads: 2

# birdseye:
#   enabled: True
#   restream: false
#   mode: continuous
#   width: 1280
#   height: 720
#   quality: 8

go2rtc:
  streams:
    Rear_Deck:
      - rtsp://admin:PASSWORD@192.168.1.114:554/h264Preview_01_main
    Rear_Deck_sub:
      - rtsp://admin:PASWWROD@192.168.1.114:554/h264Preview_01_sub
    Garage_Camera:
      - rtsp://admin:PASSWORD@192.168.1.215:554/cam/realmonitor?channel=1&subtype=0
    Garage_Camera_sub:
     - rtsp://admin:PASSWORD@192.168.1.215:554/cam/realmonitor?channel=1&subtype=1

ffmpeg:
  hwaccel_args: preset-nvidia-h265

rtmp:
  enabled: False 

cameras:
############## REAR DECK ##################
  Rear_Deck:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Rear_Deck_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/Rear_Deck
          input_args: preset-rtsp-restream
          roles:
            - record
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
    objects:
      track:
        - person
        - dog
        - bird
        - cat
    detect:
      width: 1280
      height: 720
      fps: 4
    record:
      enabled: True
      events:
        retain:
          default: 2
    snapshots:
      enabled: True

  Garage_Camera:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Garage_Camera_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/Garage_Camera
          input_args: preset-rtsp-restream
          roles:
            - record
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
        # record: preset-record-generic-audio-aac
    objects:
      track:
        - person
        - dog
        - cat
        - car
        - package
    detect:
      width: 1280
      height: 720
      fps: 4
    record:
      enabled: True
      events:
        retain:
          default: 2
    snapshots:
      enabled: True

docker-compose file or Docker CLI command

docker run
  -d
  --name='frigate'
  --net='bridge'
  -e TZ="America/New_York"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="CozsNAS"
  -e HOST_CONTAINERNAME="frigate"
  -e 'FRIGATE_RTSP_PASSWORD'='********!'
  -e 'PLUS_API_KEY'='********'
  -e 'NVIDIA_VISIBLE_DEVICES'='GPU-53a3b891-6d7b-8fe8-bd57-9467c8797875'
  -e 'NVIDIA_DRIVER_CAPABILITIES'='compute,utility,video'
  -e 'YOLO_MODELS'='yolov4-416,yolov4-tiny-416'
  -e 'USE_FP16'='false'
  -e 'TRT_MODEL_PREP_DEVICE'='0'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:5000]'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/yayitazale/unraid-templates/main/frigate.png'
  -p '5000:5000/tcp'
  -p '8554:8554/tcp'
  -p '8555:8555/tcp'
  -p '8555:8555/udp'
  -p '1984:1984/tcp'
  -v '/mnt/user/appdata/frigate':'/config':'rw'
  -v '/mnt/user/Frigate Recordings/':'/media/frigate':'rw'
  -v '/etc/localtime':'/etc/localtime':'rw'
  --shm-size=256mb
  --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000
  --restart unless-stopped
  --gpus=all 'ghcr.io/blakeblackshear/frigate:stable-tensorrt'

d4d83afad657559c53468c5ebc065e6caf904150a1c06d31719cfa84768c6afa

Relevant log output

2024-02-11 11:51:47.953981276  Fatal Python error: Segmentation fault
2024-02-11 11:51:47.953989283  
2024-02-11 11:51:47.953991367  Thread 0x00001506c59ee6c0 (most recent call first):
2024-02-11 11:51:47.954045897    File "/usr/lib/python3.9/threading.py", line 312 in wait
2024-02-11 11:51:47.954133590    File "/usr/lib/python3.9/multiprocessing/queues.py", line 233 in _feed
2024-02-11 11:51:47.954194783    File "/usr/lib/python3.9/threading.py", line 892 in run
2024-02-11 11:51:47.954276894    File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner
2024-02-11 11:51:47.954332450    File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap
2024-02-11 11:51:47.954343287  
2024-02-11 11:51:47.954345312  Current thread 0x00001506ea62f740 (most recent call first):
2024-02-11 11:51:47.954442917    File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 168 in <listcomp>
2024-02-11 11:51:47.954540476    File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 167 in _do_inference
2024-02-11 11:51:47.954632394    File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 286 in detect_raw
2024-02-11 11:51:47.954722466    File "/opt/frigate/frigate/object_detection.py", line 75 in detect_raw
2024-02-11 11:51:47.954846892    File "/opt/frigate/frigate/object_detection.py", line 125 in run_detector
2024-02-11 11:51:47.954996257    File "/usr/lib/python3.9/multiprocessing/process.py", line 108 in run
2024-02-11 11:51:47.955127573    File "/usr/lib/python3.9/multiprocessing/process.py", line 315 in _bootstrap
2024-02-11 11:51:47.955272691    File "/usr/lib/python3.9/multiprocessing/popen_fork.py", line 71 in _launch
2024-02-11 11:51:47.955386735    File "/usr/lib/python3.9/multiprocessing/popen_fork.py", line 19 in __init__
2024-02-11 11:51:47.955491455    File "/usr/lib/python3.9/multiprocessing/context.py", line 277 in _Popen
2024-02-11 11:51:47.955586815    File "/usr/lib/python3.9/multiprocessing/context.py", line 224 in _Popen
2024-02-11 11:51:47.955687173    File "/usr/lib/python3.9/multiprocessing/process.py", line 121 in start
2024-02-11 11:51:47.955783568    File "/opt/frigate/frigate/object_detection.py", line 183 in start_or_restart
2024-02-11 11:51:47.955869434    File "/opt/frigate/frigate/object_detection.py", line 151 in __init__
2024-02-11 11:51:47.955992198    File "/opt/frigate/frigate/app.py", line 453 in start_detectors
2024-02-11 11:51:47.956082578    File "/opt/frigate/frigate/app.py", line 683 in start
2024-02-11 11:51:47.956155258    File "/opt/frigate/frigate/__main__.py", line 17 in <module>
2024-02-11 11:51:47.956251165    File "/usr/lib/python3.9/runpy.py", line 87 in _run_code
2024-02-11 11:51:47.956342911    File "/usr/lib/python3.9/runpy.py", line 197 in _run_module_as_main
2024-02-11 11:51:49.659338836  [INFO] Starting go2rtc healthcheck service...
2024-02-11 11:52:02.661642001  [2024-02-11 11:52:02] frigate.watchdog               INFO    : Detection appears to be stuck. Restarting detection process...
2024-02-11 11:52:02.685462534  [2024-02-11 11:52:02] detector.tensorrt              INFO    : Starting detection process: 1255
2024-02-11 11:52:02.984562929  [2024-02-11 11:52:02] frigate.detectors.plugins.tensorrt INFO    : Loaded engine size: 39 MiB
2024-02-11 11:52:03.343516305  [2024-02-11 11:52:03] frigate.detectors.plugins.tensorrt INFO    : [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +6, GPU +8, now: CPU 158, GPU 230 (MiB)
2024-02-11 11:52:03.356055956  [2024-02-11 11:52:03] frigate.detectors.plugins.tensorrt INFO    : [MemUsageChange] Init cuDNN: CPU +2, GPU +10, now: CPU 160, GPU 240 (MiB)
2024-02-11 11:52:03.360742717  [2024-02-11 11:52:03] frigate.detectors.plugins.tensorrt INFO    : [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +40, now: CPU 0, GPU 40 (MiB)
2024-02-11 11:52:03.369792099  [2024-02-11 11:52:03] frigate.detectors.plugins.tensorrt INFO    : [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +0, GPU +8, now: CPU 120, GPU 232 (MiB)
2024-02-11 11:52:03.370187842  [2024-02-11 11:52:03] frigate.detectors.plugins.tensorrt INFO    : [MemUsageChange] Init cuDNN: CPU +0, GPU +8, now: CPU 120, GPU 240 (MiB)
2024-02-11 11:52:03.370321313  [2024-02-11 11:52:03] frigate.detectors.plugins.tensorrt INFO    : [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +13, now: CPU 0, GPU 53 (MiB)

Operating system

UNRAID

Install method

Docker Compose

Coral version

CPU (no coral)

Any other information that may be helpful

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26

Most upvoted comments

For me i had issues with segmentation issues.

What I found out and had fogotten about that if i have the yolo7x-640.trt I had to have teh With and height variables under model at the same IE: Model: path: /yourpathhere Input_tensor: nchw input_pixel_format: rgb width: 640 height: 640

for me the width and height had to match the model size and once i did that i didnt have segmentation problems anymore.

Also, have you created the models under /config/model_cache/tensorrt/? I couldnt see the that in ur docker launch that it had anything about building the models, i might be wrong and blind if so : nothing to see here.