`Error: Couldn't find monitor [0]` On Autodetect/KMS when monitor turns off from inactivity
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?
None
Describe the Bug
Using KDE Plasmas (Wayland), when the feature to turn off the display after some inactivity is triggered and the monitor turns off, Autodetect tries to use KMS, fails, and throws an error 503 on Moonlight.
Expected Behavior
While KMS failing on "headless" is known (https://github.com/LizardByte/Sunshine/issues/2250), I expected Autodetect to failover to Kwin Screenshare or XDG Portal after KMS failed. I did not expect to need to specify those in the advanced settings to work around the issue.
XDG Portal and Kwin Screenshare function properly and stream even when the monitor has turned off.
Additional Context
This seems similar to https://github.com/LizardByte/Sunshine/issues/2250 but it looks a bit different. Furthermore, that's on GNOME, not KDE Plasma.
kinfo:
Operating System: EndeavourOS
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.26.0
Qt Version: 6.11.1
Kernel Version: 6.18.33-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: NVIDIA GeForce GTX 1050
Host Operating System
Linux
Operating System Version
EndeavourOS
Architecture
amd64/x86_64
Package
Linux - LizardByte/pacman-repo
GPU Type
NVIDIA
GPU Model
GTX 1050
GPU Driver/Mesa Version
580.159.04
Capture Method
KMS (Linux)
Apps
Log output
[2026-05-28 16:41:22.433]: Info: Sunshine version: 2026.528.35537 commit: 22d9aa3b2e5fe0cee654e830b5715901b37cf0bd
[2026-05-28 16:41:22.433]: Info: Package Publisher: LizardByte
[2026-05-28 16:41:22.433]: Info: Publisher Website: https://app.lizardbyte.dev
[2026-05-28 16:41:22.433]: Info: Get support: https://app.lizardbyte.dev/support
[2026-05-28 16:41:22.433]: Info: config: 'encoder' = nvenc
[2026-05-28 16:41:22.433]: Info: config: 'nvenc_preset' = 3
[2026-05-28 16:41:22.433]: Info: config: 'vk_tune' = 1
[2026-05-28 16:41:22.433]: Info: config: 'origin_web_ui_allowed' = pc
[2026-05-28 16:41:22.433]: Info: config: 'sw_preset' = ultrafast
[2026-05-28 16:41:22.433]: Info: config: 'vk_rc_mode' = 4
[2026-05-28 16:41:22.449]: Error: Failed to create session:
[2026-05-28 16:41:22.449]: Info: [wayland] Found display [wayland-0]
[2026-05-28 16:41:22.449]: Info: [wayland] Found interface: zxdg_output_manager_v1(31) version 3
[2026-05-28 16:41:22.449]: Info: [wayland] Found interface: zwp_linux_dmabuf_v1(57) version 5
[2026-05-28 16:41:22.449]: Info: [wayland] Found interface: wl_output(64) version 4
[2026-05-28 16:41:22.449]: Warning: [wlgrab] Missing Wayland wire for wlr-export-dmabuf
[2026-05-28 16:41:22.449]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:41:22.449]: Info: [wayland] Found display [wayland-0]
[2026-05-28 16:41:22.449]: Info: [wayland] Found display [wayland-0]
[2026-05-28 16:41:22.449]: Info: [wayland] Found interface: zxdg_output_manager_v1(31) version 3
[2026-05-28 16:41:22.449]: Info: [wayland] Found interface: zwp_linux_dmabuf_v1(57) version 5
[2026-05-28 16:41:22.449]: Info: [wayland] Found interface: wl_output(64) version 4
[2026-05-28 16:41:22.449]: Info: [wayland] Resolution: 1920x1080
[2026-05-28 16:41:22.449]: Info: [wayland] Offset: 0x0
[2026-05-28 16:41:22.449]: Info: [wayland] Logical size: 1920x1080
[2026-05-28 16:41:22.449]: Info: [wayland] Name: HDMI-A-1
[2026-05-28 16:41:22.449]: Info: [wayland] Found monitor: MOV HDMI-A-1-R238
[2026-05-28 16:41:22.449]: Info: -------- Start of KMS monitor list --------
[2026-05-28 16:41:22.449]: Info: Monitor 0 is HDMI-A-1: MOV HDMI-A-1-R238
[2026-05-28 16:41:22.450]: Info: --------- End of KMS monitor list ---------
[2026-05-28 16:41:22.450]: Info: [portalgrab] Loaded portal restore token from disk
[2026-05-28 16:41:22.793]: Info: Trying encoder [nvenc]
[2026-05-28 16:41:22.793]: Info: Screencasting with KMS
[2026-05-28 16:41:22.793]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:41:22.793]: Info: Found monitor for DRM screencasting
[2026-05-28 16:41:22.793]: Info: Found connector ID [94]
[2026-05-28 16:41:22.793]: Info: Found cursor plane [54]
[2026-05-28 16:41:22.793]: Info: Creating encoder [h264_nvenc]
[2026-05-28 16:41:22.793]: Info: Color coding: SDR (Rec. 601)
[2026-05-28 16:41:22.793]: Info: Color depth: 8-bit
[2026-05-28 16:41:22.793]: Info: Color range: JPEG
[2026-05-28 16:41:22.804]: Info: EGL: context priority set to HIGH
[2026-05-28 16:41:22.873]: Info: Streaming bitrate is 1000000
[2026-05-28 16:41:22.877]: Warning: [h264_nvenc @ 0x55fc04e75b00] Multiple reference frames are not supported by the device
[2026-05-28 16:41:22.877]: Error: [h264_nvenc @ 0x55fc04e75b00] Provided device doesn't support required NVENC features
[2026-05-28 16:41:23.148]: Error: Could not open codec [h264_nvenc]: Function not implemented
[2026-05-28 16:41:23.149]: Info: Creating encoder [h264_nvenc]
[2026-05-28 16:41:23.149]: Info: Color coding: SDR (Rec. 601)
[2026-05-28 16:41:23.149]: Info: Color depth: 8-bit
[2026-05-28 16:41:23.149]: Info: Color range: JPEG
[2026-05-28 16:41:23.149]: Info: EGL: context priority set to HIGH
[2026-05-28 16:41:23.205]: Info: Streaming bitrate is 1000000
[2026-05-28 16:41:23.462]: Info: Creating encoder [hevc_nvenc]
[2026-05-28 16:41:23.462]: Info: Color coding: SDR (Rec. 601)
[2026-05-28 16:41:23.462]: Info: Color depth: 8-bit
[2026-05-28 16:41:23.462]: Info: Color range: JPEG
[2026-05-28 16:41:23.463]: Info: EGL: context priority set to HIGH
[2026-05-28 16:41:23.465]: Info: Streaming bitrate is 1000000
[2026-05-28 16:41:23.467]: Warning: [hevc_nvenc @ 0x55fc04e75b00] Multiple reference frames are not supported by the device
[2026-05-28 16:41:23.467]: Error: [hevc_nvenc @ 0x55fc04e75b00] Provided device doesn't support required NVENC features
[2026-05-28 16:41:23.717]: Error: Could not open codec [hevc_nvenc]: Function not implemented
[2026-05-28 16:41:23.718]: Info: Creating encoder [hevc_nvenc]
[2026-05-28 16:41:23.718]: Info: Color coding: SDR (Rec. 601)
[2026-05-28 16:41:23.718]: Info: Color depth: 8-bit
[2026-05-28 16:41:23.718]: Info: Color range: JPEG
[2026-05-28 16:41:23.719]: Info: EGL: context priority set to HIGH
[2026-05-28 16:41:23.720]: Info: Streaming bitrate is 1000000
[2026-05-28 16:41:23.976]: Info: Creating encoder [av1_nvenc]
[2026-05-28 16:41:23.976]: Info: Color coding: SDR (Rec. 601)
[2026-05-28 16:41:23.976]: Info: Color depth: 8-bit
[2026-05-28 16:41:23.976]: Info: Color range: JPEG
[2026-05-28 16:41:23.977]: Info: EGL: context priority set to HIGH
[2026-05-28 16:41:23.979]: Info: Streaming bitrate is 1000000
[2026-05-28 16:41:23.981]: Warning: [av1_nvenc @ 0x55fc04e75b00] Codec not supported
[2026-05-28 16:41:23.981]: Error: [av1_nvenc @ 0x55fc04e75b00] Provided device doesn't support required NVENC features
[2026-05-28 16:41:24.231]: Error: Could not open codec [av1_nvenc]: Function not implemented
[2026-05-28 16:41:24.232]: Info: Creating encoder [av1_nvenc]
[2026-05-28 16:41:24.232]: Info: Color coding: SDR (Rec. 601)
[2026-05-28 16:41:24.232]: Info: Color depth: 8-bit
[2026-05-28 16:41:24.232]: Info: Color range: JPEG
[2026-05-28 16:41:24.232]: Info: EGL: context priority set to HIGH
[2026-05-28 16:41:24.234]: Info: Streaming bitrate is 1000000
[2026-05-28 16:41:24.236]: Warning: [av1_nvenc @ 0x55fc04e75b00] Codec not supported
[2026-05-28 16:41:24.236]: Error: [av1_nvenc @ 0x55fc04e75b00] Provided device doesn't support required NVENC features
[2026-05-28 16:41:24.486]: Error: Could not open codec [av1_nvenc]: Function not implemented
[2026-05-28 16:41:24.487]: Info: Screencasting with KMS
[2026-05-28 16:41:24.487]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:41:24.487]: Info: Found monitor for DRM screencasting
[2026-05-28 16:41:24.487]: Info: Found connector ID [94]
[2026-05-28 16:41:24.487]: Info: Found cursor plane [54]
[2026-05-28 16:41:24.487]: Info: Creating encoder [hevc_nvenc]
[2026-05-28 16:41:24.487]: Info: Color coding: SDR (Rec. 709)
[2026-05-28 16:41:24.487]: Info: Color depth: 10-bit
[2026-05-28 16:41:24.487]: Info: Color range: JPEG
[2026-05-28 16:41:24.488]: Info: EGL: context priority set to HIGH
[2026-05-28 16:41:24.490]: Info: Streaming bitrate is 1000000
[2026-05-28 16:41:24.746]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2026-05-28 16:41:24.746]: Info:
[2026-05-28 16:41:24.746]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2026-05-28 16:41:24.746]: Info:
[2026-05-28 16:41:24.746]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2026-05-28 16:41:24.746]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2026-05-28 16:41:24.747]: Info: Starting system tray
[2026-05-28 16:41:24.748]: Info: Adding avahi service tom
[2026-05-28 16:41:24.749]: Info: Avahi service tom successfully established.
[2026-05-28 16:41:24.749]: Info: Configuration UI available at [https://localhost:47990]
[2026-05-28 16:41:24.792]: Info: System tray created
[2026-05-28 16:41:24.792]: Info: Starting main loop
[2026-05-28 16:42:10.354]: Info: Trying encoder [nvenc]
[2026-05-28 16:42:10.354]: Info: Screencasting with KMS
[2026-05-28 16:42:10.354]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.355]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:10.355]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.355]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:10.555]: Info: Screencasting with KMS
[2026-05-28 16:42:10.555]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.555]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:10.555]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.555]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:10.755]: Info: Encoder [nvenc] failed
[2026-05-28 16:42:10.755]: Error: Couldn't find any working encoder matching [nvenc]
[2026-05-28 16:42:10.755]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2026-05-28 16:42:10.755]: Info: Trying encoder [vulkan]
[2026-05-28 16:42:10.755]: Info: Screencasting with KMS
[2026-05-28 16:42:10.755]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.755]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:10.755]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.756]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:10.956]: Info: Screencasting with KMS
[2026-05-28 16:42:10.956]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.956]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:10.956]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:10.956]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:11.156]: Info: Encoder [vulkan] failed
[2026-05-28 16:42:11.156]: Info: Trying encoder [vaapi]
[2026-05-28 16:42:11.156]: Info: Screencasting with KMS
[2026-05-28 16:42:11.156]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:11.156]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:11.156]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:11.156]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:11.356]: Info: Screencasting with KMS
[2026-05-28 16:42:11.356]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:11.357]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:11.357]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:11.357]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:11.557]: Info: Encoder [vaapi] failed
[2026-05-28 16:42:11.557]: Info: Trying encoder [software]
[2026-05-28 16:42:11.557]: Info: Screencasting with KMS
[2026-05-28 16:42:11.557]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:11.557]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:11.757]: Info: Screencasting with KMS
[2026-05-28 16:42:11.757]: Info: /dev/dri/card0 -> nvidia-drm
[2026-05-28 16:42:11.757]: Error: Couldn't find monitor [0]
[2026-05-28 16:42:11.957]: Info: Encoder [software] failed
[2026-05-28 16:42:11.957]: Fatal: Unable to find display or encoder during startup.
[2026-05-28 16:42:11.957]: Fatal: Please check that a display is connected and powered on.
Online logs
No response
Right, if the monitor is off... it can't be detected.
Yeah..so why isn't it falling back to XDG Portal or Kwin Screenshare?
That's because capture method auto detection is done once on startup and the first valid capture methods wins the spot.
Also if you init portalgrab or kwingrab you can never go back to KMS within the same process because the elevated privilege necessary for KMS (CAP_SYS_ADMIN) needs to be fully dropped for those capture methods to even work (due to restrictions to guard processes that run with CAP_SYS_ADMIN). That's why KMS always has to be on top of the capture probe list.
If KMS is the one that needs special privileges and has this additional downside of not working when the monitor is "off", why is it the first one on the list?
It wouldn't work otherwise as already described it needs to be checked first otherwise it would break due to other methods dropping privileges. Another thing is that pipewire-based capture methods are currently still lacking some features (HDR most prominently) or have other quirks (e.g. #5195, https://github.com/LizardByte/Sunshine/issues/4982#issuecomment-4248957913) that might cause more issues than KMS.
So until KMS can be dropped for good (or rather be made a specific choice without being part of autodetection) it has to be the first on the list to be tested/selected.
I encountered this on Debian Trixie with KDE Plasma (Wayland).
- If I connect to an inactive working seissionr, I get a monitor-missing error.
- If I connect to an active working session and then the computer goes inactive, I get a bunch of errors in the console, but when I move the mouse, the computer wakes up, the monitor turns on, and everything continues to work.
When I need to connect to an inactive working session, I remotely "wake up" the monitor through the console with a command, after which everything connects normally.
- kscreen-doctor --dpms on (There are some more commands to make it work remotely through ssh, as it needed to get active session, monitor, etc.)
Main goal is, may be we can try to wake up inactive system before monitor probing.
I encountered this on Debian Trixie with KDE Plasma (Wayland).
- If I connect to an inactive working seissionr, I get a monitor-missing error.
- If I connect to an active working session and then the computer goes inactive, I get a bunch of errors in the console, but when I move the mouse, the computer wakes up, the monitor turns on, and everything continues to work.
When I need to connect to an inactive working session, I remotely "wake up" the monitor through the console with a command, after which everything connects normally.
- kscreen-doctor --dpms on (There are some more commands to make it work remotely through ssh, as it needed to get active session, monitor, etc.)
Main goal is, may be we can try to wake up inactive system before monitor probing.
Another workaround is to just fake a monitor (with similar parameters to the physical one) on an unused graphics card port and literally do screen mirroring on the real and fake one. That way the fake one will always be active and available for Sunshine to stream from and the physical monitor state will not matter.
This requires a few steps with getting a working EDID and adding a few kernel parameters but it's doable (and what I'm personally doing to solve those issues). Here's a few useful guides on the topic found by searching for "sunshine linux fake display":
- https://www.azdanov.dev/articles/2025/how-to-create-a-virtual-display-for-sunshine-on-arch-linux
- https://feddit.org/post/12000513
- https://kevintyk.com/2024/02/12/using-sunshine-without-hdmi-dummy-plug/
Alternatively there's also this script by PVermeer that seems to do similar things but I haven't tried this one personally yet (as setting up the kernel stuff was a one time thing for me): https://github.com/PVermeer/virtual-display
krfb-virtualmonitor seems to be a far easier way of making a fake monitor but it appears to be KDE specific but it allows fully custom resolutions and framerate with kscreen-doctor commands. Unsure if other DEs have any equivalent.
kscreen-doctor is an interesting one but it may not generalize to non-KDE desktops. I wonder what protocols it uses? As a more general approach, every time we receive a connection attempt and fail to open a screen, we could temporarily inhibit screen dimming while opening it again, and remove the lock after it succeeds or fails.
As an alternative workaround, is it possible to display a fixed image of "could not open display" but still allow the user to move the mouse to wake up the screen?
It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!
Hasn't been fixed to my knowledge?