Hyprland
Hyprland copied to clipboard
Higher cpu load when idle on 0.43.0
Already reported ? *
- [x] I have searched the existing open and closed issues.
Regression?
Yes
System Info and Version
System/Version info
Hyprland, built from branch at commit 9a09eac79b85c846e3a865a9078a3f8ff65a9259 (props: bump version to 0.42.0).
Date: Wed Aug 7 19:17:10 2024
Tag: v0.42.0, commits: 5069
flags: (if any)
System Information:
System name: Linux
Node name: arch
Release: 6.10.8-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 15:16:37 +0000
GPU information:
04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir [Radeon Vega Series / Radeon Vega Mobile Series] [1002:1636] (rev ce) (prog-if 00 [VGA controller])
os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
plugins:
======Config-Start======
Config File: /home/wxn/.config/hypr/hyprland.conf: Read Succeeded
source = ./sourcefile/env.conf
source = ./sourcefile/bind.conf
source = ./sourcefile/windowrule.conf
monitor=,preferred,auto,1
exec-once = wl-paste --watch cliphist store &
exec-once = waybar & mpd & fcitx5
exec-once = swaybg -i $HOME/.config/hypr/wallpaper.png
exec-once = hypridle
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
focus_on_activate=false
}
input {
kb_layout = us
kb_variant =
kb_model =
kb_options =
kb_rules =
repeat_rate = 50
repeat_delay = 300
follow_mouse = 1
touchpad {
natural_scroll = no
}
sensitivity = 0
}
general {
gaps_in = 5
gaps_out = 12
border_size = 3
col.active_border = rgba(ddc7a1ff)
col.inactive_border = rgba(595959aa)
layout = dwindle
}
decoration {
rounding = 10
drop_shadow = false
blur {
enabled = false
}
}
animations {
enabled = true
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
pseudotile = true
force_split = 2
preserve_split = true
}
master {
new_status = master
}
gestures {
workspace_swipe = false
}
device {
name = epic-mouse-v1
sensitivity = -0.5
}
Config File: /home/wxn/.config/hypr/sourcefile/env.conf: Read Succeeded
env = QT_IM_MODULE,fcitx
env = XMODIFIERS,@im=fcitx
env = LANG,zh_CN.UTF-8
env = LANGUAGE,zh_CN:en_US
env = VISUAL,nvim
env = RUNEWIDTH_EASTASIAN,0
env = XCURSOR_SIZE,28
Config File: /home/wxn/.config/hypr/sourcefile/bind.conf: Read Succeeded
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = ALT
$backMod = ALT_SHIFT
$mainTerm = alacritty
$backTerm = kitty
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Y, exec, $mainTerm --title apps_floating
bind = $backMod, Y, exec, $backTerm --title apps_floating
bind = $mainMod, Return, exec, $mainTerm
bind = $backMod, Return, exec, $backTerm
bind = $backMod, A, killactive,
bind = $mainMod, M, exec, menu_mpd
bind = $backMod, M, exec, $mainTerm --title apps_floating -e ncmpcpp
bind = $mainMod, X, exec, $backTerm --title apps_floating -e yazi
bind = $mainMod, I, exec, $mainTerm --title apps_floating -e htop
bind = $mainMod, G, exec, $mainTerm --title apps_floating -e pulsemixer
bind = $mainMod, U, exec, $mainTerm --title math -o alacritty -o "font.normal.family = 'Terminess Nerd Font'" "font.size=30" -e lua
#lock and screenshot
bind = $mainMod, P, exec, menu_screenshot
bind = $backMod, P, exec, swaylock -i ~/.config/hypr/pacman-ghosts.png
#togglefloating
bind = $backMod, Space, exec, hyprctl --batch "dispatch togglefloating; dispatch centerwindow"
bind = $mainMod, D, exec, rofi_drun
bind = $backMod, D, exec, rofi_run
bind = $mainMod, C, exec, rofi_clip
bind = $backMod, Q, exec, powermenu
bind = SUPER, h, resizeactive, -20 0
bind = SUPER, l, resizeactive, 20 0
bind = SUPER, k, resizeactive, 0 -20
bind = SUPER, j, resizeactive, 0 20
#bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod CTRL, Space, togglesplit, # dwindle
bind = $mainMod, F, fullscreen
# to switch between windows in a floating workspace
bind = $mainMod,Space,cyclenext, # change focus to another window
bind = $mainMod,Space,bringactivetotop, # bring it to the top
# Move focus with mainMod + arrow keys
bind = $mainMod, h, movefocus, l
bind = $mainMod, l, movefocus, r
bind = $mainMod, k, movefocus, u
bind = $mainMod, j, movefocus, d
# Switch workspaces with mainMod + [0-6]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
# Move active window to a workspace with backMod + [0-6]
#bind = $backMod, 1, movetoworkspace, 1
#bind = $backMod, 2, movetoworkspace, 2
#bind = $backMod, 3, movetoworkspace, 3
#bind = $backMod, 4, movetoworkspace, 4
#bind = $backMod, 5, movetoworkspace, 5
#bind = $backMod, 6, movetoworkspace, 6
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, n, workspace, +1
bind = $backMod, n, movetoworkspace, +1
bind = $mainMod, b, workspace, -1
bind = $backMod, b, movetoworkspace, -1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bind = $backMod, H, movewindow,l
bind = $backMod, L, movewindow,r
bind = $backMod, J, movewindow,d
bind = $backMod, K, movewindow,u
#SUbmaps
bind = $mainMod, R, submap, resize
# will start a submap called "resize"
submap = resize
binde = , l, moveactive, 20 0
binde = , h, moveactive, -20 0
binde = , k, moveactive, 0 -20
binde = , j, moveactive, 0 20
binde = , right, resizeactive, 20 0
binde = , left, resizeactive, -20 0
binde = , up, resizeactive, 0 -20
binde = , down, resizeactive, 0 20
# use reset to go back to the global submap
bind = $mainMod,escape, submap, reset
# will reset the submap, meaning end the current one and return to the global one
submap = reset
# keybinds further down will be global again...
Config File: /home/wxn/.config/hypr/sourcefile/windowrule.conf: Read Succeeded
# Example windowrule v1
#windowrule = nomaxsize
#xdg-desktop-portal-gtk
windowrule = noborder, xdg-desktop-portal-gtk
windowrule = noborder, Xdg-desktop-portal-gtk
#brave
windowrule = noborder, Brave
windowrule = noborder, brave
#zed
windowrule = noborder, zed
#chromium
windowrule = noborder, chromium
#vscode
windowrule = noborder, code
windowrule = noborder, codium
# mpv
windowrule = size 1280 720,mpv
windowrule = float, mpv
windowrule = noborder, mpv
windowrule = center, mpv
#obs
windowrule = noborder, obs
# virt-manager
windowrule = noborder, virt-manager
# virtualbox
windowrule = noborder, VirtualBox
#imv
windowrule = noborder, imv
# firefox
windowrule = noborder, firefox
# alacritty
#windowrule = center, Alacritty
#thunar
windowrule = noborder, thunar
windowrule = noborder, Thunar
#Pcmanfm
windowrule = noborder, Pcmanfm
#emacs
windowrule = noborder,emacs
#windowrule = center, emacs
#windowrule = size 1280 720 , emacs
#windowrule = float , emacs
#telegram
windowrule = noborder, telegram
#citra
windowrule = noborder, citra-qt
#sublime
windowrule = noborder, sublime
#nwg-lookl
windowrule = noborder, nwg-look
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
#
#
windowrule = float,title:apps_floating
windowrule = size 1280 720, title:apps_floating
windowrule = center, title:apps_floating
windowrule = float,title:math
windowrule = size 1000 300, title:math
windowrule = center, title:math
windowrulev2 = float, title:drawing
windowrulev2 = center,floating:0
======Config-End========
Description
hyprland: 0.42 --> 0.43 cpu: 0.5% --> 7% I have downgraded to hyprland 0.42
How to reproduce
Install hyprland 0.43
Crash reports, logs, images, videos
No response
Downgraded to hyprland 0.42 fixes issue
eeeee that's not a great solution. Can you bisect this?
I experienced this as well, and it seems to be caused by something xwayland-related. My CPU spikes quite high to the point that Wezterm (running under xwayland) and Citrix Workspace (again running under xwayland) both become totally unresponsive, and I need to do a sigterm on them. I can't bisect this now, but maybe I can after work today if yadex or somebody else doesn't get to it first. Also, of note, is that this doesn't happen right away. It starts happening maybe 5-10 minutes after system startup. My system is Arch Linux, and for now I downgraded both aquamarine and Hyprland. The problem ultimately was discovered to be Hyprland 0.43.0 though, and I have downgraded to 0.42.0 for now.
and no one wants to bisect, ok
Okay. I bisected after work today, where I bisected between commit 9a09eac79b85c846e3a865a9078a3f8ff65a925 (v0.42.0) and commit 0f594732b063a90d44df8c5d402d658f27471dfe (v0.43.0).
~/git/github/hyprland-bisect> git bisect good
b672118f9238a48a18efd741cbcda387c5552238 is the first bad commit
commit b672118f9238a48a18efd741cbcda387c5552238
Author: trianta <[email protected]>
Date: Sun Aug 25 09:37:03 2024 -0500
xwayland: deactivate xwayland focus if wayland is focused (#7458)
* xwayland: deactivate xwayland focus if wayland is focused
* xwayland: deactivate last xwayland surface after focusing wayland
src/managers/XWaylandManager.cpp | 5 ++++-
src/xwayland/XWM.cpp | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
In other words, this is the problematic commit:
https://github.com/hyprwm/Hyprland/commit/b672118f9238a48a18efd741cbcda387c5552238
hm, this is odd.
I will try to come up with a simple reproduction case over the weekend that doesn't involve Citrix Workspace, although that is the common software that I used during the bisect process, and it created the problem in a hurry. I realize that the only people that can actually test that software are people that use it for work.
One other thing to note is the problem causes a huge spike in resident memory. I looked back at my screenshot above, and Citrix (wfica) was using 5.3G of RAM. I have had it running all day today on revision aac90d92797825a65b9faab038586a3b88448667, and the resident memory is about 326M. Wezterm is currently at around 156M, and it was almost 615M in the above screenshot.
The next time I reproduce it, I will pay closer attention to the before/after memory values to make sure the observation tracks.
Also noticed high CPU usage (20%) on 0.43 (FBSD).
For me, the CPU consumption was fixed with 73b9756b8d7ee06fc1c9f072f2a41f2dd1aeb2c9. Before closing, you may want to see if others are still experiencing issues though, since my issue may have been quite specific with respect to xwayland.
@yadex ?
I noticed about 30 instances of Hyprland running when I upgraded my NixOS desktop machine. Maybe that's something. Looks like it's running on every core.
I can also see the screen redraws. I guess that's just because everything is struggling to run.
@PhilT not sure if your issue and main is related, but I also had extreme cpu usage and stuff was laggy after recently updating Hyprland
I was using Hyprland Flake + NixOS + Nvidia package = config.boot.kernelPackages.nvidiaPackages.beta; + linux kernelPackages = pkgs.linuxPackages_latest;
however after switching my kernel to kernelPackages = pkgs.linuxPackages_6_10 everything works just fine again now
Maybe Related? https://bbs.archlinux.org/viewtopic.php?id=299450 https://github.com/NixOS/nixpkgs/issues/343774
Thanks @arminius-smh!
I've actually switched to Sway now. I need something a bit more stable. Hyprland would crash sometimes and I don't particularly need the animations (though very nice). In all fairness that could have been down to the nvidia drivers as proprietary support is even worse in Sway. However, I've since tried with Nouveau drivers and after getting lots of crashes I dug into the issue and found a fix (I think) by adding the kernelParam, nouveau.runpm=0 and no more crashes, at least not until I try to suspend but one issue at a time.
I'm also on 6.11.0 so that would make sense and would point to a kernel issue rather than Hyprland or Sway. Those links seem to confirm the issue.
@yadex If you're still on Hyprland 0.42, firstly what kernel version are you on and if 6.11 maybe try Hyprland 0.43 with 6.10?
If I get some time I might try Hyprland 0.43 again with 6.10 myself then we can maybe move to close this issue.
@PhilT no issues on FBSD for a couple of years now (before that, there was a single instance when I had to upgrade Hyprland, but that's it). Don't blame Hyprland—blame penguins and nvidia 🫠
I experienced this issue when I upgraded Hyprland from 0.42->0.43, and the kernel from 6.10->6.11.
Rolling back the kernel to 6.10 resolved the issue for me. I also tested 0.42 on kernel 6.11 and the issue was still present.
I am now using 0.43 on kernel 6.10 with no issues.
I was able to find the main reason for my high CPU usage. I was suspecting it was something with the animation but ditched that idea after disabling my animations via hyprctl keyword animations:enabled 0 and nothing improving.
Now I did a detailed job of checking each line in my configuration file and it turns out to be:
animation = borderangle, 1, 30, liner, loop
It is strange even if the animation is disabled or there is no border at all if this line is present IDLE or minimal CPU usage will always be around 10%.
Removing this line or changing it to animation = borderangle, 1, 30, once and my CPU went from 8-12% to 0.3-1.3%
Later after searching for it i found there are many issues with this, example: https://github.com/prasanthrangan/hyprdots/issues/641
Maybe this loop can be optimized not to draw so much power. Also it would be great to get an explanation what this animation does as I don't see any difference in my looks after changing it. I inherited this settings from https://github.com/mylinuxforwork/dotfiles so I am not sure of its purpose.
Hope this helps someone.
it's not the loop's fault. It requires hyprland to constantly push out new frames at (your monitor's hz) times a second, which doesn't allow the cpu to go to sleep
it's not the loop's fault. It requires hyprland to constantly push out new frames at (your monitor's hz) times a second, which doesn't allow the cpu to go to sleep
Understood, maybe I can make a PR to include this in the Wiki. Maybe in the FAQ section that talks about maximizing the battery life or as a comment directly on the animation section of Wiki? What do you think @vaxerski ?
feel free
Hello there!
This issue has been closed, as we are moving from issues to discussions. More about this can be found here and in #9854.
Firstly, please make sure this issue is still relevant in latest Hyprland. If so, we ask you to open a discussion (please read the discussion guidelines first, in the pinned post)
Thank you for your understanding!