You are not logged in.

#1 2018-09-23 08:29:13

Volodymyr
Member
Registered: 2016-04-24
Posts: 9

Strange nvidia performance issue on KDE (again ?)

Hi. So i installed Arch on my new PC.

I use latest KDE and `nvidia` package.
After installation i had problems with kwin tearing so i added an option export __GL_YIELD="USLEEP" at OS load and it fixed tearing issue.

When i boot to OS - everything works fine. Good performance, smooth composting effects.

But at some point, something happens, and animations and windows dragging became slower (laggy).

Its not like "lags that you can't work", but window dragging become annoying, like 2-3 times less frames per second.

I checked processes load and CPU is free (always < 10% load).
nvidia-smi showing 17% GPU utilization on window dragging.

And sometimes its starting to work smooth again. I don't really see the reason.

Please point me a direction what i can check or what may cause such problems.
Any thoughts appreciated. Guys, this is the only problem holding me from switching to linux.

Last edited by Volodymyr (2018-09-23 08:36:01)

Offline

#2 2018-09-23 09:04:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,740

Re: Strange nvidia performance issue on KDE (again ?)

USLEEP can have side effects like these. Try to use export KWIN_TRIPLE_BUFFER=1 instead.  Kwin usually enables that using a heuristic which turns up false on the nvidia blob, despite it being supported. And usually fixing the problem without inducing the perf penalty that switching the yielding method might have.

Last edited by V1del (2018-09-23 09:09:02)

Offline

#3 2018-09-23 09:11:42

Volodymyr
Member
Registered: 2016-04-24
Posts: 9

Re: Strange nvidia performance issue on KDE (again ?)

Thanks, V1del. I am checking it. Will respond here later.

Offline

#4 2018-09-23 11:01:24

Volodymyr
Member
Registered: 2016-04-24
Posts: 9

Re: Strange nvidia performance issue on KDE (again ?)

V1del, it works great so far. Thank you very much! I wonder why this parameter is not set by default.

Last edited by Volodymyr (2018-09-23 11:02:09)

Offline

#5 2018-09-23 11:52:14

seth
Member
Registered: 2012-09-03
Posts: 51,270

Re: Strange nvidia performance issue on KDE (again ?)

grep -i triple /var/log/Xorg.0.log

Triple buffering is *NOT* enabled by default on the nvidia blob.
Exporting the environment in contrast to that might actually lead to a frame skips.

The original problem actually sounds like you're running into a vsync misprediction or sync multiple times per frame.
If you want to go w/ TB enabled, you should™ ("better") actually enable it as well,

/etc/X11/xorg.conf.d/20-nvidia.conf

Section "Device"
    Identifier "Default nvidia Device"
    Driver	"nvidia"
    Option	"NoLogo"				"True"
    Option	"TripleBuffer"			"True"
EndSection

edit: end section ;-)

Last edited by seth (2018-09-23 11:52:44)

Offline

#6 2018-09-23 12:12:49

Volodymyr
Member
Registered: 2016-04-24
Posts: 9

Re: Strange nvidia performance issue on KDE (again ?)

seth, i haven't generated xorg file after i installed nvidia.
It actually works much better after i set KWIN_TRIPLE_BUFFER environment variable.
Do you think it worth to generate it and enable TripleBuffer from there ?

Last edited by Volodymyr (2018-09-23 12:13:26)

Offline

#7 2018-09-23 12:30:41

seth
Member
Registered: 2012-09-03
Posts: 51,270

Re: Strange nvidia performance issue on KDE (again ?)

Yes, absolutely.
What happens otherwise is the kwin believes that glSwap* doesn't block - while it actually does, what will completely mess up timing calculations.
You can then "legally" enforce KWIN_TRIPLE_BUFFER and also omit USLEEP yielding (which after all those years might be pointless anyway - the nvidia blob just used to run a busy wait on the CPU back then)

Offline

#8 2018-09-23 12:49:33

Volodymyr
Member
Registered: 2016-04-24
Posts: 9

Re: Strange nvidia performance issue on KDE (again ?)

Ok thanks @seth, i will try to do it, and report here later.

Offline

#9 2018-09-23 13:35:38

Volodymyr
Member
Registered: 2016-04-24
Posts: 9

Re: Strange nvidia performance issue on KDE (again ?)

seth, it seems it works even better. Even small lag on window start dragging has gone. Thank you smile

Offline

Board footer

Powered by FluxBB