[HW Accel Support]: CUDA hardware acceleration fails with preset-nvidia on Frigate (docker with LXC) #19418
Replies: 5 comments 1 reply
-
|
The error For NVIDIA GPUs, you need to ensure proper GPU access configuration. The Docker container requires the NVIDIA Container Toolkit and proper device passthrough (1). Your Docker Compose configuration already includes the correct GPU reservation: deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]However, running Docker inside LXC adds complexity for GPU passthrough. The LXC container itself needs GPU access before Docker can use it. For your NVIDIA GeForce GTX 1650, you can use the preset configuration: ffmpeg:
hwaccel_args: preset-nvidiaBut given the CUDA initialization errors in your LXC environment, consider these alternatives:
ffmpeg:
hwaccel_args: preset-vaapi
# Comment out or remove the hwaccel_args line
# ffmpeg:
# hwaccel_args: preset-nvidiaThe fundamental issue is that your LXC container needs proper GPU device access configured before Docker can utilize the GPU. This typically requires configuring the LXC container with GPU passthrough first, then ensuring the Docker container can access those devices. 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
What does nvidia-smi show on host and LXC? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Had same issue and same log errors after updating Nvidia driver to 580 Reverting back to the Nvidia 570 drivers fixed it. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem you are having
I'm trying to get Frigate running with CUDA hardware acceleration using preset-nvidia on a system running in a Docker container inside an LXC environment. I'm using a NVIDIA GeForce GTX 1650 GPU. As soon as I enable preset-nvidia on any camera ffmpeg crashes with cuda errors.
Tried with nvidia-preset-h264 as well.
The GPU is visible in the system monitor page.
Version
0.15.2-3bda638
Frigate config file
docker-compose file or Docker CLI command
Relevant Frigate log output
Relevant go2rtc log output
FFprobe output from your camera
?Install method
Docker Compose
Object Detector
Coral
Network connection
Wired
Camera make and model
Multiple
Screenshots of the Frigate UI's System metrics pages
Any other information that may be helpful
No response
Beta Was this translation helpful? Give feedback.
All reactions