Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

GPU spikes after enable/disable `mouse_move_enables_dpms`

Open patch-jh opened this issue 1 year ago • 13 comments

Hyprland Version

System/Version info
Hyprland, built from branch HEAD at commit 84ab8d11e8951a6551d1e1bf87796a8589da6d47  (props: bump ver to 0.35.0).
Date: Mon Feb 5 01:59:02 2024
Tag: v0.35.0

flags: (if any)

Bug or Regression?

Bug

Description

Hi,

I was thiking that I had some error in my config, because I have really high iGPU use. But seems that it is related with the mouse_move_enables_dpms.

See this: https://www.reddit.com/r/hyprland/comments/1anfyrf/config_to_minimal_gpu_use_to_save_battery_life/

The user kakaduuu6996 was trying to help me, but after enable/disable the mouse_move_enables_dpms he also had this spikes.

Maybe this can be related with: https://github.com/hyprwm/Hyprland/issues/2669, and this https://github.com/hyprwm/Hyprland/issues/3747

I have an CPU: Intel i5-10210U (8) @ 4.200GHz but kakaduuu6996 uses a Ryzen 7 5700u.

How to reproduce

Enable the option

misc { 
    mouse_move_enables_dpms = true
}

And try to disable it....

Crash reports, logs, images, videos

No response

patch-jh avatar Feb 10 '24 22:02 patch-jh

Got exactly the same problem! enabled mouse_move_enables_dpms

problem isn't fixed even after turning it off and changin back to older backup dotfiles.

With vrr on I idle at 0 gpu usage, and very low cpu usage, but when mouse is moved 15-30% gpu usage instantly.

When vrr is off 26% gpu usage at idle. before this setting change there was no issue at all!

Danvenrit avatar Feb 10 '24 23:02 Danvenrit

what's the issue? enabling it causes gpu spikes or disabling it?

vaxerski avatar Feb 10 '24 23:02 vaxerski

After enabling it. The issue occurs, and doesn't get fixed after turning it off. I'm not quite sure why.

Danvenrit avatar Feb 10 '24 23:02 Danvenrit

There is another files besides ~/.config/hypr/hyprland.conf to completely reset hyprland?

Because I tried to clean install without set mouse_move_enables_dpms and I yet have the spikes.

patch-jh avatar Feb 10 '24 23:02 patch-jh

honestly I think this is unrelated to hyprland?

After enabling it. The issue occurs, and doesn't get fixed after turning it off. I'm not quite sure why.

What fixes it then?

There is another files besides ~/.config/hypr/hyprland.conf to completely reset hyprland?

Nope

vaxerski avatar Feb 10 '24 23:02 vaxerski

This is my config, you see something that can causes these spikes?

monitor=, 1920x1080@60, 0x0, 1

# External Config
source = ~/.config/hypr/mocha.conf
source = ~/.config/hypr/keybinds.conf
source = ~/.config/hypr/startup.conf
source = ~/.config/hypr/windowrule.conf

#env = WLR_DRM_DEVICES,/dev/dri/card1
#env = QT_QPA_PLATFORMTHEME,qt6ct 


# Keyboard Layout
input {
    kb_layout = br
    numlock_by_default = true
    follow_mouse = 1 
    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}


general {
    gaps_in = 4
    gaps_out = 4
    border_size = 3
    col.active_border = rgba(FF0000FF)
    col.inactive_border = rgba(FFFFFFFF)
    no_border_on_floating = false
    no_cursor_warps = true
    layout = dwindle
}

decoration {
    rounding = 3
    drop_shadow = false
    shadow_range = 4
    shadow_render_power = 3
    blur {
        enabled = false
    }
}

animations {
    enabled = no
    # animation = workspaces, 1, 3, default
}


dwindle { 
    pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = yes # you probably want this
}

master { #Default from the OG Hyprland Conf
    new_is_master = true
}


debug {
    # overlay = yes 
}

misc { 
    mouse_move_enables_dpms = true
    vfr = true
    vrr = 1
    # animate_manual_resizes = true
    # mouse_move_focuses_monitor = true
    disable_splash_rendering = true
    disable_hyprland_logo = true
    enable_swallow = false
    swallow_regex = ^(wezterm)$  
    focus_on_activate = true
    no_direct_scanout = true
    # animate_mouse_windowdragging = true
}


patch-jh avatar Feb 10 '24 23:02 patch-jh

well, I'm not sure, but when I change to gnome desktop wayland version I do not have the issue at all.

Danvenrit avatar Feb 10 '24 23:02 Danvenrit

well, I'm not sure, but when I change to gnome desktop wayland version I do not have the issue at all.

Me either!

patch-jh avatar Feb 10 '24 23:02 patch-jh

sounds like a general issue then unrelated to the config option, though

Have you tried -git?

vaxerski avatar Feb 11 '24 00:02 vaxerski

I am not sure what you mean by:

Have you tried -git?

I suppose that is to git clone and compile/install Hyprland from the version in git. If yes, I compiled it. Yet, I have the same issues.

My iGPU, with mouse moviments has 20% to 40% of use by Hyprland.

1707621685_grim

This use is when I do circle with mouse.

patch-jh avatar Feb 11 '24 03:02 patch-jh

well it must be, since gpu usage is under hyprland. image Also this kind of gpu usage is present only when mouse is moved when vfr is turned on, but when vfr is turned off it's idling at that gpu usage.

Danvenrit avatar Feb 11 '24 15:02 Danvenrit

smaller update: I tried downgrading using Downgrade to different versions of hyprland, and I found that at version 0.29 the gpu issue is not present. Anything above this version has this issue on my system. This is with different dotfiles as well, so I think it isn' necessarily a config problem, and maybe mouse_move_enables_dpms did some change not connected to hyprland, that's introducing unreasonable gpu and cpu usage on later versions. (again with vfr turned on its only when mouse is moved, with it off it's all the time, even at idle.) Also any luck reproducing the bug? I believe the issues started to happen right after mouse_enables_dpms was set to true.

Danvenrit avatar Feb 11 '24 18:02 Danvenrit

git bisect then please :)

vaxerski avatar Feb 13 '24 18:02 vaxerski

this also happens when I hold down a button for example the letter "d" in my browsers searchfield (firefox), but it doesn't increase the GPU usage to extreme amount when doing the same in a terminal

NNxCLUTCHERxCPP avatar Feb 17 '24 08:02 NNxCLUTCHERxCPP

@vaxerski

❯ git bisect good
2ebfd0c7456eff7e9c03d379d1dfbc611dc26672 is the first bad commit
commit 2ebfd0c7456eff7e9c03d379d1dfbc611dc26672
Author: Vaxry <[email protected]>
Date:   Fri Nov 24 10:54:21 2023 +0000

    renderer: Move to a full Hyprland GL rendering pipeline (#3920)

    Also updates wlroots

 .github/workflows/ci.yaml        |   2 +-
 CMakeLists.txt                   |   2 +-
 flake.lock                       |   8 +-
 flake.nix                        |   2 +-
 src/Compositor.cpp               |   5 +-
 src/Compositor.hpp               |   4 +-
 src/debug/TracyDefines.hpp       |   9 ---
 src/events/Events.hpp            |   6 +-
 src/events/Misc.cpp              |  14 ----
 src/events/Windows.cpp           |   2 +-
 src/helpers/Monitor.cpp          |   9 +++
 src/helpers/Monitor.hpp          |  54 ++++++-------
 src/helpers/Region.cpp           |   9 +++
 src/helpers/Region.hpp           |   2 +
 src/includes.hpp                 |   4 +-
 src/managers/XWaylandManager.cpp |  10 ++-
 src/protocols/Screencopy.cpp     |  24 +++---
 src/protocols/ToplevelExport.cpp |  62 ++++-----------
 src/render/Framebuffer.cpp       |  15 ++++
 src/render/Framebuffer.hpp       |   1 +
 src/render/OpenGL.cpp            | 109 +++++++++++++++-----------
 src/render/OpenGL.hpp            |  22 ++++--
 src/render/Renderbuffer.cpp      |  81 +++++++++++++++++++
 src/render/Renderbuffer.hpp      |  25 ++++++
 src/render/Renderer.cpp          | 163 ++++++++++++++++++++++++++++++---------
 src/render/Renderer.hpp          |  47 +++++++----
 subprojects/wlroots              |   2 +-
 subprojects/wlroots.wrap         |   2 +-
 28 files changed, 459 insertions(+), 236 deletions(-)
 create mode 100644 src/render/Renderbuffer.cpp
 create mode 100644 src/render/Renderbuffer.hpp

NNxCLUTCHERxCPP avatar Feb 17 '24 11:02 NNxCLUTCHERxCPP

so... in short, high gpu usage when moving your mouse? That's it?

I assume WLR_NO_HARDWARE_CURSORS is not set?

vaxerski avatar Feb 17 '24 16:02 vaxerski

for me it's not. but setting it makes no difference in my case.

Danvenrit avatar Feb 17 '24 16:02 Danvenrit

can you try on latest git?

vaxerski avatar Feb 17 '24 16:02 vaxerski

For me it didn't do much (I'm assuming hyprland-git on AUR is the latest build). But again it does it when I move my mouse, but this is when vrr is turned on, but when vrr is off the same gpu usage we are talking about is constant, even at idle, I do have all the animations and such turned off fully.

Danvenrit avatar Feb 17 '24 17:02 Danvenrit

I have the same behavior as @Danvenrit

With VFR (not VRR) set to true, while not moving my mouse the GPU usage of the Hyprland process is 1%, while moving my mouse the GPU usage of Hyprland goes to 21%.

With VFR set to false, the GPU usage of Hyprland is always 21%, regardless if I move my mouse or not.

Changing VRR does not make any difference on my system.

This is on Arch with hyprland-git 289d952a6ee02f6d54a0899870bbec52ff9a53df on a Zephyrus G15 GA502IV (Ryzen 9 4900HS / Vega 8)

SnipeXandrej avatar Feb 17 '24 22:02 SnipeXandrej

Just installed hyprland-git for the first time and edited the config a little, turned off drop_shadow, animations and set my monitors to how I have them in sway.

monitor=desc:Samsung Electric Company Odyssey G7 H1AK500000,modeline 1498.25 3840 4192 4616 5392 2160 2163 2168 2316 -hsync +vsync,1920x1080,1,vrr,1,bitdepth,10
monitor=desc:Ancor Communications Inc VG248 DCLMQS078349,1920x1080@60,0x1280,1
monitor=desc:Dell Inc. DELL P2418D MY3ND7B70VLT,1920x1080@60,2810x0,1
  • GPU: MD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 16.0.6, DRM 3.57, 6.7.5-arch1-1)
  • GPU Driver: 4.6 Mesa 24.0.1-arch1.1

With the mouse not moving my GPU uses ~9W of power. Moving the mouse on the 3840x2160 monitor causes the GPU to 40W and the 1920x1080 monitors to 20W.

On sway the GPU power only goes up to 12W on the 3840x2160 monitor and stays at ~9W on the 1920x1080 monitors.

EDIT: If this is a different issue please let me know, just didn't want to make a duplicate as this issue seemed related.

Kagukara avatar Feb 17 '24 23:02 Kagukara

I am on commit 7e8bcd67 and issue persist

NNxCLUTCHERxCPP avatar Feb 18 '24 10:02 NNxCLUTCHERxCPP

I have the same behavior as @Danvenrit

With VFR (not VRR) set to true, while not moving my mouse the GPU usage of the Hyprland process is 1%, while moving my mouse the GPU usage of Hyprland goes to 21%.

With VFR set to false, the GPU usage of Hyprland is always 21%, regardless if I move my mouse or not.

Changing VRR does not make any difference on my system.

This is on Arch with hyprland-git 289d952 on a Zephyrus G15 GA502IV (Ryzen 9 4900HS / Vega 8)

Yes it's vfr for me too, my mistake.

Danvenrit avatar Feb 18 '24 10:02 Danvenrit

With VFR set to false, the GPU usage of Hyprland is 51% in my case. My Monitor runs @ 360Hz

NNxCLUTCHERxCPP avatar Feb 18 '24 10:02 NNxCLUTCHERxCPP

Screenshot_18-Feb_11-19-59_4843 Can also confirm, it seems moving my cursor around firefox increases CPU usage as well and my GPU usage is constantly at 50-70%. Changing VFR does not do anything, neither does changing resolution or turning off shadows/blur and animations. Using the latest hyprland-git.

tharrmeehan avatar Feb 18 '24 10:02 tharrmeehan

Screenshot_18-Feb_11-19-59_4843 Can also confirm, it seems moving my cursor around firefox increases CPU usage as well and my GPU usage is constantly at 50-70%. Changing VFR does not do anything, neither does changing resolution or turning off shadows/blur and animations. Using the latest hyprland-git.

is vrr set to 1? because if set to 1 it will always be enabled, and not just for fullscreen apps.

Danvenrit avatar Feb 18 '24 10:02 Danvenrit

Screenshot_18-Feb_11-19-59_4843 Can also confirm, it seems moving my cursor around firefox increases CPU usage as well and my GPU usage is constantly at 50-70%. Changing VFR does not do anything, neither does changing resolution or turning off shadows/blur and animations. Using the latest hyprland-git.

is vrr set to 1? because if set to 1 it will always be enabled, and not just for fullscreen apps.

Yessir, enabling it does not change anything. I'm not sure if this makes a difference though, since I'm on a 60hz display anyways. By the way, this is on an Intel iGPU, if that matters, not on Nvidia.

tharrmeehan avatar Feb 18 '24 10:02 tharrmeehan

@vaxerski on sway I have 0% GPU usage when moving my mouse

NNxCLUTCHERxCPP avatar Feb 18 '24 15:02 NNxCLUTCHERxCPP

found the issue, working on a fix.

vaxerski avatar Feb 18 '24 15:02 vaxerski

I can confirm the fix!

Thank you very much!

patch-jh avatar Feb 18 '24 17:02 patch-jh