Couch Lag

Sunshine encoder problems: NVENC, AMD, Quick Sync and VA-API

Updated · By Couch Lag

Short answer: Sunshine uses the first hardware encoder that works, so most problems are the wrong GPU or a missing driver feature. On Windows, Sunshine captures with Desktop Duplication, which only works on the GPU that drives the display, so connect a display or dummy plug to the GPU you want to encode on. On Linux, check that VA-API actually offers H.264 encoding and that your NVIDIA build includes CUDA. Read the log first.

Checked October 31, 2026 against Moonlight PC v6.2.0 and Sunshine v2026.914.233613 (latest stable releases) and their documentation. Sources are listed at the end of the page.

1. Read what Sunshine says

Open the web UI on the host and go to the Troubleshooting tab. Sunshine logs each encoder it tries. If it can’t find a working display or encoder, Moonlight usually shows error 503 or a black screen. See the Sunshine error 503 guide for what each message means.

2. Encoding on the wrong GPU (laptops, eGPUs, two cards)

  • On Windows, Sunshine uses the Desktop Duplication API, which, as its docs put it, only supports capturing from the GPU used for display. To capture and encode on an eGPU, connect a display or an HDMI dummy plug to it and run games on that display.
  • The adapter_name setting picks the GPU. On Windows, run this to list the names:
    %ProgramFiles%\Sunshine\tools\dxgi-info.exe
    Sunshine warns that on hybrid-graphics laptops DXGI reports outputs on whichever GPU the app is set to use, so the list doesn’t prove how a display is physically wired.
  • The output_name setting picks the display. Sunshine prints the detected displays in the log at startup. On Windows, use the device_id value.

3. Force a specific encoder

If Sunshine settles on the wrong one, set encoder in the web UI configuration:

ValueFor
nvencNVIDIA graphics cards
quicksyncIntel graphics
amdvceAMD graphics cards
vaapiVA-API (AMD and Intel)
vulkanVulkan encoding on Linux (AMD, Intel, NVIDIA)
softwareThe CPU. A last resort

Leave hevc_mode and av1_mode at 0, which Sunshine recommends: it then advertises HEVC and AV1 only if your encoder supports them.

4. Linux: VA-API that can’t encode

List your render devices and check what one can encode (replace renderD129 with yours):

ls /dev/dri/renderD*
vainfo --display drm --device /dev/dri/renderD129 | \
  grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version"

At the very least, Sunshine needs VAProfileH264High : VAEntrypointEncSlice. With VA-API, unlike NVENC and AMD’s encoder, it doesn’t matter if encoding happens on a different GPU.

If the log says Could not open codec [h264_vaapi]: Function not implemented, your Mesa build has hardware encoding switched off, which Sunshine says some builds do for legal reasons. Sunshine’s docs point to building Mesa yourself with -Dvideo-codecs=h264enc,h265enc, so check first whether your distribution offers a Mesa package with the encoders enabled.

5. Linux and NVIDIA: CUDA has to be built in

Sunshine uses CUDA for NvFBC capture and direct GPU-memory NVENC encoding. CUDA support is chosen when Sunshine is compiled. LizardByte’s own packages, including its Arch repository, already include it. If you build Sunshine yourself, for example from the AUR, install the CUDA Toolkit first. Installing it later doesn’t add CUDA support without a rebuild.

6. Encoder settings that add latency

  • NVENC preset: nvenc_preset defaults to P1, the fastest. Higher presets compress better but add encoding latency, and Sunshine suggests changing it only when the network or the client’s decoder is the limit.
  • NVIDIA power mode: keep nvenc_latency_over_power on (the default). Sunshine says turning it off can raise encoding latency a lot.
  • Windows freezes with HAGS: NVIDIA drivers may freeze the encoder with hardware-accelerated GPU scheduling on, realtime priority and nearly full VRAM. Turning off nvenc_realtime_hags avoids that at some capture cost under heavy load.
  • AMD on Linux: high or jumpy encode latency usually means Mesa older than 24.2. Sunshine turns on AMD’s low-latency mode by itself on newer Mesa.
  • Software encoding: min_threads (default 2) sets the minimum CPU threads. HEVC and AV1 cost more CPU than H.264 in software.

FAQ

How do I make Sunshine use my NVIDIA card instead of the integrated GPU?

On Windows, Sunshine’s Desktop Duplication capture only works on the GPU that drives the display, so run the game on a display connected to the NVIDIA card (a dummy plug works). Then set adapter_name to that card, using dxgi-info.exe to find its name.

What does “Could not open codec h264_vaapi: Function not implemented” mean?

Your Mesa build has hardware video encoding disabled. Sunshine’s docs describe rebuilding Mesa with the h264enc and h265enc video codecs enabled. Check your distribution for a Mesa package that already has them first.

Should I use HEVC or AV1?

Leave Sunshine’s hevc_mode and av1_mode at 0 so it only offers what your encoder supports, and leave Moonlight’s video codec on Automatic, which Moonlight recommends.

Sources