Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High cpu usage with fcitx5 when screen is turned off via niri msg #602

Open
BRS5672023 opened this issue Aug 16, 2024 · 6 comments
Open
Labels
bug Something isn't working

Comments

@BRS5672023
Copy link

System Information

  • niri version: niri 0.1.8 (unknown commit)
  • Distro: Arch Linux
  • GPU: Radeon 780M Graphics
  • CPU: AMD Ryzen 7 8845H

I noticed this issue when I locked the screen and wait until the screen is off, then the cpu fan ramped up after a couple of seconds, but if I then wake up the screen, the cpu usage goes down as normal.. I found something goes wrong with fcitx5 using ssh on my phone..

Screenshot_2024-08-16-21-09-59-699_com termux

This issue doesn't happen on hyprland though, and neither when I use the shortcut to turn off the screen Mod+Shift+P { power-off-monitors; }. But if I type niri msg output eDP-1 off within the terminal then the issue appears (and I don't know how to turn on the screen in this case).

One can reproduce this issue with niri msg invoked by swayidle, e.g., the following

timeout 600 'pidof swaylock || swaylock -f'
timeout 630 'niri msg output eDP-1 off' resume 'niri msg output eDP-1 on'
timeout 30 'pidof swaylock && niri msg output eDP-1 off' resume 'niri msg output eDP-1 on'
before-sleep 'pidof swaylock || swaylock -f'
@BRS5672023 BRS5672023 added the bug Something isn't working label Aug 16, 2024
@YaLTeR
Copy link
Owner

YaLTeR commented Aug 16, 2024

Hm, guess something is busylooping. If you can, please build and run niri with debuginfo and then when the issue occurs, record some seconds with:

perf record -F 99 --call-graph dwarf,65528 -p $(pidof niri)

Then make and upload here a flamegraph using something like:

perf script | inferno-collapse-perf | inferno-flamegraph > flamegraph.svg

(this uses commands from inferno)

It should look similar to this: https://github.com/YaLTeR/niri/assets/1794388/9d81ac17-50a6-4994-abd9-6d1b4debcb34

Sidenote, why are you turning off the monitor in swayidle rather than niri msg action power-off-monitors?

@BRS5672023
Copy link
Author

Sidenote, why are you turning off the monitor in swayidle rather than niri msg action power-off-monitors?

Sorry, I just not find the way of turning off screen as I can do with the shortcut.. And I'm using swayidle to invoke niri msg for I don't know how to wake the screen up after I type niri msg output eDP-1 off..

@BRS5672023
Copy link
Author

Hm, guess something is busylooping. If you can, please build and run niri with debuginfo and then when the issue occurs, record some seconds with:

perf record -F 99 --call-graph dwarf,65528 -p $(pidof niri)

Then make and upload here a flamegraph using something like:

perf script | inferno-collapse-perf | inferno-flamegraph > flamegraph.svg

I have no idea about what the graph tells..
flamegraph

@YaLTeR
Copy link
Owner

YaLTeR commented Aug 16, 2024

Hm, this looks really weird honestly.

@mexisme
Copy link

mexisme commented Sep 25, 2024

This seems to be happening to me, as well.

Niri 0.1.9
Distro: NixOS
GPU: AMD Radeon 780M
CPU: AMD Ryzen 9 7940HS

Just tried it, using the Mod+P option to trigger the power-off-monitors action.

One additional weird thing is Niri can't seem to parse the EDID blob, as I get the following in the journal:

Sep 25 16:47:06 xxx niri[2579]: 2024-09-25T04:47:06.844301Z  WARN niri::backend::tty: error getting EDID info for eDP-1: error parsing EDID
Sep 25 16:47:06 xxx niri[2579]: Caused by:
Sep 25 16:47:06 xxx niri[2579]:     Parsing the EDID blob failed

@mexisme
Copy link

mexisme commented Sep 25, 2024

Actually, perhaps I am wrong.

Have just noticed that clipcatd seems like it might be the root cause of Niri having high CPU.

This seems to be happening to me, as well.

Niri 0.1.9 Distro: NixOS GPU: AMD Radeon 780M CPU: AMD Ryzen 9 7940HS

Just tried it, using the Mod+P option to trigger the power-off-monitors action.

One additional weird thing is Niri can't seem to parse the EDID blob, as I get the following in the journal:

Sep 25 16:47:06 xxx niri[2579]: 2024-09-25T04:47:06.844301Z  WARN niri::backend::tty: error getting EDID info for eDP-1: error parsing EDID
Sep 25 16:47:06 xxx niri[2579]: Caused by:
Sep 25 16:47:06 xxx niri[2579]:     Parsing the EDID blob failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants