Skip to content

KMS capture fails with 0x3003 RGB import error on multi-GPU #4940

@AndrewStahlecker

Description

@AndrewStahlecker

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

KMS capture fails with 0x3003 RGB import error on multi-GPU systems when displays are not on CUDA device 0

Environment:

OS: Fedora (Bazzite base), Wayland/KDE Plasma
Sunshine version: 2026.331.130344
Nvidia driver: 595.45.04
GPU configuration: Dual RTX 3090 in NVLink (4x), displays connected to GPU1 (PCIe bus 65:00.0, CUDA index 1, /dev/dri/card2, renderD129)

Bug:
KMS capture fails with Error: Couldn't import RGB Image: 00003003 in a loop on every connection attempt. Moonlight reports "No video received from host / check firewall UDP ports." No UDP ports are bound during the session.
Root cause:
On a multi-GPU system, Sunshine defaults to CUDA device index 0 for NVENC encoding regardless of which GPU the displays and KMS framebuffer are on. When the displays are on GPU1 (CUDA index 1), Sunshine captures the KMS framebuffer from that GPU but attempts to import it into an EGL/CUDA context on GPU0. This cross-GPU DMA-BUF import fails with error 0x3003 on every frame, preventing any video from being streamed.
Steps to reproduce:

System with two Nvidia GPUs (tested with NVLink, likely reproducible without)
Displays connected to the GPU that is NOT CUDA index 0
Set capture=kms in sunshine.conf
Connect from Moonlight — stream fails immediately with 0x3003 import error loop

Fix:
Three config changes required in ~/.config/sunshine/sunshine.conf:
inicapture=kms
adapter_name=/dev/dri/renderD129 # render node for the GPU with displays
And in the systemd user service override at ~/.config/systemd/user/sunshine.service.d/cuda-device.conf:
ini[Service]
Environment=CUDA_VISIBLE_DEVICES=1 # CUDA index of the GPU with displays
Expected behavior:
Sunshine should either auto-detect which CUDA device corresponds to the KMS capture device, or document that CUDA_VISIBLE_DEVICES must be set manually on multi-GPU systems to match the display GPU.
Notes:

nvidia_drm.modeset=1 and nvidia_drm.fbdev=1 were already set and are required prerequisites
The user must be in the video group for KMS access
Error 0x3003 is distinct from 0x3004 seen in other reports — may indicate a slightly different failure path worth distinguishing in diagnostics

Expected Behavior

No response

Additional Context

No response

Host Operating System

Fedora

Operating System Version

Fedora 44

Architecture

amd64/x86_64

Package

Linux - Fedora Copr

GPU Type

NVIDIA

GPU Model

3090

GPU Driver/Mesa Version

595

Capture Method

KMS (Linux)

Apps

Log output

Online logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions