Bug 382485

Summary: OpenGL 2 compositing setup failed
Product: [Plasma] kwin Reporter: Buck Shockley <darkwingbuck13>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: major CC: frederick888, leguen.yannick
Priority: NOR Flags: mgraesslin: NVIDIA+
Version: 5.10.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Buck Shockley 2017-07-19 03:53:41 UTC
KWin fails to enable compositing after running applications that block/stop compositing. These are the errors that appear in journalctl:

Jul 18 23:35:55 buck-pc kwin_x11[1044]: kwin_core: OpenGL 2 compositing setup failed
Jul 18 23:35:55 buck-pc kwin_x11[1044]: kwin_core: Failed to initialize compositing, compositing disabled
Jul 18 23:42:55 buck-pc kwin_x11[1044]: kwin_core: OpenGL 2 compositing setup failed
Jul 18 23:42:55 buck-pc kwin_x11[1044]: kwin_core: Failed to initialize compositing, compositing disabled
Jul 18 23:42:59 buck-pc kwin_x11[1044]: kwin_core: OpenGL 2 compositing setup failed
Jul 18 23:42:59 buck-pc kwin_x11[1044]: kwin_core: Failed to initialize compositing, compositing disabled
Jul 18 23:43:01 buck-pc kwin_x11[1044]: kwin_core: OpenGL 2 compositing setup failed
Jul 18 23:43:01 buck-pc kwin_x11[1044]: kwin_core: Failed to initialize compositing, compositing disabled

I'm not able to re-enable compositing under any circumstances without rebooting.
Comment 1 Martin Flöser 2017-07-19 05:07:27 UTC
NVIDIA?
Comment 2 Buck Shockley 2017-07-19 12:43:02 UTC
Yes, nvidia 375.66
Comment 3 Martin Flöser 2017-07-19 14:57:34 UTC
I'm sorry, but this is a problem with the NVIDIA driver.

Up to 5.10.3 KWin used to crash on NVIDIA in certain situations. In 5.10.3 we fixed this by implementing an NVIDIA specific extension for that crash. Due to that we were starting to see freezes which we fixed in 5.10.3.1 (emergency release). After that got fixed we got crashes in situations like this here - fixed in 5.10.4 and now we see compositing failing to start again.

The idea is to prevent crashes of the compositor. If nvidia thinks that OpenGL should not work at all - so be it.
Comment 4 Yannick 2017-07-24 16:39:14 UTC
Running Kwin 5.10.4 here, with nvidia drivers too (GTX 950).

In my case, after running fullscreen games like Xonotic, kwin successfully enables compositing again.

However, almost every time I start the Steam client, compositing is disabled and then it's impossible to enable it again, even with Alt+Shift+F12.

Switching to the OpenGL 3.1 backend looks like a good workaround, though, as I don't have any issue with it.
The problem mentioned above only happens with the OpenGL 2 backend.
Comment 5 Frederick Zhang 2017-07-26 00:22:16 UTC
Literally has barely got a single day issueless since Nvidia switched to proprietary drivers. Sometimes fails Xorg, sometimes desktop, sometimes FFmpeg... I know crafting a driver is bloodily difficult but still shame on them.
Comment 6 Yannick 2017-07-26 10:37:12 UTC
Ok, forget what I said in my previous comment...

I just had the same issue with the OpenGL 3.1 backend (starting Steam will disable kwin compositing, and it won't enable it again).
Comment 7 Buck Shockley 2017-07-28 16:55:28 UTC
(In reply to Yannick from comment #6)
> Ok, forget what I said in my previous comment...
> 
> I just had the same issue with the OpenGL 3.1 backend (starting Steam will
> disable kwin compositing, and it won't enable it again).

Every time I've had this problem, it's been directly related to Steam. It happened just now when trying to launch TF2 after it crashed. Exact same error in journalctl.
Comment 8 Buck Shockley 2017-08-01 03:59:58 UTC
This may be a stupid question, but I noticed a couple other things sometimes popping up at the exact same time in journalctl:

Jul 31 23:49:01 buck-pc kernel: NVRM: Xid (PCI:0000:01:00): 31, Ch 00000030, engmask 00000101, intr 10000000
Jul 31 23:49:01 buck-pc kwin_x11[1006]: Error loading text-to-speech plug-in "flite"
Jul 31 23:49:01 buck-pc kwin_x11[1006]: kwin_core: OpenGL 2 compositing setup failed
Jul 31 23:49:01 buck-pc kwin_x11[1006]: kwin_core: Failed to initialize compositing, compositing disabled

The Arch wiki says the NVRM bit is related to hardware acceleration in Flash and a reddit post on /r/kde described an identical log output, even with the flite error. Could this be related to bug 381870?
Comment 9 Martin Flöser 2017-08-01 14:52:34 UTC
These messages are most likely unrelated.