mirror of
https://github.com/games-on-whales/wolf.git
synced 2026-10-15 21:12:08 +00:00
[PR #424] [CLOSED] fix(nvidia): zero-copy via DMABuf + glupload on Blackwell (sm_120+) #457
Labels
No labels
🧠 1 - 🤖 999
AMD
bug
bug
cannot reproduce
documentation
duplicate
easy
enhancement
enhancement
enhancement
fixed?
fixed?
good first issue
hard
help wanted
Intel
invalid
LXC
medium
moonlight-protocol
Multi GPU
nixos
not a bug
nvidia
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/wolf#457
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/wolf/pull/424
Author: @JBailes
Created: 6/8/2026
Status: ❌ Closed
Base:
stable← Head:fix/nvidia-blackwell-zero-copy📝 Commits (1)
2f22ef9fix(nvidia): zero-copy via DMABuf + glupload on Blackwell (sm_120+)📊 Changes
1 file changed (+54 additions, -1 deletions)
View changed files
📝
src/moonlight-server/state/configTOML.cpp(+54 -1)📄 Description
Problem
On NVIDIA Blackwell GPUs (RTX 50-series, compute capability 12.x / sm_120) the zero-copy CUDA encode pipeline fails to negotiate. The virtual compositor hands GStreamer a
video/x-raw(memory:CUDAMemory)buffer in BGRA, andcudaconvertscalecannot transform it on this architecture:The result is a black screen that drops the session. The same pipeline works on older NVIDIA GPUs (Ampere/Ada), so it is architecture-specific. Reported in #417 (also seen on RTX 5070 Ti / RTX PRO 4000).
Fix
Keep zero-copy on Blackwell, but stop relying on the broken direct CUDAMemory interop. Instead, take the frame out of the compositor as DMABuf and import it entirely on the GPU in the encoder:
cudauploadcan't import DMABuf directly, which is whygluploadsits in front of it. The GL->CUDA step uses CUDA-GL interop and negotiates correctly on Blackwell (it does emit a harmlessOpenGL context could not support PBO downloadwarning, then falls back to the working interop path).Implementation (
state/configTOML.cpp):nvidia-smi. On>= 12(Blackwell+), set the producer buffer caps tovideo/x-raw(memory:DMABuf)and prependgluploadto the zero-copy encoder params.video/x-raw(memory:CUDAMemory)zero-copy path unchanged. No effect on AMD/Intel.No frames touch system memory, so this stays a true zero-copy path on both old and new NVIDIA.
Testing
not negotiatederror above; with the patch the log showsUsing zero copy pipeline on Nvidia, the encoder runsglupload -> cudaupload -> cudaconvertscale, and games stream correctly.gltestsrc ! glupload ! cudaupload ! cudaconvertscale ! nvh264encreaches EOS).< 12keeps the direct CUDAMemory path).Closes #417
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.