mirror of
https://github.com/games-on-whales/wolf.git
synced 2026-10-15 13:02:03 +00:00
[GH-ISSUE #298] [Nvidia] Gstreamer encoder always uses the 1st card with multiple nvidia GPUs #209
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#209
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?
Originally created by @zexi on GitHub (Nov 23, 2025).
Original GitHub issue: https://github.com/games-on-whales/wolf/issues/298
Problem Description
I found that the GStreamer encoder always uses the first card, even though WOLF_RENDER_NODE is set to the other card, e.g., the render path is /dev/dri/renderD129 and the CUDA device ID is 2.
Here’s the VRAM screenshot via nvidia-smi:
Is this related to this section https://github.com/games-on-whales/wolf/blob/stable/src/moonlight-server/state/configTOML.cpp#L107-L109 of code?
Possible Solutions
If I manually set the environment variable
CUDA_VISIBLE_DEVICES=2, Wolf can use the specified GPU and everything works properly.However, there is a warning
Failed to create CUDA context for devicein the log, and you can refer to the screenshot below:My question is: since the CUDA context creation has failed here, why does everything still work?
@n0deserve commented on GitHub (May 21, 2026):
I ran into the same issue where it was always defaulting to the first GPU. When Wolf creates the CUDA context, NVML can see both cards and it must default to the first card (GPU 0).
My workaround was to pin it using the card's UID instead:
And in
compose.yml:@ABeltramo commented on GitHub (May 30, 2026):
@n0deserve since this was first opened we've added proper support for multiple Nvidia GPUs; setting the
WOLF_RENDER_NODE=/dev/dri/renderD130environment variable should be the only required step as specified in the docs.Can you please verify if that's the case for your setup too or do you actually need the Nvidia container toolkit additional env variables?
@tjacoby2006 commented on GitHub (Sep 15, 2026):
I am having the same or similar issue, basically I have two GOW services running, each pinned to a GPU. The first should be GPU 0, the second should be pinned to GPU 1. For some reason the compute for the second service is running on GPU 0, while the encode is running on GPU 1.
This is with two games running on the second service-
@ABeltramo commented on GitHub (Sep 15, 2026):
@tjacoby2006 mixing up Nvidia container toolkit and manual
/dev/drimounts would most likely cause issues. You should use only one method to separate the GPUs, if done right, it should work.The real fix would be support multi-GPU load balancing in Wolf though. We've discussed this multiple times but we never got around to actually implement it.
@tjacoby2006 commented on GitHub (Sep 15, 2026):
I pivoted to using the manual method, but am still seeing the same behavior.
We still see encoding on device 0 and rendering on device 1.

Thank you for your help on this.
@tjacoby2006 commented on GitHub (Sep 15, 2026):
I may have gotten it. Fix yml-
The key was differentiating the
/dev/nvidia*devices being passed through.@ABeltramo commented on GitHub (Sep 21, 2026):
Good point, forgot to mention that. We should really fix this properly so I'm going to keep this one open..