Bug 493295 - Substantially worse software rendering performance with KDE 6.2 beta compared to 6.1 (Fedora Rawhide)
Summary: Substantially worse software rendering performance with KDE 6.2 beta compared...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (show other bugs)
Version: 6.1.90
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 494251 494459 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-09-17 21:37 UTC by Adam Williamson
Modified: 2024-10-17 17:12 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.1.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Williamson 2024-09-17 21:37:19 UTC
SUMMARY
As reported at https://bugzilla.redhat.com/show_bug.cgi?id=2312900 , I noticed a Fedora openQA test has been failing quite often since KDE 6.2 Beta landed. The test is of Firefox, and it fails because Firefox does not complete startup within the timeframe the test expects. Playing around with this manually, I found it seems to be because KDE 6.2 performs far worse with software rendering than 6.1 did. (The openQA tests run in VMs with virtio graphics and without 3D passthrough; the host systems have weak graphics cards and run 30 tests simultaneously, 3D passthrough is impractical in such a configuration).

I was able to distil this down to a pretty simple test: boot a Fedora live image on a bare metal system with 'nomodeset' to force software rendering, open a terminal, run 'top' in it, then drag it around in circles for a while and observe the CPU usage stats as you do it. On an image with the 6.2 Beta update - https://bodhi.fedoraproject.org/updates/FEDORA-2024-e78c579506 - the movement of the window is jerky, and kwin_wayland CPU usage spikes to 750-800% on my test system. On an earlier image with 6.1, the movement of the window is smooth, and kwin_wayland CPU usage peaks around 300-350%.

I tested with https://kojipkgs.fedoraproject.org/compose/rawhide/Fedora-Rawhide-20240914.n.0/compose/Spins/x86_64/iso/Fedora-KDE-Live-x86_64-Rawhide-20240914.n.0.iso (6.1-based image) and https://kojipkgs.fedoraproject.org/compose/rawhide/Fedora-Rawhide-20240917.n.0/compose/Spins/x86_64/iso/Fedora-KDE-Live-x86_64-Rawhide-20240917.n.0.iso (6.2-based image). There are other differences between these nightlies, of course, but the openQA test results make it fairly clear that the KDE 6.2 update is what triggered this problem. Before that update, it was not happening; as soon as that update landed, it started happening. The images are garbage-collected after two weeks, so the 6.1 one will no longer be available around September 28.

STEPS TO REPRODUCE
1.  Boot a KDE system, forcing use of software rendering (e.g. with nomodeset)
2. Observe performance with typical desktop tasks (navigating system menus, running applications, moving windows)
3. Check CPU usage in a top utility, especially kwin_wayland

OBSERVED RESULT
With a 6.2 image, all aspects of performance are significantly worse than with a 6.1 image

EXPECTED RESULT
6.2 should perform as well as 6.1 or better

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Rawhide
KDE Plasma Version: 6.1.90
Comment 1 Bug Janitor Service 2024-09-17 22:44:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6409
Comment 2 Zamundaaa 2024-09-18 14:45:21 UTC
Git commit 260cf817b88635aaeb405b6c1d93a6268e606d62 by Xaver Hugl.
Committed on 18/09/2024 at 14:00.
Pushed by zamundaaa into branch 'master'.

scene/itemrenderer_opengl: use the color pipeline to check if color transformations are needed

Comparing the color descriptions can yield in false negatives, when the luminance
levels between two gamma 2.2 encoded images don't match.

M  +3    -1    src/scene/itemrenderer_opengl.cpp

https://invent.kde.org/plasma/kwin/-/commit/260cf817b88635aaeb405b6c1d93a6268e606d62
Comment 3 Rik Mills 2024-10-05 04:24:25 UTC
This was reported against 6.2 beta but seems to have been only committed to master and not cherry-picked for the 6.2 branch.
Comment 4 Adam Williamson 2024-10-16 16:14:50 UTC
Hah. Yes. And I just spent an hour re-investigating the same damn problem...because the backport of this fix got dropped from the Fedora package when it was bumped to 6.2.0, but this fix is not actually in 6.2.0 (or 6.2.1). Well, that's that mystery solved.
Comment 5 Zamundaaa 2024-10-16 17:08:00 UTC
Git commit 9370f7d19e4a047c72981d5b8f46a24eefd7cc83 by Xaver Hugl.
Committed on 16/10/2024 at 17:07.
Pushed by zamundaaa into branch 'Plasma/6.2'.

scene/itemrenderer_opengl: use the color pipeline to check if color transformations are needed

Comparing the color descriptions can yield in false negatives, when the luminance
levels between two gamma 2.2 encoded images don't match.


(cherry picked from commit 260cf817b88635aaeb405b6c1d93a6268e606d62)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +3    -1    src/scene/itemrenderer_opengl.cpp

https://invent.kde.org/plasma/kwin/-/commit/9370f7d19e4a047c72981d5b8f46a24eefd7cc83
Comment 6 Zamundaaa 2024-10-16 17:48:19 UTC
*** Bug 494459 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2024-10-17 16:12:04 UTC
*** Bug 494251 has been marked as a duplicate of this bug. ***