Coder Social home page Coder Social logo

High CPU load when Idle about hyprland HOT 22 OPEN

pendula95 avatar pendula95 commented on September 28, 2024 1
High CPU load when Idle

from hyprland.

Comments (22)

vaxerski avatar vaxerski commented on September 28, 2024 1

yeah, that's odd. I am seeing like 3% atm on my laptop, also higher than I'd expect. I'll take a look later today...

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

disable explicit sync?

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024

disable explicit sync?

If you are pointing at setting misc:vfr = true
Yes I have tried this, looking at the htop Hyprland will not go < 8% CPU utilization.
Keeping in mind that this is high end setup that I am running, I dont see this as normal and expect not to use so much CPU.
In total I am not unhappy with performance, everything is smooth but I have an issue with battery life and seeing a process that in idle consumes so much CPU keeps me unrest.

Do I have bad/unrealistic expectations? reading from some other threads, I see people with lower end processors have < 1% CPU utilization from Hyprland.

I think the answer is the the strace logs I have shared but I am not to familiar with Hyprland in order to interpret them correctly.

If there are other logs or tests that I can perform that would give me an insight I would be happy to analyze or share.

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

no vfr should always be enabled

I was talking about explicit sync. Grep the wiki page.

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024

no vfr should always be enabled

I was talking about explicit sync. Grep the wiki page.

I have set env = AQ_MGPU_NO_EXPLICIT,1 in the configuration with no success, Hyprland is present in htop with > 8% always

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

man https://wiki.hyprland.org/Configuring/Variables/#render

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024

man https://wiki.hyprland.org/Configuring/Variables/#render

Sorry, I did a shallow grep of wiki and went for first match.

After setting render:explicit_sync=0 and rebooting I see no difference in CPU % for Hyprland process. I do see a change in strace output but I dont know if this is relevant.
image

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

likely the strace log is irrelevant then. Is this bisectable? Are you sure it does happen on 0.41.2 or 0.39.1 as well?

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024

likely the strace log is irrelevant then. Is this bisectable? Are you sure it does happen on 0.41.2 or 0.39.1 as well?

This is the first version I have installed, so I am not sure about previous releases, as I am also new to arch I am not sure how to downgrade to previous version and if it possible. I was a fedora user before so this downgrade is not familiar, is it possible with pacman and if it is not a problem can you give me a command that I can execute in order to install older version?

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024

I have found the guide and will perform first:
pacman -U https://archive.archlinux.org/packages/h/hyprland/hyprland-0.41.2-3-x86_64.pkg.tar.zst
pacman -U https://archive.archlinux.org/packages/h/hyprland/hyprland-0.39.1-5-x86_64.pkg.tar.zst

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024

Issue persist on version 0.41.2-3
I wasn't able to downgrade to 0.39.1-5-x86_64 as following error blocks the downgrade:

sudo pacman -U https://archive.archlinux.org/packages/h/hyprland/hyprland-0.39.1-5-x86_64.pkg.tar.zst
Place your right index finger on the fingerprint reader
:: Retrieving packages...
 hyprland-0.39.1-5-x86_64                               46.2 MiB  21.7 MiB/s 00:02 [################################################] 100%
loading packages...
warning: downgrading package hyprland (0.41.2-3 => 0.39.1-5)
resolving dependencies...
warning: cannot resolve "libdisplay-info.so=1-64", a dependency of "hyprland"
:: The following package cannot be upgraded due to unresolvable dependencies:
      hyprland
``

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

can't you downgrade libdisplay-info too?

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024
sudo pacman -U https://archive.archlinux.org/packages/h/hyprland/hyprland-0.39.1-5-x86_64.pkg.tar.zst https://archive.archlinux.org/packages/l/libdisplay-info/libdisplay-info-0.1.1-3-x86_64.pkg.tar.zst
Place your right index finger on the fingerprint reader
loading packages...
warning: downgrading package hyprland (0.43.0-1 => 0.39.1-5)
warning: downgrading package libdisplay-info (0.2.0-1 => 0.1.1-3)
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing libdisplay-info (0.1.1-3) breaks dependency 'libdisplay-info.so=2-64' required by aquamarine
:: installing libdisplay-info (0.1.1-3) breaks dependency 'libdisplay-info.so=2-64' required by wlroots0.17

As I downgrade next package more pop up, is there a smarter way to do this?

from hyprland.

Cloudperry avatar Cloudperry commented on September 28, 2024

Hyprland's performance and CPU usage are fine for me on a Ryzen 5700x desktop. Idle CPU usage is around 1-3 %. KDE Plasma has a bit lower CPU usage at idle. Most of the time doesn't even show up on htop, but sometimes spikes to 0.5-1%.

One obvious way to improve Hyprland's performance would be to completely switch from virtual functions to something else, because virtual functions are really bad for performance and Hyprland uses them a lot. Virtual functions can often be replaced by using templates or switch cases, but idk enough about Hyprland's codebase to know if these are suitable replacements.

Another way to improve Hyprland's performance would be to use something like arena allocators instead of using smart pointers everywhere. But this is not such a low hanging fruit like getting rid of virtual functions. Smart pointers have quite a lot of overhead, because they do reference counting. Also using them causes a lot of small allocations and bad memory/cache locality.

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

neither should impact performance noticeably, let's be real. The problem is probably some overhandling of events somewhere in (if I had to take a wild guess) X code

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

another thing worth noting is whether you haven't enabled logging in the config. Logging is quite verbose and thus might use the cpu a bit. It's disabled by default.

from hyprland.

pendula95 avatar pendula95 commented on September 28, 2024

another thing worth noting is whether you haven't enabled logging in the config. Logging is quite verbose and thus might use the cpu a bit. It's disabled by default.

I tried to enable logging after seeing the high CPU in order to see if anything meaningful would be outputted. And it did not give any useful insight in the issue. Just to double check, now the last line of my log is:

[LOG] Using config: /home/lbulic/.config/hypr/hyprland.conf
[INFO] !!!!HEY YOU, YES YOU!!!!: further logs to stdout / logfile are disabled by default. BEFORE SENDING THIS LOG, ENABLE THEM. Use debug:disable_logs = false to do so: https://wiki.hyprland.org/Configuring/Variables/#debug

Even when the logging was turned on I did not see any increase on the already ~=10% CPU load from Hyprland process.

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

of course it is X.

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

gtk apps with the X backend (includes electron) will cause this, it seems. Something is surely wrong with the interaction there

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

ok, I don't get it. It just randomly went away.

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

ok, now I get it. gtk4-git doesn't have this problem. Likely a gtk4 bug that's staged for the next release?

from hyprland.

vaxerski avatar vaxerski commented on September 28, 2024

TL;DR:

to me this bug only manifests if a gtk app is ran under X11, and seems to be fixed when compiling gtk-git from source

app doesn't have to be visible or in focus.

dunno why it doesn't happen on sway.

from hyprland.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.