https://bugs.kde.org/show_bug.cgi?id=521952
Bug ID: 521952
Summary: KWin 6.7 terminates Wayland client over invalid HDR
metadata (min_lum >= max_lum) instead of clamping;
NVIDIA games crash
Classification: Plasma
Product: kwin
Version First 6.7.0
Reported In:
Platform: CachyOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: wayland-generic
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
Since updating to Plasma 6.7, HDR games launched through Proton with native
Wayland (winewayland) now crash on launch when the game sends HDR
mastering-display metadata where the minimum luminance is greater than or equal
to the maximum luminance.
KWin throws "min_lum can't be higher or equal to max_lum" and terminates the
Wayland client connection, killing the game. This worked fine on Plasma 6.6.
The same game runs without crashing when the HDR metadata never reaches KWin's
native color-management path (e.g. via gamescope, or by forcing XWayland),
which points to KWin's strict enforcement as the trigger.
This appears to be NVIDIA-specific in practice: the NVIDIA driver passes the
game's invalid metadata through unchanged, whereas Mesa/AMD silently filters
out invalid metadata before it reaches the compositor (see Mesa
wsi_common_wayland.c, which drops metadata that would violate the protocol). As
a result, NVIDIA users hit the crash while AMD users do not. Discussion of the
same min_lum/max_lum error appears on the NVIDIA developer forums (595 release
feedback thread).
STEPS TO REPRODUCE
1. On Plasma 6.7 Wayland with an NVIDIA GPU and an HDR display enabled, launch
an HDR game whose engine emits invalid HDR10 metadata (min luminance >= max
luminance). Sekiro: Shadows Die Twice is a reliable repro.
2. Run it through Proton with native Wayland HDR: PROTON_ENABLE_WAYLAND=1
DXVK_HDR=1 ENABLE_HDR_WSI=1 %command%
3. Observe the PROTON_LOG output as the swapchain is created.
OBSERVED RESULT
The game crashes immediately on launch. PROTON_LOG shows:
[destroyed object]: error 5: min_lum can't be higher or equal to max_lum
err:waylanddrv:wayland_read_events_thread Failed to read events from the
compositor, terminating process
EXPECTED RESULT
KWin should handle invalid HDR mastering metadata gracefully — clamping or
ignoring the invalid luminance values (as Mesa does) — rather than terminating
the client connection. A misbehaving application sending out-of-spec metadata
should not be able to crash itself (and arguably should not be treated as a
fatal protocol violation by the compositor).
SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux
KDE Plasma Version: 6.7.0
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel: 7.0.12-1-cachyos (also reproduced on linux-cachyos-lts 6.18.35)
CPU: AMD Ryzen 5 5600X
GPU: NVIDIA GeForce RTX 4070, proprietary driver 610.43.02
Display: ASUS ROG Strix XG27AQDPG QD-OLED, HDR enabled, DisplayPort
Graphics Platform: Wayland
ADDITIONAL INFORMATION
Workarounds that avoid the crash:
- gamescope (DXVK_HDR=1 gamescope -f --hdr-enabled ...): HDR works, as
gamescope isolates the metadata from KWin. Introduces noticeable stutter.
- Forcing XWayland (drop PROTON_ENABLE_WAYLAND=1): game launches and HDR is
selectable, but colors are washed out/desaturated because the path falls back
toward sRGB instead of native BT.2020 wide gamut.
Workarounds that did NOT help:
- Removing ENABLE_HDR_WSI=1
- KWIN_DRM_NO_DIRECT_SCANOUT=1 and KWIN_FORCE_ASSUME_HDR_SUPPORT=1 in
/etc/environment
- Fresh Proton prefix
Note: the proper long-term fix may also belong in vkd3d-proton/DXVK (sanitizing
metadata before submission) or the NVIDIA driver (filtering like Mesa), but
KWin clamping invalid metadata instead of hard-terminating the client would
prevent this whole class of crashes regardless of the application's behavior.
--
You are receiving this mail because:
You are watching all bug changes.