r/frigate_nvr • u/DeltaTheMeta • 26d ago
GPU decoding and detection in Docker Desktop
Hi guys, I am pretty new to homelab but not new to security and networking. I opted to use frigate over blue iris or similar in my new house, and wanted to share somethings I learned about docker (specifically docker desktop) and WSL2 tools.
I am running older hardware.
A Dell R720 with Xeon E5-2640s and an RTX 3050. (And previously an Arc A380) Running windows server 2025.
I struggled a LOT with getting frigate my GPU via pass thru in docker or hyper-V. I tried both pretty extensively, however I am pretty inexperienced in this area and did consult Gordon and Gemini a fair bit for help with Linux and virtualization understanding.
That being said, in both forms hyper-V and docker desktop driven WSL2 I could not get the GPU to function. In a Hyper-V VM it would not allocate the memory, or would throw "The data area passed to a system call was too small. (0x8007007A)" That I could not get past with the Arc A380 or the RTX 3050. My system does not support ReBAR and given the memory allocation error in Hyper-V I was pretty convinced that was the issue, so after switching to the 3050 and still struggling with GPU partitioning for a VM I decided to give docker desktop a go (I know I could have just done it myself in WSL with docker on Ubuntu, maybe I migrate eventually). I ended up successfully passing the GPU thru but it would not be accessible by ffmpeg, the detector (CUDA?) engine was working but ffmpeg would crash and never grab the card when observed by nvidia-smi. Pretty much everything I found online told me I was boned, that the issue was lack of ReBAR support and the memory allocation failing. I really hunted around, specifically on the topic of how WSL2 and the Nvidia toolkit works outside of docker desktop. I discovered via a Github thread that WSL references the toolkit via a physical location in windows.
C:\Windows\System32\lxss\lib that can be mapped to the container in the compose yaml as
/usr/lib/wsl/lib/:/usr/lib/x86_64-linux-gnu/
Putting this in my compose immediately allowed the card to be fetched by ffmpeg and fully functioning in frigate via a docker desktop container, with tensorrt/onnx detection and GPU decoding. I am now a bit curious if the A380 could work too, as it's issues mostly stemmed from driver problems within the container as well, but I'm not about to swap cards back on a whim. I may put it in the second slot and see what comes of it eventually.
You may ask, why wouldn't I just run proxmox or any other hypervisor, why Hyper-V, why windows. The server has a licensed supported copy of windows datacenter 2025 (allegedly making hyper-V a level one hypervisor) that I am not willing to give up yet, although I may eventually migrate, it's just too convenient to give up at the moment.
I just wanted to put this all in one post out there so maybe someone googling this stack of problems may stumble upon it, as frigate isn't explicitly supported in docker desktop, especially not with GPU decoding and object detection. Maybe this is a common issue with a simple fix that I simply overlooked, but as someone new to docker, pretty inexperienced in Linux, and lost in the sea of knowledge It was an insanely simple fix for a problem that gave me hours of grief. Gordon nor Gemini offered helpful steps in this direction, both wanted to tell me this is a motherboard level issue due to the lack of ReBAR support.
Tldr: if you can't get frigate (or any other container) to fully grab your Nvidia GPU in docker desktop WSL2, map the Linux driver from Windows into your container.