[HW Accel Support]: ffmpeg: hwaccel_args: preset-nvidia #17632
-
Describe the problem you are havingffmpeg: hwaccel_args: preset-nvidia ERROR - Cannot load libcuda.so.1 . Drivers installed & confirmed with nvidia-smi on docker nvidia/cuda Version0.15 Frigate config filemqtt:
enabled: false
record:
enabled: false
detectors:
coral:
type: edgetpu
device: usb
ffmpeg:
hwaccel_args: preset-nvidia
cameras:
name_of_your_camera: # <------ Name the camera
enabled: true
ffmpeg:
# hwaccel_args: preset-nvidia
inputs:
- path: rtsp://admin:[email protected]:554/Streaming/Channels/202 # <----- Password & IP changed
roles:
- detect
detect:
enabled: false # <---- disable detection until you have a working camera feed
version: 0.15-1 docker-compose file or Docker CLI commandversion: "3.9"
services:
frigate:
container_name: frigate
privileged: true
runtime: nvidia
restart: unless-stopped
stop_grace_period: 30s
image: ghcr.io/blakeblackshear/frigate:stable
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
shm_size: "512mb"
devices:
- /dev/bus/usb:/dev/bus/usb # for USB Coral
volumes:
- ./config:/config
- /mnt/CCTV:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
#- "5000:5000"
- "8971:8971"
- "8554:8554" # RTSP feeds Relevant Frigate log outputs6-rc: info: service nginx successfully started
s6-rc: info: service certsync: starting
s6-rc: info: service certsync successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
2025-04-10 14:00:30.241032317 [INFO] Starting certsync...
2025-04-10 14:00:30.323626101 127.0.0.1 - - [10/Apr/2025:14:00:30 +0000] "" 400 0 "-" "-" "-"
2025-04-10 14:00:31.429380417 [2025-04-10 14:00:31] frigate.util.config INFO : Checking if frigate config needs migration...
2025-04-10 14:00:31.435539081 [2025-04-10 14:00:31] frigate.util.config INFO : frigate config does not need migration...
2025-04-10 14:00:31.744249918 2025/04/10 14:00:31 [error] 159#159: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.60, server: , request: "GET /ws HTTP/1.1", subrequest: "/auth", upstream: "http://127.0.0.1:5001/auth", host: "192.168.1.10:8971"
2025-04-10 14:00:31.744254140 2025/04/10 14:00:31 [error] 159#159: *3 auth request unexpected status: 502 while sending to client, client: 192.168.1.60, server: , request: "GET /ws HTTP/1.1", host: "192.168.1.10:8971"
2025-04-10 14:00:31.744272118 192.168.1.60 - - [10/Apr/2025:14:00:31 +0000] "GET /ws HTTP/1.1" 500 579 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"
2025-04-10 14:00:34.016683402 2025/04/10 14:00:34 [error] 157#157: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /api/version HTTP/1.1", subrequest: "/auth", upstream: "http://127.0.0.1:5001/auth", host: "127.0.0.1:5000"
2025-04-10 14:00:34.016687957 2025/04/10 14:00:34 [error] 157#157: *5 auth request unexpected status: 502 while sending to client, client: 127.0.0.1, server: , request: "GET /api/version HTTP/1.1", host: "127.0.0.1:5000"
2025-04-10 14:00:36.350667458 [2025-04-10 14:00:36] frigate.app INFO : Starting Frigate (0.15.0-cea210d)
2025-04-10 14:00:36.355658330 [2025-04-10 14:00:36] peewee_migrate.logs INFO : Starting migrations
2025-04-10 14:00:36.356281999 [2025-04-10 14:00:36] peewee_migrate.logs INFO : There is nothing to migrate
2025-04-10 14:00:36.370410672 [2025-04-10 14:00:36] frigate.app INFO : Recording process started: 345
2025-04-10 14:00:36.370414010 [2025-04-10 14:00:36] frigate.app INFO : Review process started: 351
2025-04-10 14:00:36.372341849 [2025-04-10 14:00:36] frigate.app INFO : go2rtc process pid: 106
2025-04-10 14:00:36.382696559 [2025-04-10 14:00:36] detector.coral INFO : Starting detection process: 361
2025-04-10 14:00:36.392157780 [2025-04-10 14:00:36] frigate.app INFO : Output process started: 379
2025-04-10 14:00:36.406083042 [2025-04-10 14:00:36] frigate.app INFO : Camera processor started for name_of_your_camera: 394
2025-04-10 14:00:36.416299733 [2025-04-10 14:00:36] frigate.app INFO : Capture process started for name_of_your_camera: 404
2025-04-10 14:00:36.889575513 [2025-04-10 14:00:36] frigate.api.fastapi_app INFO : Starting FastAPI app
2025-04-10 14:00:36.987341092 [2025-04-10 14:00:36] frigate.api.fastapi_app INFO : FastAPI started
2025-04-10 14:00:39.089200044 [INFO] Starting go2rtc healthcheck service...
2025-04-10 14:00:39.524205800 [2025-04-10 14:00:36] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2025-04-10 14:00:39.525550482 [2025-04-10 14:00:39] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
2025-04-10 14:00:40.179858510 [2025-04-10 14:00:40] frigate.video ERROR : name_of_your_camera: Unable to read frames from ffmpeg process.
2025-04-10 14:00:40.180212598 [2025-04-10 14:00:40] frigate.video ERROR : name_of_your_camera: ffmpeg process is not running. exiting capture thread...
2025-04-10 14:00:56.443824558 [2025-04-10 14:00:56] watchdog.name_of_your_camera ERROR : Ffmpeg process crashed unexpectedly for name_of_your_camera.
2025-04-10 14:00:56.443828494 [2025-04-10 14:00:56] watchdog.name_of_your_camera ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2025-04-10 14:00:56.443833355 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : [AVHWDeviceContext @ 0x5a0a7917a380] Cannot load libcuda.so.1
2025-04-10 14:00:56.443849516 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : [AVHWDeviceContext @ 0x5a0a7917a380] Could not dynamically load CUDA
2025-04-10 14:00:56.443851467 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : Device creation failed: -1.
2025-04-10 14:00:56.443853551 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : [vist#0:0/h264 @ 0x5a0a791aaf80] [dec:h264 @ 0x5a0a7916c800] No device available for decoder: device type cuda needed for codec h264.
2025-04-10 14:00:56.443875213 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : [vist#0:0/h264 @ 0x5a0a791aaf80] [dec:h264 @ 0x5a0a7916c800] Hardware device setup failed for decoder: Operation not permitted
2025-04-10 14:00:56.443887019 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : [vost#0:0/rawvideo @ 0x5a0a791c7940] Error initializing a simple filtergraph
2025-04-10 14:00:56.443888431 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : Error opening output file pipe:.
2025-04-10 14:00:56.443889795 [2025-04-10 14:00:56] ffmpeg.name_of_your_camera.detect ERROR : Error opening output files: Operation not permitted
2025-04-10 14:01:00.181434691 [2025-04-10 14:01:00] frigate.video ERROR : name_of_your_camera: Unable to read frames from ffmpeg process.
2025-04-10 14:01:00.181438318 [2025-04-10 14:01:00] frigate.video ERROR : name_of_your_camera: ffmpeg process is not running. exiting capture thread... Relevant go2rtc log outputType
Timestamp
Tag
Message
info
2025-04-10 14:00:29
startup
Preparing new go2rtc config...
info
2025-04-10 14:00:29
startup
Starting go2rtc...
info
2025-04-10 14:00:29
startup
go2rtc platform=linux/amd64 revision=b2399f3 version=1.9.2
info
2025-04-10 14:00:29
startup
config path=/dev/shm/go2rtc.yaml
info
2025-04-10 14:00:29
rtsp
listen addr=:8554
info
2025-04-10 14:00:29
webrtc
listen addr=:8555/tcp
info
2025-04-10 14:00:29
api
listen addr=:1984
info
2025-04-10 14:00:39
startup
Starting go2rtc healthcheck service... FFprobe output from your cameraUnknown how to execute Install methodProxmox via Docker Object DetectorCoral Network connectionWired Camera make and modelHikvision Screenshots of the Frigate UI's System metrics pagesAny other information that may be helpful
I've tried:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
This is going to be a passthrough issue somewhere in the chain of containers, as all of the libs needed for hwaccel come from the nvidia container toolkit. Can search previous issues / discussions for that error and see what worked for other users |
Beta Was this translation helpful? Give feedback.
-
I've just built and used a default Nvidia docker build. The passthrough test worked. Docker Compose was stripped down and exactly the same as the Frigate build. I don't understand the logic of this being a passthrough issue now. Could the issue be anything else? |
Beta Was this translation helpful? Give feedback.
-
Answer:
|
Beta Was this translation helpful? Give feedback.
Answer:
docker inspect frigate | grep -i runtime
|| You should see:"Runtime": "nvidia",
nano /etc/docker/daemon.json:
and add the belowsystemctl restart docker
docker info | grep -i nvidia
|| You should see:Runtimes: nvidia runc, Default Runtime: nvidia
docker-compose down
& thendocker-compose up -d
inside frigate docker directory.docker in…