hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
20.89k stars 879 forks source link

Higher CPU and GPU consumption with decoration:drop_shadow=no #3825

Closed aruhier closed 11 months ago

aruhier commented 11 months ago

Hyprland Version

Hyprland, built from branch main at commit 7345b1a1ea2671953df48c8a18524a7e556d383c dirty (shaders: Use clamp in doubleCircleSigmoid. (3824)).

Bug or Regression?

Bug

Description

Hi, I realized that the idle power consumption of my laptop (XPS 9510, i7-11800H, intel gen12 GPU Tigerlake) in Hyprland was quite high, and higher than the one on Sway: 7.5W when idling on Hyprland, 4.5W on Sway. I went with an empty config and did not have the problem (idling at 4.5W, like Sway), and realized it was because I was setting decoration:drop_shadow to "no". Removing that config line or setting it to "yes" fixed the problem.

Read the next section to follow my testing, TL;DR the summary from a 60s powertop report is this one:

drop_shadow=yes:

Usage;Wakeups/s;GPU ops/s;Disk IO/s;GFX Wakeups/s;Category;Description;PW Estimate
75.5 us/s;  1.0;;;;Process;[PID 43466] Hyprland -c /tmp/hyprland.conf ; 2.38 mW

drop_shadow=no:

Usage;Wakeups/s;GPU ops/s;Disk IO/s;GFX Wakeups/s;Category;Description;PW Estimate
1.8 ms/s; 88.0;;;;Process;[PID 43217] Hyprland -c /tmp/hyprland.conf ;  142 mW

drop_shadow=yes, shadow_range=0:

Usage;Wakeups/s;GPU ops/s;Disk IO/s;GFX Wakeups/s;Category;Description;PW Estimate
74.9 us/s;  1.0;;;;Process;[PID 44736] Hyprland -c /tmp/hyprland.conf ; 2.40 mW

It seems that Hyprland is doing a lot more redraw with drop_shadow=no.

Setup:

How to reproduce

Use an minimal Hyprland config, spawn a terminal to run powertop in report mode during 60s. I added the csv reports to this bug.

Hyprland config for 1-default.csv:

monitor=eDP-1,1920x1200@60,0x0,1

exec = alacritty -e sudo powertop -C /tmp/powertop.csv -t 60

Hyprland config for 2-no_drop_shadow.csv:

monitor=eDP-1,1920x1200@60,0x0,1

decoration {
  drop_shadow = no
}

exec = alacritty -e sudo powertop -C /tmp/powertop.csv -t 60

I tested to disable the shadows in another way, by setting shadow_range=0, it did not trigger the bug:

monitor=eDP-1,1920x1200@60,0x0,1
bind = Super, Return, exec, alacritty

decoration {
    shadow_range = 0
}

exec = alacritty -e sudo powertop -C /tmp/powertop.csv -t 60

Crash reports, logs, images, videos

1-default.csv 2-no_drop_shadow.csv 3-shadow_range_0.csv

vaxerski commented 11 months ago

should be fixed with db82fc5b09db7e80a6195cdc11ac4d05ad4d88f0 check

aruhier commented 11 months ago

Indeed, thanks a lot!