https://bugs.kde.org/show_bug.cgi?id=522133

            Bug ID: 522133
           Summary: KWin Wayland fails with EGL_BAD_ALLOC creating the
                    render context on a muxless Intel(iGPU)+AMD(dGPU)
                    hybrid laptop and falls back to software compositing.
                    The AMD dGPU holds the primary render node
                    (renderD128) while the display-connected Intel iGPU is
                    on
    Classification: Applications
           Product: Spectacle
      Version First 24.12.3
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Overview 
On a muxless Intel + AMD hybrid laptop, the Plasma Wayland session cannot bring
up OpenGL compositing. kwin_wayland fails to create its EGL
render context with EGL_BAD_ALLOC at startup and falls back to QPainter
(software) compositing. As a consequence, screencasting fails with
“Unsupported compositing type”, which breaks Spectacle screenshots and all
screen recording, and the desktop runs on CPU compositing. A Plasma
X11 session on the same machine works correctly. 
System 
Plasma / KWin: plasmashell 6.7.1/kwin 6.7.1
Distribution: Arch Linux
Kernels tested (both reproduce): linux 7.0.12.arch1-1 and linux-lts
Mesa tested (both reproduce): 26.1.3 and 26.1.2
Session: Wayland (X11 works — see Workaround) 
Hardware 
iGPU: Intel HD Graphics 4000 (Ivy Bridge, Gen 7) — kernel i915, Mesa crocus.
Drives the internal display.
dGPU: AMD Radeon HD 8730M (Mars / Oland, GCN 1.0) — kernel amdgpu (also tested
with radeon).
Topology: Muxless hybrid (PRIME). Internal panel is wired to the Intel iGPU. 
Key observation — render-node ordering 
The AMD dGPU enumerates as the primary render node, while the display-connected
Intel iGPU is secondary: 
/dev/dri/by-path/pci-0000:01:00.0-render -> ../renderD128 # AMD dGPU
/dev/dri/by-path/pci-0000:00:02.0-render -> ../renderD129 # Intel iGPU (drives
the display)

KWin appears to target the AMD device as primary rather than the Intel device
that owns the outputs. 
kwin_wayland log (Wayland session) 
kwin_wayland: Failed to open drm node: ""
kwin_wayland: couldn't find dev node for drm device
kwin_wayland: No backend specified, automatically choosing drm
kwin_wayland: Create Context failed "EGL_BAD_ALLOC"
kwin_wayland: Could not initialize rendering context
kwin_wayland: Atomic modeset commit failed! Invalid argument
Downstream,
plasmashell logs repeatedly: 
# repeats continuously
plasmashell: error creating screencast "Unsupported compositing type"

OpenGL is functional on the Intel iGPU directly 
Forcing crocus and probing EGL shows the Intel iGPU yields a valid GL context
via GBM — the GPU and driver work; only KWin’s device acquisition
fails:$ MESA_LOADER_DRIVER_OVERRIDE=crocus eglinfo
EGL driver name: crocus
OpenGL core profile renderer: Mesa Intel(R) HD Graphics 4000 (IVB GT2)

(Without the override, Mesa selects Zink, which cannot work on Ivy Bridge as
it has no Vulkan driver — but note this is not the root cause: see
“Ruled out” below.) 
Steps to reproduce 
On the hardware described above, log into a Plasma (Wayland) session. 
Actual result 
kwin_wayland fails to create an OpenGL context (EGL_BAD_ALLOC) and falls back
to software compositing. Screencasting and screenshots fail. 
Expected result 
KWin selects the Intel iGPU (which drives the display and provides working
OpenGL via crocus) and composites with OpenGL. 
Ruled out — the failure is unchanged across all of these 
AMD card on amdgpu and on radeon
Mesa 26.1.3 and 26.1.2
With and without MESA_LOADER_DRIVER_OVERRIDE=crocus
linux 7.0.12 and linux-lts 
This isolates the cause to KWin’s Wayland multi-GPU device selection rather
than the GPU driver, Mesa, or the kernel. 
Workaround 
A Plasma X11 session works correctly (OpenGL compositing via GLX on the Intel
iGPU; screenshots functional). 
Useful attachments to add when filing 
Full journalctl --user -b -t kwin_wayland from a Wayland boot
drm_info output (install the drm_info package), which shows device/connector
topology
qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation captured from the
working X11 session (for complete version
environment detail)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to