Massive KWin lag after closing any OpenGL application

Hi folks, I have a totally bizarre issue… wonder if anyone can help.

My system works totally as normal until I open up a game that uses OpenGL (or a Proton game that uses DirectX equally, as that runs through OpenGL as I understand it). While the game is running, I can tab out and everything works fine. The game works fine, too.

However, as soon as I close the game, my system starts massively lagging. If I’m in a voice call, voices start breaking up and rapidly become so choppy they’re unintelligible; if I’m typing in an input field, I have multiple seconds of lag between my typing and the text appearing in the field; if I’m dragging windows around the desktop, it goes so incredibly slowly it’s unreal.

If I open any OpenGL application again, disable compositing in KWin, or run kwin_x11 --replace, everything goes back to normal… until I next close an OpenGL application, when the problems return. However, interestingly, if I run kwin_x11 --replace and then subsequently open up an OpenGL application, this doesn’t seem to happen… which is thoroughly unhelpful for capturing any logs that might be left to indicate a root cause.

I’m honestly at a loss as to where I’d even begin to troubleshoot this. Can anyone help? I’ve tried both using default kwin and kwin_lowlatency, to no avail. I think it’s a compositor issue, but I’m not experienced enough in KWin internals to work that out properly.

I am using the NVidia DRM KMS as instructed on the Arch wiki, and have TripleBuffer on in my xorg.conf. I have tried both with ForceFullCompositionPipeline set and unset. I’m using an NVIDIA GeFore GTX 1060 3GB, with an Intel i5-4460 processor.

1 Like

Hello,

If you use that, then you must also have the kwin.sh file. See here an example:

Also try this settings for compositor:

Are you on KDE Plasma or KDE Plasma GIT, and what nvidia drivers version have you installed?

Thanks, I’m giving that script and those compositor settings a go now. As to versions, I’m on KDE Plasma as in the Manjaro repositories, apart from replacing kwin with kwin-lowlatency from the AUR. The problem predates that, though - I installed lowlatency to try and fix the issue.

Re Nvidia versions, also the latest Manjaro package:

Wed Sep  2 19:43:02 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100      Driver Version: 440.100      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 106...  Off  | 00000000:01:00.0  On |                  N/A |
| 56%   38C    P0    32W / 120W |    974MiB /  3018MiB |     11%      Default |
+-------------------------------+----------------------+----------------------+

It was looking good for a while, but it’s happened again, unfortunately. Interestingly, this time what triggered it was different: I changed the “Titlebar Buttons” arrangement in the “Window Decorations” settings applet. Immediately following that, the lag started. Disabling compositing stops the lag, but as soon as I re-enable it, it starts again. The only thing I can do to get compositing back without the lag is restart, or run kwin_x11 --replace.

All this happens with or without what i suggested previously?

This is all with the kwin.sh set, and the relevant configuration set in /etc/X11/mhwd.d/nvidia.conf.

Well, i can only suggest to try with a TEMP user and see if the issue is present there. If is not, then some of your personal config files might have something off in them. If the issue persists there too then i would start investigation BIOS, hardware, power source, cables …

I think this MAY be the same issue as this- 426412 – Kwin laggy after pausing and un-pausing compositing come to thing of it, before reporting,the only apps I tested were OpenGL and Proton DirectX apps- but I still noitce this now.