Bug 385324 - kwin: Desktop effects were restarted due to a graphics reset
Summary: kwin: Desktop effects were restarted due to a graphics reset
Status: RESOLVED DUPLICATE of bug 385291
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.10.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 401410 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-03 13:44 UTC by Markus
Modified: 2018-11-26 08:35 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kwin_x11 log output (71.35 KB, text/plain)
2017-10-03 13:54 UTC, Markus
Details
qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation (5.35 KB, text/plain)
2017-10-03 13:57 UTC, Markus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus 2017-10-03 13:44:25 UTC
frameworks 5.38.0
plasma 5.10.5
apps 17.08.1
qt 5.9.1
nvidia driver 384.90
kernel 4.13.4

Sometimes when starting konqueror I get the error message "Desktop effects were restarted due to a graphics reset" from kwin and the desktop effects are disabled. I am unable to enable them again (Ctrl+Alt+F12).

Restarting kwin brings the effects back.

Starting kwin from console with debugging and triggering this bug I get:
17-10-03 15:28.07: kwin_core: A graphics reset attributable to the current GL context occurred.
17-10-03 15:28.07: kwin_core: Attempting to reset compositing.

17-10-03 15:28.08: kwin_core: Initializing OpenGL compositing

17-10-03 15:28.08: kwin_platform_x11_standalone: Choosing GLXFBConfig 0xb5 X visual 0x2b depth 24 RGBA 8:8:8:0 ZS 0:0
17-10-03 15:28.08: OpenGL vendor string:                   NVIDIA Corporation
17-10-03 15:28.08: OpenGL renderer string:                 GeForce GTX 750 Ti/PCIe/SSE2
17-10-03 15:28.08: OpenGL version string:                  4.5.0 NVIDIA 384.90
17-10-03 15:28.08: OpenGL shading language version string: 4.50 NVIDIA
17-10-03 15:28.08: Driver:                                 NVIDIA
17-10-03 15:28.08: Driver version:                         384.90
17-10-03 15:28.08: GPU class:                              Unknown
17-10-03 15:28.08: OpenGL version:                         4.5
17-10-03 15:28.08: GLSL version:                           4.50
17-10-03 15:28.08: X server version:                       1.19.3
17-10-03 15:28.08: Linux kernel version:                   4.13.4
17-10-03 15:28.08: Requires strict binding:                no
17-10-03 15:28.08: GLSL shaders:                           yes
17-10-03 15:28.08: Texture NPOT support:                   yes
17-10-03 15:28.08: Virtual Machine:                        no
17-10-03 15:28.08: kwin_platform_x11_standalone: Direct rendering: true
17-10-03 15:28.08: kwin_core: Initializing fences for synchronization with the X command stream
17-10-03 15:28.08: kwin_core: OpenGL 2 compositing setup failed
17-10-03 15:28.08: kwin_core: Failed to initialize compositing, compositing disabled


At the same time (15:28:07) I also get this in dmesg:
NVRM: Xid (PCI:0000:01:00): 31, Ch 00000018, engmask 00000101, intr 10000000
Comment 1 Markus 2017-10-03 13:46:15 UTC
Shift+Alt+F12 of course.
Comment 2 Markus 2017-10-03 13:54:44 UTC
Created attachment 108139 [details]
kwin_x11 log output

Replace kwin, then started konqueror via alt+f2 a few times until the message is displayed. (After that I replaced kwin again.)
Comment 3 Markus 2017-10-03 13:57:11 UTC
Created attachment 108140 [details]
qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation
Comment 4 Martin Flöser 2017-10-03 16:54:13 UTC
Graphics reset is something the graphics driver reports to KWin. This is intended behavior (restart instead of crash). That the driver triggers graphics resets is something you need to report to your driver.
Comment 5 Markus 2017-10-03 17:16:16 UTC
1. The message states that the effect were restarted. (Which is wrong, they are not restarted. I am left a static "desktop", new windows are not shown in the taskbar.)

2. The recovery after such an intended reset is not working. (Restarting kwin does work though.)

3. What I think is interesting, that the reset is happening when konqueror starts. (Without any open page being rendered.) And not when using any fancy 3d applications.
So you are sure that the reset is about something wrong in driver, that can not be caused by userland? (I cannot judge what kind of error would issue such a reset.)


1 and 2 ares still valid for kwin, I think.
Comment 6 Martin Flöser 2017-10-03 17:22:13 UTC

*** This bug has been marked as a duplicate of bug 385291 ***
Comment 7 Markus 2017-10-14 14:51:17 UTC
http://docs.nvidia.com/deploy/xid-errors/index.html#topic_2

XID 31: Fifo: MMU Error
This event is logged when a fault is reported by the MMU, such as when an illegal address access is made by an applicable unit on the chip Typically these are application-level bugs, but can also be driver bugs or hardware bugs.

When this event is logged, NVIDIA recommends the following:

* Run the application in cuda-gdb or cuda-memcheck , or
* Run the application with CUDA_DEVICE_WAITS_ON_EXCEPTION=1 and then attach later with cuda-gdb, or
* File a bug if the previous two come back inconclusive to eliminate potential NVIDIA driver or hardware bug.

Note: The cuda-memcheck tool instruments the running application and reports which line of code performed the illegal read.
Comment 8 Markus 2017-10-14 15:13:25 UTC
https://devtalk.nvidia.com/default/topic/1023621/linux/frequent-kwin-compositing-failure-with-associated-xid-31-error/post/5207959/
Setting "Force Composition Pipeline" and "Force Full Composition Pipeline" in nvidia-settings works as workaround. (reduce performance)
Comment 9 younker.dl@gmail.com 2017-12-19 23:26:02 UTC
(In reply to Markus from comment #8)
> https://devtalk.nvidia.com/default/topic/1023621/linux/frequent-kwin-
> compositing-failure-with-associated-xid-31-error/post/5207959/
> Setting "Force Composition Pipeline" and "Force Full Composition Pipeline"
> in nvidia-settings works as workaround. (reduce performance)


Do you still have the issue? I still have the issues which is annoying. I have posted some update on the devtalk.nvidia thread, but seems no nvidia people care about it.
Comment 10 Markus 2017-12-20 07:24:58 UTC
Yes I still have this problem.
Those pipeline setting prevents it. (At cost of performance.)

I still think its at least two bugs:
1. Recovery from the graphics reset is not working. (kwin bug?)
2. Graphics reset itself: Intended behaviour of driver: "Typically these are application-level bugs, but can also be driver bugs or hardware bugs." So it can be nvidia and/or "application" (kwin, or what ever application uses the hw directly)
Comment 11 younker.dl@gmail.com 2017-12-20 12:15:58 UTC
(In reply to Markus from comment #10)
> Yes I still have this problem.
> Those pipeline setting prevents it. (At cost of performance.)
> 
> I still think its at least two bugs:
> 1. Recovery from the graphics reset is not working. (kwin bug?)
> 2. Graphics reset itself: Intended behaviour of driver: "Typically these are
> application-level bugs, but can also be driver bugs or hardware bugs." So it
> can be nvidia and/or "application" (kwin, or what ever application uses the
> hw directly)

But how do you enable the 2 options through nvidia-settings. I can't see it from the GUI, and when I use the command line nvidia-settings -q all, I can't see these 2 options either. 

Thanks
Comment 12 younker.dl@gmail.com 2017-12-20 12:18:55 UTC
btw, this maybe an issue of kwin. As the issue happens, the mouse cursor is still  able to move, which means the driver still works, but just the application calls something which cause the GPU memory states error, right?
Comment 13 Markus 2017-12-20 12:41:10 UTC
nvidia-settings => "X Server Display Configuration" => Button "Advanced..." => Now you should see the two checkboxes. (The setting is per device, so you need to set it twice if you use dualhead/twinview.)

The cause for Xid 31 (comment#7) is very vague, so it can be kwin, it can be the application (like konqueror/akreagtor) or the nvidia driver.
Comment 14 younker.dl@gmail.com 2017-12-21 12:21:59 UTC
(In reply to Markus from comment #13)
> nvidia-settings => "X Server Display Configuration" => Button "Advanced..."
> => Now you should see the two checkboxes. (The setting is per device, so you
> need to set it twice if you use dualhead/twinview.)
> 
> The cause for Xid 31 (comment#7) is very vague, so it can be kwin, it can be
> the application (like konqueror/akreagtor) or the nvidia driver.

Thanks a lot. I will use these 2 options to avoid this error for some time. Just hope these 2 options will not impact the performance of CUDA as I bought this nvidia card to use for my machine learning stuff.
Comment 15 Markus 2018-01-16 19:28:36 UTC
Updated to nvidia-drivers-390.12, now the pipeline workaround does no longer work for me.

Because kwin is unable to recover from the graphics reset I created a small script in ~/.config/autostart/ that will restart kwin to enable compositing again. Its working fine for me and at least reduces the impact of the Xid 31.

#!/bin/sh

touch /tmp/restart_kwin

while true
do
        if test -e /tmp/restart_kwin
        then
                rm /tmp/restart_kwin
                (
                        kwin_x11 --replace 2>&1 | while read line
                        do
                                if test "_$line" = "_kwin_core: Failed to initialize compositing, compositing disabled"
                                then
                                        touch /tmp/restart_kwin
                                fi
                        done
                ) &> /dev/null &
        fi
        sleep 1
done
Comment 16 YAFU 2018-04-13 22:59:27 UTC
@Markus, Thank you very much for the workaround.

I have the same problem in Kubuntu 18.04. Currently 390.48 nvidia driver installed.
Most of the time when I resume/wake up PC from sleep/suspend to RAM, I get "Desktop effects were restarted due to a graphics reset" message and the composition breaks down, it starts blinking/flickering in Brisa window decorator title bar, the task manager in panel starts to work wrong, some applications are not shown and panel becomes full transparent. It is really annoying.
Running Markus script returns everything to normal.
Comment 17 Vlad Zahorodnii 2018-11-25 20:09:57 UTC
*** Bug 401410 has been marked as a duplicate of this bug. ***
Comment 18 Vlad Zahorodnii 2018-11-26 08:35:28 UTC
*** Bug 401410 has been marked as a duplicate of this bug. ***