[HW Accel Support]: Installed Nvidia-based GPU, cannot get hw_accel to work #10594
Answered
by
NickM-27
Juggler00
asked this question in
Hardware Acceleration Support
-
Describe the problem you are havingRunning Ubuntu server v20.04.6 and Docker v26.0.0. and have Frigate working with my 5x Dahua cameras. I have just installed an Nvidia-based GPU (GeForce GT 1030 chipset) and would like to leverage hardware acceleration of the the card. I have verified that my Nvidia drivers are properly installed:
Version0.13.2-6476F8A Frigate config filemqtt:
host: IP_ADDRESS
detectors:
coral:
type: edgetpu
device: usb
birdseye:
mode: motion
ffmpeg:
hwaccel_args: preset-nvidia-h264
record:
enabled: True
expire_interval: 60
retain:
days: 14
mode: all
snapshots:
enabled: True
timestamp: True
# crop: False
retain:
default: 7
go2rtc:
streams:
driveway:
- rtsp:https://USERNAME:[email protected]:554
- "ffmpeg:driveway#audio=opus"
driveway_sub:
- rtsp:https://USERNAME:[email protected]:554/cam/realmonitor?channel=1&subtype=2
webrtc:
candidates:
- 192.168.2.10:8555
- TAILSCALE_IP:8555
- stun:8555
cameras:
driveway:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp:https://127.0.0.1:8554/driveway
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp:https://127.0.0.1:8554/driveway_sub
input_args: preset-rtsp-restream
roles:
- detect
objects:
track:
- person
- bicycle docker-compose file or Docker CLI commandfrigate:
image: ghcr.io/blakeblackshear/frigate:0.13.2
restart: unless-stopped
container_name: frigate
shm_size: "128mb"
networks:
public:
ports:
- 5000:5000
- 1935:1935
- 1984:1984
- 8554:8554
- 8555:8555
environment:
- TZ=America/Toronto
devices:
- /dev/bus/usb:/dev/bus/usb
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
- /etc/localtime:/etc/localtime:ro
- ./frigate/config/:/config/
- /hdd5tbsingle/frigate:/media/frigate Relevant log outputfrigate | 2024-03-21 15:12:24.428816668 [INFO] Preparing Frigate...
frigate | 2024-03-21 15:12:24.430546816 [INFO] Starting NGINX...
frigate | 2024-03-21 15:12:24.435114249 [INFO] Preparing new go2rtc config...
frigate | s6-rc: info: service legacy-services successfully started
frigate | 2024-03-21 15:12:24.446464954 [INFO] Starting Frigate...
frigate | 2024-03-21 15:12:24.754238209 2024/03/21 15:12:24 [error] 145#145: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.2.10, server: , request: "GET /api/stats HTTP/1.1", upstream: "http:https://127.0.0.1:5001stats", host: "192.168.2.10:5000"
frigate | 2024-03-21 15:12:24.807988805 [INFO] Not injecting WebRTC candidates into go2rtc config as it has been set manually
frigate | 2024-03-21 15:12:24.856600450 [INFO] Starting go2rtc...
frigate | 2024-03-21 15:12:24.984123168 15:12:24.984 INF go2rtc version 1.8.4 linux/amd64
frigate | 2024-03-21 15:12:24.984846797 15:12:24.984 INF [rtsp] listen addr=:8554
frigate | 2024-03-21 15:12:24.984870244 15:12:24.984 INF [api] listen addr=:1984
frigate | 2024-03-21 15:12:24.985563525 15:12:24.985 INF [webrtc] listen addr=:8555
frigate | 2024-03-21 15:12:26.270162920 [2024-03-21 15:12:26] frigate.app INFO : Starting Frigate (0.13.2-6476f8a)
frigate | 2024-03-21 15:12:26.291973233 [rtsp @ 0x3e72f80] method DESCRIBE failed: 404 Not Found
frigate | 2024-03-21 15:12:26.292481378 [ERROR:[email protected]] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
frigate | 2024-03-21 15:12:26.292486528
frigate | 2024-03-21 15:12:26.292499902 OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): rtsp:https://127.0.0.1:8554/driveway_sub in function 'icvExtractPattern'
frigate | 2024-03-21 15:12:26.292504575
frigate | 2024-03-21 15:12:26.292507525
frigate | 2024-03-21 15:12:26.319761750 [2024-03-21 15:12:26] peewee_migrate.logs INFO : Starting migrations
frigate | 2024-03-21 15:12:26.325252209 [2024-03-21 15:12:26] peewee_migrate.logs INFO : There is nothing to migrate
frigate | 2024-03-21 15:12:26.331315857 [2024-03-21 15:12:26] frigate.app INFO : Recording process started: 728
frigate | 2024-03-21 15:12:26.334818483 [2024-03-21 15:12:26] frigate.app INFO : go2rtc process pid: 89
frigate | 2024-03-21 15:12:26.365850610 [2024-03-21 15:12:26] detector.coral INFO : Starting detection process: 737
frigate | 2024-03-21 15:12:26.366507146 [2024-03-21 15:12:26] frigate.app INFO : Output process started: 738
frigate | 2024-03-21 15:12:26.385082194 [2024-03-21 15:12:26] frigate.app INFO : Camera processor started for driveway: 746
frigate | 2024-03-21 15:12:26.393319137 [2024-03-21 15:12:26] frigate.app INFO : Capture process started for driveway: 749
frigate | 2024-03-21 15:12:26.415678552 [2024-03-21 15:12:26] frigate.video ERROR : driveway: Unable to read frames from ffmpeg process.
frigate | 2024-03-21 15:12:26.415939610 [2024-03-21 15:12:26] frigate.video ERROR : driveway: ffmpeg process is not running. exiting capture thread...
frigate | 2024-03-21 15:12:29.037188666 [2024-03-21 15:12:26] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
frigate | 2024-03-21 15:12:29.043404178 [2024-03-21 15:12:29] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
frigate | 2024-03-21 15:12:34.430071045 [INFO] Starting go2rtc healthcheck service...
frigate | 2024-03-21 15:12:46.351050465 [2024-03-21 15:12:46] frigate.record.maintainer WARNING : Unable to keep up with recording segments in cache for driveway. Keeping the 6 most recent segments out of 7 and discarding the rest...
frigate | 2024-03-21 15:12:46.475259601 [2024-03-21 15:12:46] watchdog.driveway ERROR : Ffmpeg process crashed unexpectedly for driveway.
frigate | 2024-03-21 15:12:46.475439969 [2024-03-21 15:12:46] watchdog.driveway ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
frigate | 2024-03-21 15:12:46.475633074 [2024-03-21 15:12:46] ffmpeg.driveway.detect ERROR : [rtsp @ 0x56004db94d40] method DESCRIBE failed: 404 Not Found
frigate | 2024-03-21 15:12:46.475814011 [2024-03-21 15:12:46] ffmpeg.driveway.detect ERROR : rtsp:https://127.0.0.1:8554/driveway_sub: Server returned 404 Not Found
frigate | 2024-03-21 15:12:46.494896815 [2024-03-21 15:12:46] frigate.video ERROR : driveway: Unable to read frames from ffmpeg process.
frigate | 2024-03-21 15:12:46.495038638 [2024-03-21 15:12:46] frigate.video ERROR : driveway: ffmpeg process is not running. exiting capture thread...
frigate | 2024-03-21 15:12:56.350595967 [2024-03-21 15:12:56] frigate.record.maintainer WARNING : Unable to keep up with recording segments in cache for driveway. Keeping the 6 most recent segments out of 7 and discarding the rest...
frigate | 2024-03-21 15:12:56.491696441 [2024-03-21 15:12:56] watchdog.driveway ERROR : Ffmpeg process crashed unexpectedly for driveway.
frigate | 2024-03-21 15:12:56.491950989 [2024-03-21 15:12:56] watchdog.driveway ERROR : The following ffmpeg logs include the last 100 lines prior to exit. FFprobe output from your cameraroot@9bdb5dac0e93:/opt/frigate# ffprobe rtsp:https://USERNAME:[email protected]:554
ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220731
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, rtsp, from 'rtsp:https://admin:[email protected]:554':
Metadata:
title : Media Server
Duration: N/A, start: 0.041000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 15 fps, 100 tbr, 90k tbn
Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s Operating systemOther Linux Install methodDocker Compose Network connectionWired Camera make and modelDahua IPC-HDW5231R-Z Any other information that may be helpfulIf I omit the "ffmpeg" section of the config, everything works except for hardware acceleration. |
Beta Was this translation helpful? Give feedback.
Answered by
NickM-27
Mar 22, 2024
Replies: 1 comment 7 replies
-
The logs being shown are an error from go2rtc, nothing to do with the GPU. I'd suggest checking go2rtc logs |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yes that is helpful, see #5817