Bug 480885 - High CPU usage for window under cursor \ plasma shell (if over desktop) and kwin_wayland when moving mouse cursor
Summary: High CPU usage for window under cursor \ plasma shell (if over desktop) and k...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-05 10:22 UTC by feature
Modified: 2024-08-06 16:24 UTC (History)
4 users (show)

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


Attachments
Screenshot of hotspot (123.72 KB, image/png)
2024-02-25 08:23 UTC, feature
Details
hotspot flamegraph screenshot (392.97 KB, image/png)
2024-06-12 12:33 UTC, Dashon
Details
hotspot flamegraph firefox playback (353.70 KB, image/png)
2024-06-12 12:49 UTC, Dashon
Details
Screen Recording of htop as I move the mosue around. (2.61 MB, video/x-matroska)
2024-06-15 09:27 UTC, Dashon
Details
Video of htop taken on my phone. (3.82 MB, video/mp4)
2024-06-15 12:37 UTC, Dashon
Details
Debug Symbols Failed to Load Apparently. (96.03 KB, image/png)
2024-07-22 21:04 UTC, Dashon
Details
Flamegraph with hopefully more debug symbols. (337.22 KB, image/png)
2024-07-22 22:05 UTC, Dashon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description feature 2024-02-05 10:22:07 UTC
SUMMARY

When moving the mouse, the CPU usage of the window under the cursor, as well as kwin_wayland is very high.

STEPS TO REPRODUCE
1. move cursor over a window or over the desktop

OBSERVED RESULT
The CPU usage shoots up (over 30% for kwin_wayland, and another over 25% for the window under the cursor) on my machine, i.e. more than 50% cpu.

Interestingly, when there's another process which uses 100% cpu, when moving the cursor kwin_wayland "only" uses 17%, and the window under the cursor "only" uses 7%.

EXPECTED RESULT
There should be a negligible cpu usage from just moving the mouse cursor around

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.1

ADDITIONAL INFORMATION

System:
  Kernel: 6.5.0-15-generic x86_64 bits: 64 compiler: N/A
    Desktop: KDE Plasma 6.0.80 Distro: KDE neon 22.04 Unstable Edition
    base: Ubuntu 22.04 LTS Jammy
Machine:
  Type: Desktop System: Dell product: Precision 3630 Tower v: N/A
    serial: <superuser required>
  Mobo: Dell model: 0NNNCT v: A01 serial: <superuser required> UEFI: Dell
    v: 2.25.0 date: 11/09/2023
CPU:
  Info: 6-core model: Intel Core i7-8700 bits: 64 type: MT MCP
    arch: Coffee Lake rev: A cache: L1: 384 KiB L2: 1.5 MiB L3: 12 MiB
  Speed (MHz): avg: 800 high: 804 min/max: 800/4600 cores: 1: 804 2: 800
    3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800
    bogomips: 76799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630]
    vendor: Dell CometLake-S driver: i915 v: kernel bus-ID: 00:02.0
  Device-2: NVIDIA GP104 [GeForce GTX 1080] vendor: Dell driver: nouveau
    v: kernel bus-ID: 01:00.0
  Display: wayland server: X.org v: 1.21.1.4 with: Xwayland v: 23.2.3
    compositor: kwin_wayland driver: X: loaded: modesetting
    unloaded: fbdev,vesa gpu: i915,nouveau resolution: 1920x1080
  OpenGL: renderer: NV134 v: 4.3 Mesa 23.0.4-0ubuntu1~22.04.1
    direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Dell driver: snd_hda_intel
    v: kernel bus-ID: 00:1f.3
  Device-2: NVIDIA GP104 High Definition Audio vendor: Dell
    driver: snd_hda_intel v: kernel bus-ID: 01:00.1
  Sound Server-1: ALSA v: k6.5.0-15-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Ethernet I219-LM vendor: Dell driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6
  IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
RAID:
  Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0
    bus-ID: 00:17.0
Drives:
  Local Storage: total: 476.94 GiB used: 0 KiB (0.0%)
  ID-1: /dev/sda vendor: Micron model: 1100 SATA 512GB size: 476.94 GiB
Partition:
  ID-1: / size: 15.58 GiB used: 338.7 MiB (2.1%) fs: overlay source: ERR-102
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 29.0 C pch: 43.0 C mobo: 29.0 C gpu: nouveau
    temp: 39.0 C
  Fan Speeds (RPM): cpu: 1561 fan-2: 852 gpu: nouveau fan: 1008
Info:
  Processes: 276 Uptime: 2h 38m Memory: 31.17 GiB used: 3.96 GiB (12.7%)
  Init: systemd runlevel: 5 Compilers: gcc: 11.4.0 Packages: 2184 Shell: Bash
  v: 5.1.16 inxi: 3.3.13
Comment 1 Nate Graham 2024-02-05 21:18:53 UTC
Does the issue go away if you use the proprietary drivers, rather than Nouveau?
Comment 2 feature 2024-02-06 16:21:12 UTC
(In reply to Nate Graham from comment #1)
> Does the issue go away if you use the proprietary drivers, rather than
> Nouveau?

No. I've installed the nvidia drivers using ubuntu-drivers, it's still using up about the same amount of CPU.

The only difference is that now even on idle kwin_wayland uses 20% CPU, and nv_queue uses 15% CPU.
When moving the mouse kwin_wayland now uses almost 50% CPU, the window under the cursor still uses around 20%, and nv_queue uses about 10% CPU.

Here's the updated system details:

System:
  Kernel: 6.5.0-15-generic x86_64 bits: 64 compiler: N/A
    Desktop: KDE Plasma 6.0.80 Distro: KDE neon 22.04 Unstable Edition
    base: Ubuntu 22.04 LTS Jammy
Machine:
  Type: Desktop System: Dell product: Precision 3630 Tower v: N/A
    serial: <superuser required>
  Mobo: Dell model: 0NNNCT v: A01 serial: <superuser required> UEFI: Dell
    v: 2.26.0 date: 12/08/2023
CPU:
  Info: 6-core model: Intel Core i7-8700 bits: 64 type: MT MCP
    arch: Coffee Lake rev: A cache: L1: 384 KiB L2: 1.5 MiB L3: 12 MiB
  Speed (MHz): avg: 1170 high: 4354 min/max: 800/4600 cores: 1: 900 2: 900
    3: 851 4: 900 5: 800 6: 800 7: 1039 8: 900 9: 832 10: 4354 11: 966 12: 800
    bogomips: 76799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630]
    vendor: Dell CometLake-S driver: i915 v: kernel bus-ID: 00:02.0
  Device-2: NVIDIA GP104 [GeForce GTX 1080] vendor: Dell driver: nvidia
    v: 535.154.05 bus-ID: 01:00.0
  Display: wayland server: X.org v: 1.21.1.4 with: Xwayland v: 23.2.3
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia
    unloaded: fbdev,nouveau,vesa gpu: i915,nvidia resolution: 1920x1080
  OpenGL: renderer: NVIDIA GeForce GTX 1080/PCIe/SSE2
    v: 4.6.0 NVIDIA 535.154.05 direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Dell driver: snd_hda_intel
    v: kernel bus-ID: 00:1f.3
  Device-2: NVIDIA GP104 High Definition Audio vendor: Dell
    driver: snd_hda_intel v: kernel bus-ID: 01:00.1
  Sound Server-1: ALSA v: k6.5.0-15-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Ethernet I219-LM vendor: Dell driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6
  IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
RAID:
  Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0
    bus-ID: 00:17.0
Drives:
  Local Storage: total: 476.94 GiB used: 9.68 GiB (2.0%)
  ID-1: /dev/sda vendor: Micron model: 1100 SATA 512GB size: 476.94 GiB
Partition:
  ID-1: / size: 19.12 GiB used: 9.59 GiB (50.2%) fs: ext4 dev: /dev/sda6
  ID-2: /boot/efi size: 646 MiB used: 90.2 MiB (14.0%) fs: vfat
    dev: /dev/sda1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 39.0 C pch: 47.0 C mobo: 39.0 C
  Fan Speeds (RPM): cpu: 1569 fan-2: 859
Info:
  Processes: 279 Uptime: 2m Memory: 31.17 GiB used: 2.42 GiB (7.8%)
  Init: systemd runlevel: 5 Compilers: gcc: 11.4.0 Packages: 2181 Shell: Bash
  v: 5.1.16 inxi: 3.3.13
Comment 3 feature 2024-02-07 06:31:14 UTC
With regards to the increased kwin_wayland cpu usage on my latest reply (as compared to my first one): it stemmed from the fps desktop effect - when I turned it off, the figures returned to the ones I have reported initially, that is to say, the nvidia driver didn't make it worse (nor better).
Comment 4 Nate Graham 2024-02-07 17:29:12 UTC
Thanks.
Comment 5 Zamundaaa 2024-02-19 22:21:02 UTC
Can't reproduce; I get around 5% combined CPU usage kwin_wayland + plasmashell when moving the cursor over the desktop with a 12k DPI mouse.
If you can consistently see this high CPU usage, you could try finding out what's causing it in kwin with hotspot (https://github.com/KDAB/hotspot). Just record a trace of the kwin_wayland process, and check if any single function call looks conspicuous in the flame graph.
Comment 6 feature 2024-02-25 08:23:11 UTC
Created attachment 166085 [details]
Screenshot of hotspot

I don't really know how to make sense of this, especially with the missing debug symbols... But here's the flame graph.
Comment 7 Zamundaaa 2024-03-06 23:39:21 UTC
Yeah, we definitely need a flamegraph with debug symbols for plasmashell and Qt at least, this unfortunately doesn't look useful
Comment 8 feature 2024-03-11 11:32:05 UTC
What do I need to do to have these debug symbols? I'm using Neon
Comment 9 Bug Janitor Service 2024-03-26 03:46:43 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 feature 2024-04-03 07:41:18 UTC
Can you help me setting KDE Neon to have the debug symbols needed to profile this?
Comment 11 Bug Janitor Service 2024-04-18 03:47:34 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 feature 2024-04-21 08:27:51 UTC
Hi, I'd really like to help figure out why I'm seeing this increased CPU usage, but I couldn't figure out how to make perf show the relevant binary name and function name... Even when adding the debug info server, I wasn't able to see it in hotspot. I would appreciate it if anyone could help me setup my machine to be able to debug this properly.
Comment 13 Bug Janitor Service 2024-05-06 03:45:56 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Bug Janitor Service 2024-05-21 03:45:25 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 15 Zamundaaa 2024-05-22 12:40:57 UTC
Sorry, I don't know how to do it on Neon either; it "just works" on Fedora and Arch
Comment 16 Dashon 2024-06-12 12:30:17 UTC
I believe I am also seeing a similar issue where moving the cursor or really any kind of movement seems to cause spikes in cpu usage for the kwin_wayland process. I especially notice this during video playback during firefox. I have downloaded the appimage for hotspot and I'm not sure if I did everything correctly, but I will try to save and submit the file it produced when I attached to the kwin_wayland process. During the test I mostly triggered the overview, moved the mouse, and scrolled through the desktops. I'll do another test with video playback in firefox and then submit that later.

System Info:
Operating System: EndeavourOS 
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.3-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3080/PCIe/SSE2
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C95
System Version: 1.0
Comment 17 Dashon 2024-06-12 12:33:25 UTC
Created attachment 170413 [details]
hotspot flamegraph screenshot
Comment 18 Dashon 2024-06-12 12:35:43 UTC
Well it looks like the file generated by hotspot is too big, so for now I'll just post screenshots of the flamegraph. If there is another way to send you the perf.data.perfparser files then let me know and if there are any other logs you need. Let me know too.
Comment 19 Dashon 2024-06-12 12:49:57 UTC
Created attachment 170415 [details]
hotspot flamegraph firefox playback
Comment 20 Dashon 2024-06-15 09:27:11 UTC
Created attachment 170512 [details]
Screen Recording of htop as I move the mosue around.

kwin seems to use less cpu when another cpu intensive process is running, but this screen recording should still show the spike that is happening. In general, I notice kwin using more resources cpu and gpu when moving the mouse, windows, or watching videos that say gnome or xfce. This lead me to believe that there may be some kind of performance issue lurking about. On the aforementioned desktops. There respective compositors' do not use enough resources to make it to the top of various resource monitoring utilities such as htop or intel_gpu_top in most cases. For this reason, I am extremely interested in debugging this issue further.
Comment 21 Dashon 2024-06-15 12:37:42 UTC
Created attachment 170524 [details]
Video of htop taken on my phone.

Here is one more video, but taken on my phone. As mentioned before, when other cpu intensive tasks are running. The kwin_wayland process doesn't use as much cpu. In this video, you will see the kwin-wayland process using more cpu than the main firefox process while I am trying to watch a video. That is despite hardware acceleration being in use.
Comment 22 Eduard 2024-06-30 18:49:52 UTC
I can confirm the experience (Arch Linux, having latest KDE 6.1 update of this moment).
I am using the proprietary NVIDIA driver.
Hardware: Lenovo Legion 5-Pro laptop with NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
I am running in dedicated graphics mode (I often run in dynamic graphics mode, so then I use the builtin GPU of my AMD CPU is used primarilly and I haven't tested with that now).

It's _not_ that the graphics are laggy. These are still extremely smooth.

For me it started with that I noticed my laptop getting warmer than expected. Then I also did the same test with HTOP open.
What I am seeing:
Low CPU (< 5%) remains when:
 - Moving mouse on top of the Alacrity terminal.
 - Moving mause on top of the Konsole terminal.
High CPU (somewhere between 20% and 35%) occurs when:
 - Moving mouse on top of Firefox.
 - Moving mouse over the taskbar panel, especially the icons.
Even higher CPU (somewhere between 40% and 55%) can be seen when:
 - Repeatedly opening the Launcher by repeatedly pressing the Super key.

My CPU has 16 threads. The percentages here are a total over all threads.
Comment 23 Eduard 2024-06-30 19:00:16 UTC
Okay, I have now tested in dynamic graphics mode, effectively that means the Plasma uses the AMD CPU's GPU graphics. Now the CPU usage of kwin_wayland remains lower than other processes, when doing the same tests.
Comment 24 Zamundaaa 2024-07-22 20:27:09 UTC
(In reply to Dashon from comment #18)
> Well it looks like the file generated by hotspot is too big, so for now I'll
> just post screenshots of the flamegraph. If there is another way to send you
> the perf.data.perfparser files then let me know and if there are any other
> logs you need. Let me know too.
The perf file is only useful with the exact same binary and debug info for it on my side, the flame graph is easier to work with. It looks as though you're missing debug information for kwin though; could you make sure you have debuginfod installed? Afaik hotspot can use it to download the required information automatically.

(In reply to Eduard from comment #23)
> Okay, I have now tested in dynamic graphics mode, effectively that means the
> Plasma uses the AMD CPU's GPU graphics. Now the CPU usage of kwin_wayland
> remains lower than other processes, when doing the same tests.
That'll be from copying the screen contents from the dedicated to the integrated GPU; that's known to be very inefficient in the NVidia driver right now.
Comment 25 Dashon 2024-07-22 20:46:29 UTC
(In reply to Zamundaaa from comment #24)
> (In reply to Dashon from comment #18)
> > Well it looks like the file generated by hotspot is too big, so for now I'll
> > just post screenshots of the flamegraph. If there is another way to send you
> > the perf.data.perfparser files then let me know and if there are any other
> > logs you need. Let me know too.
> The perf file is only useful with the exact same binary and debug info for
> it on my side, the flame graph is easier to work with. It looks as though
> you're missing debug information for kwin though; could you make sure you
> have debuginfod installed? Afaik hotspot can use it to download the required
> information automatically.
> 
> (In reply to Eduard from comment #23)
> > Okay, I have now tested in dynamic graphics mode, effectively that means the
> > Plasma uses the AMD CPU's GPU graphics. Now the CPU usage of kwin_wayland
> > remains lower than other processes, when doing the same tests.
> That'll be from copying the screen contents from the dedicated to the
> integrated GPU; that's known to be very inefficient in the NVidia driver
> right now.

I'm certain I have debuginfod installed. It just sometimes fails to download certain debuginfo for whatever reason. I will try again though. One thing that I wanted to add if I hadn't mentioned before is that kwin_wayland will use a lot of cpu on some webpages in firefox even if nothing is happening in them while on others. It uses nothing at all.
Comment 26 Dashon 2024-07-22 20:59:18 UTC
One such website that seems to cause kwin_wayland to use a lot more cpu than normal is the endeavourOS forums.
Comment 27 Dashon 2024-07-22 21:04:24 UTC
Created attachment 171909 [details]
Debug Symbols Failed to Load Apparently.
Comment 28 Dashon 2024-07-22 22:05:35 UTC
Created attachment 171914 [details]
Flamegraph with hopefully more debug symbols.
Comment 29 Dashon 2024-07-22 22:08:09 UTC
Zamundaaa from comment #24)
> (In reply to Dashon from comment #18)
> > Well it looks like the file generated by hotspot is too big, so for now I'll
> > just post screenshots of the flamegraph. If there is another way to send you
> > the perf.data.perfparser files then let me know and if there are any other
> > logs you need. Let me know too.
> The perf file is only useful with the exact same binary and debug info for
> it on my side, the flame graph is easier to work with. It looks as though
> you're missing debug information for kwin though; could you make sure you
> have debuginfod installed? Afaik hotspot can use it to download the required
> information automatically.
> 
> (In reply to Eduard from comment #23)
> > Okay, I have now tested in dynamic graphics mode, effectively that means the
> > Plasma uses the AMD CPU's GPU graphics. Now the CPU usage of kwin_wayland
> > remains lower than other processes, when doing the same tests.
> That'll be from copying the screen contents from the dedicated to the
> integrated GPU; that's known to be very inefficient in the NVidia driver
> right now.

I have added one more screen shot of a flamegraph that hopefully includes more debug symbols that previously. I'm unsure if hotspot is actually calling debuginfod. It works with gdb though.
Comment 30 Dashon 2024-08-04 03:58:36 UTC
(In reply to Zamundaaa from comment #24)
> (In reply to Dashon from comment #18)
> > Well it looks like the file generated by hotspot is too big, so for now I'll
> > just post screenshots of the flamegraph. If there is another way to send you
> > the perf.data.perfparser files then let me know and if there are any other
> > logs you need. Let me know too.
> The perf file is only useful with the exact same binary and debug info for
> it on my side, the flame graph is easier to work with. It looks as though
> you're missing debug information for kwin though; could you make sure you
> have debuginfod installed? Afaik hotspot can use it to download the required
> information automatically.
> 
> (In reply to Eduard from comment #23)
> > Okay, I have now tested in dynamic graphics mode, effectively that means the
> > Plasma uses the AMD CPU's GPU graphics. Now the CPU usage of kwin_wayland
> > remains lower than other processes, when doing the same tests.
> That'll be from copying the screen contents from the dedicated to the
> integrated GPU; that's known to be very inefficient in the NVidia driver
> right now.

Would it help to simply upload a copy of my perf.data file, so that you could look at on your machine rather than the bits and pieces captured in screenshots?
Comment 31 Zamundaaa 2024-08-05 19:11:52 UTC
Maybe that would be better, but unfortunately perf data isn't really portable. If you record one on an up to date Neon, I should be able to replicate the same environment and take a look though
Comment 32 Dashon 2024-08-05 19:15:20 UTC
(In reply to Zamundaaa from comment #31)
> Maybe that would be better, but unfortunately perf data isn't really
> portable. If you record one on an up to date Neon, I should be able to
> replicate the same environment and take a look though

Alright, I'll try and reproduce the issue on neon.
Comment 33 Zamundaaa 2024-08-05 19:16:52 UTC
Oh, I just looked at the bug report's platform field. EndeavourOS is fine too, we just need to look at it with the same software versions
Comment 34 Dashon 2024-08-05 19:18:19 UTC
OK, then I'll upload the one I recorded on Endeavour as soon as I make it home.


-------- Original Message --------
On 8/5/24 2:16 PM, Zamundaaa <bugzilla_noreply@kde.org> wrote:

>  https://bugs.kde.org/show_bug.cgi?id=480885
>  
>  --- Comment #33 from Zamundaaa <xaver.hugl@gmail.com> ---
>  Oh, I just looked at the bug report's platform field. EndeavourOS is fine too,
>  we just need to look at it with the same software versions
>  
>  --
>  You are receiving this mail because:
>  You are on the CC list for the bug.
Comment 35 Dashon 2024-08-06 00:20:49 UTC
(In reply to Zamundaaa from comment #33)
> Oh, I just looked at the bug report's platform field. EndeavourOS is fine
> too, we just need to look at it with the same software versions

Sorry, I forgot to do this when I got home. It should be uploaded with this comment.
Comment 37 Zamundaaa 2024-08-06 12:12:28 UTC
Okay, that worked.
About 5% of the CPU usage is in drmModeAddFB2WithModifiers, which is not great, but more importantly 77% is in a drmIoctl in the framebuffer destructor, which will be either https://invent.kde.org/plasma/kwin/-/blob/bbfffec6d6efcb6ab81fc57a08430892b0b50e52/src/backends/drm/drm_buffer.cpp#L69 or https://invent.kde.org/plasma/kwin/-/blob/bbfffec6d6efcb6ab81fc57a08430892b0b50e52/src/backends/drm/drm_buffer.cpp#L70
They get called when apps update the cursor image or their window, which causes KWin to update the cursor or screen with a different buffer, which explains why you see different behavior with different apps.

I don't know what the kernel driver is doing in the drm ioctl - hotspot just shows ??? - but it's supposed to be pretty much free, so this is almost certainly a driver bug. Please report it at https://forums.developer.nvidia.com/c/gpu-graphics/linux/148
Comment 38 Dashon 2024-08-06 16:24:35 UTC
(In reply to Zamundaaa from comment #37)
> Okay, that worked.
> About 5% of the CPU usage is in drmModeAddFB2WithModifiers, which is not
> great, but more importantly 77% is in a drmIoctl in the framebuffer
> destructor, which will be either
> https://invent.kde.org/plasma/kwin/-/blob/
> bbfffec6d6efcb6ab81fc57a08430892b0b50e52/src/backends/drm/drm_buffer.cpp#L69
> or
> https://invent.kde.org/plasma/kwin/-/blob/
> bbfffec6d6efcb6ab81fc57a08430892b0b50e52/src/backends/drm/drm_buffer.cpp#L70
> They get called when apps update the cursor image or their window, which
> causes KWin to update the cursor or screen with a different buffer, which
> explains why you see different behavior with different apps.
> 
> I don't know what the kernel driver is doing in the drm ioctl - hotspot just
> shows ??? - but it's supposed to be pretty much free, so this is almost
> certainly a driver bug. Please report it at
> https://forums.developer.nvidia.com/c/gpu-graphics/linux/148

Thanks for your time. I'll make sure to report it. I somehow knew it would end up back in Nvidia's hands.