LizardByte / LizardByte/Sunshine
KMS capture fails with 0x3003 RGB import error on multi-GPU
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 41.3k
- Forks
- 2.1k
- Avg merge
- 23h 47m
- Merged PRs (30d)
- 124
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your issue described in the documentation?
- [x] 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
```json
```
### Log output
```shell
```
### Online logs
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce on a multi-GPU Linux system with capture=kms, displays on CUDA device 1, and the sunshine.conf and systemd override settings described in the issue. Trace how the KMS capture device is matched to the CUDA/NVENC device; done means reliable capture on the display GPU or clear documentation of the required mapping, with diagnostics distinguishing 0x3003 from 0x3004.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- desktop-dev, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100