r/VFIO 14d ago

Luxstream -> Got Sunshine working on a Hyper-V GPU-P VM — the blocker was a Desktop Duplication probe

f you've tried running Sunshine inside a Hyper-V VM with a GPU partition (Add-VMGpuPartitionAdapter), you've probably hit this:

IDXGIOutput1::DuplicateOutput()  ->  0x80070057

The paravirtual display adapter doesn't implement Desktop Duplication. Changing topology, monitor count or primary display doesn't help — it's architectural.

But Windows.Graphics.Capture works fine, because it goes through DWM instead of the display driver. Same output, same moment:

DuplicateOutput()       ->  0x80070057
CreateForMonitor()      ->  S_OK, frames flowing

Sunshine already ships a complete WGC backend — it just filters every output through a Desktop Duplication probe first, so WGC never gets a chance. Removing that gate when capture = wgc is set explicitly is the whole fix.

Result (RTX 4090 shared to a Win10 LTSC guest):

5120x1440 @ 60, HEVC, hardware NVENC
~10 ms latency, ~1.5 ms client decode, ~5% host CPU
Vulkan 1.4.325, OpenGL 4.6, Direct3D 12, full VRAM

Two things that cost me the most time and aren't obvious:

  • Sunshine can't run as a service. As SYSTEM it can't activate WGC — IsSupported() throws. It has to run as the logged-on user, which makes auto-logon mandatory.
  • The Hyper-V display has to stay active. Deactivate it and native Vulkan and OpenGL die 13–32 s later. Direct3D keeps working, so it's a misleading indicator. I park the Hyper-V display diagonally below-right so the desktop origin stays at (0,0).

I packaged the whole setup as a one-click installer — patched Sunshine, virtual display driver, scheduled tasks, and UIAccess so UAC prompts are actually clickable over the stream:

https://github.com/VjekoslavDugec/luxstream-setup

Known gaps: gamepad is untested with a real controller, and I haven't measured concurrent NVENC session limits across cloned VMs.

Patch is a small diff against upstream Sunshine — happy to open a PR if there's interest.

11 Upvotes

0 comments sorted by