Bug 384403 - Frequent compositing failure with GTX 1070 and associated Xid 31 error
Summary: Frequent compositing failure with GTX 1070 and associated Xid 31 error
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.10.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-05 21:32 UTC by Michael Wood
Modified: 2017-12-04 11:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: NVIDIA+


Attachments
screenshot for uncheck the option of allow application to block compositing (89.24 KB, image/png)
2017-12-03 03:15 UTC, younker.dl@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Wood 2017-09-05 21:32:16 UTC
I am experiencing frequent failure of the kwin compositor since I upgraded my video card from a GTX 670 to a GTX 1070. When the failure occurs the compositor fails to restart so I have to restart kwin to get it back. The failure is always accompanied by an NVRM Xid 31 error. I am able to reliably reproduce the problem using Steam by clicking back and forth between Library and Store rapidly. I have a video of the failure along with the logging here: https://www.youtube.com/watch?v=mW6AM1CauNw

I found a Manjaro user reporting the exact same errors, using the same version of kwin, and the same GPU here: https://forum.manjaro.org/t/stupid-issue-with-plasmashell/30425

I have been unable to reproduce the issue when I enable the options "Force Composition Pipeline" and "Force Full Composition Pipeline" in nvidia-settings. I am also unable to reproduce it if I set the compositor to XRender backend. I am able to reproduce it with both the OpenGL 2.0 and OpenGL 3.1 backends.

I have tried Nvidia driver versions 381.22, 384.59, and 384.69. The behavior is identical.

Here is a snippet of my kwin output:

QXcbConnection: XCB error: 9 (BadDrawable), sequence: 3071, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbWindow: Unhandled client message: "_NET_CURRENT_DESKTOP"
OpenGL vendor string:                   NVIDIA Corporation
OpenGL renderer string:                 GeForce GTX 1070/PCIe/SSE2
OpenGL version string:                  4.5.0 NVIDIA 384.69
OpenGL shading language version string: 4.50 NVIDIA
Driver:                                 NVIDIA
Driver version:                         384.69
GPU class:                              Unknown
OpenGL version:                         4.5
GLSL version:                           4.50
X server version:                       1.19.3
Linux kernel version:                   4.12.10
Requires strict binding:                no
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
kwin_core: OpenGL 2 compositing setup failed
kwin_core: Failed to initialize compositing, compositing disabled
QXcbConnection: XCB error: 3 (BadWindow), sequence: 34741, resource id: 485, major code: 3 (GetWindowAttributes), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 34742, resource id: 485, major code: 14 (GetGeometry), minor code: 0

And a snippet from my kernel log:

[ 9732.672669] NVRM: GPU at PCI:0000:01:00: GPU-ba0bb41c-e9e7-bf70-8f3b-953075a5dd6e
[ 9732.672671] NVRM: GPU Board Serial Number: 
[ 9732.672673] NVRM: Xid (PCI:0000:01:00): 31, Ch 00000058, engmask 00000101, intr 10000000
Comment 1 Martin Flöser 2017-09-06 15:02:37 UTC
Sorry but there is not much we can do here. The driver indicates a failure and due to that we bail out.
Comment 2 Allan 2017-11-08 20:53:00 UTC
kwin_x11 seems to trigger the mmu exception (xid 31). It started around version 5.10.3.
http://docs.nvidia.com/deploy/xid-errors/index.html#topic_5_2

I also run into this issue, but I don't play games much so it's not often for me.

It is still a problem with $ kwin_x11 --version: kwin 5.11.3

/Allan
Comment 3 younker.dl@gmail.com 2017-12-03 02:08:39 UTC
I have the same error with kwin 5.11.3 as well with my nvidia 1080Ti. Even I don't play games. I use gentoo as my primary development machine. for some packages such like krita, opera, chrome, etc. it unexpected to have this error triggered. 

REally hope this can be solved either from nvidia driver side or KDE side.
Comment 4 younker.dl@gmail.com 2017-12-03 03:15:29 UTC
Created attachment 109184 [details]
screenshot for uncheck the option of allow application to block compositing

It seems the kwin's issue can be solved by uncheck the option "Allow application to block compositing".
Comment 5 younker.dl@gmail.com 2017-12-03 03:18:59 UTC
(In reply to younker.dl@gmail.com from comment #4)
> Created attachment 109184 [details]
> screenshot for uncheck the option of allow application to block compositing
> 
> It seems the kwin's issue can be solved by uncheck the option "Allow
> application to block compositing".

Sorry, this is wrong, after I reboot, the error happens again. So above is not a solution.
Comment 6 younker.dl@gmail.com 2017-12-04 11:55:31 UTC
Maybe the bug is duplicate with https://bugs.kde.org/show_bug.cgi?id=387191 which some opengl invocation calls the memory allocation on the driver code crashed. 

Now I found it may just happens on some particular application which involved opengl, like krita, opera, etc. 

Not sure whether this is a driver issue or application issue, but it definitely bad experience for users.