Bug 519426 - KWin Wayland: GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT and GL_INVALID_ENUM spam with NVIDIA Optimus + dual monitor different refresh rates
Summary: KWin Wayland: GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT and GL_INVALID_ENU...
Status: RESOLVED DUPLICATE of bug 517987
Alias: None
Product: kwin
Classification: Plasma
Component: glx (other bugs)
Version First Reported In: 6.6.4
Platform: CachyOS Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-26 09:44 UTC by clasio
Modified: 2026-05-06 13:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description clasio 2026-04-26 09:44:53 UTC
## System Information
- OS: CachyOS (Arch-based, rolling release)
- Kernel: 7.0.0-1-cachyos
- KDE Plasma: (fill in from plasmashell --version)
- KWin version: (fill in from pacman -Q kwin)
- NVIDIA Driver: 595.58.03
- GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q (TU117M)
- iGPU: Intel UHD Graphics (Optimus/Hybrid setup)
- Session: Wayland

## Monitor Setup
- Display 1 (internal): laptop screen @ 144Hz
- Display 2 (external): monitor @ 200Hz
- Both active simultaneously

## Bug Description
KWin Wayland generates massive amounts of GL errors continuously 
since boot, causing visible frame drops and stuttering on the 
desktop even during idle or light tasks like browsing. 
The errors do NOT occur in games (which bypass the compositor).

## Errors observed in journalctl
kwin_wayland: 0x500: GL_INVALID_ENUM error generated. Invalid <face>.
kwin_wayland: Invalid framebuffer status: GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT

These errors repeat tens of thousands of times per session.
Example count after a normal desktop session:
  journalctl -b | grep -i "kwin" | grep -i "invalid" | wc -l
  Result: 66012

## Compositing Info
- compositingType: gl2
- openGLIsBroken: false (KWin does not self-detect the issue)
- GLCore=true set in kwinrc but KWin ignores it on Wayland
- KWIN_OPENGL_INTERFACE=egl in /etc/environment has no effect

## Steps to Reproduce
1. Use laptop with NVIDIA Optimus (Intel iGPU + NVIDIA dGPU)
2. Connect external monitor at different refresh rate than internal
   (internal: 144Hz, external: 200Hz)
3. Boot into KDE Plasma Wayland session
4. Observe frame drops during idle/browsing
5. Run: journalctl -b | grep -i "kwin" | grep -i "invalid" | wc -l
   → Returns tens of thousands of errors

## Expected Behavior
KWin compositor should render smoothly without GL errors during 
normal desktop usage on supported hardware.

## Actual Behavior
- Continuous GL_INVALID_ENUM and GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT errors
- Visible frame drops on desktop, especially on high refresh rate external monitor
- KWin self-reports openGLIsBroken=false despite continuous errors
- GLCore=true config is ignored, compositor stays on gl2

## Workarounds Attempted
- Disabling all Desktop Effects: no change
- Setting GLCore=true in kwinrc: ignored by KWin on Wayland
- Setting KWIN_OPENGL_INTERFACE=egl: no effect on Wayland
- Disabling one monitor: frame drops persist
- Matching refresh rates (both 144Hz): frame drops persist

## Additional Notes
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT suggests a race 
condition where KWin attempts to render to a framebuffer before 
attachment is complete. This may be related to the tight frame 
deadline at 200Hz (5ms) combined with NVIDIA Optimus copy pipeline 
overhead on Wayland.

Games are unaffected as they bypass the KWin compositor entirely.
Comment 1 azynetz 2026-04-26 12:13:24 UTC
Quick note everyone: Check your disk activity!
I ran into this issue where it was writing 20–30 MB/s constantly.

I changed journald's storage option to volatile. That stopped writing to disk. Do not lose your SSD at the current market. ;) 
Are there any other suggestions to fix this?
Comment 2 Zamundaaa 2026-05-06 13:36:11 UTC

*** This bug has been marked as a duplicate of bug 517987 ***