Git Product home page Git Product logo

pstate_update's Introduction

UPDATE 2024-02-28: power-profiles-daemon v0.20 was released on 2024-02-15. That version added support for multiple drivers, such that both platform_profile and amd_pstate may be controlled simultaneously. That version is already deployed for Fedora 39, and other distros will eventually follow. If you use PPD v0.20++, you should NOT use this pstate_update daemon, as they might easily conflict each other.

pstate_update

power-profiles-daemon is a nice and simple daemon which controls the power states in both Gnome and KDE. It supports several Linux power "drivers", like platform_profile, amd_pstate, intel_pstate, etc. However, it can currently use only one of these drivers, not multiple of them at the same time.

Some computers like ThinkPad T14 G3 AMD, exposes multiple of the available interfaces (eg. both platform_profiles and amd_pstate). power-profiles-daemon will then only control the platform_profile, while amd_pstate remains uncontrolled. It turns out that amd_pstate Energy Performance Preference (EPP) remains at performance in my case, which burns a lot of excess energy when I do not need it. To fix this, I wrote this small daemon which does the following:

  • Use the DBus interface for power-profiles-daemon and listen for ActiveProfile property changes.
  • Translate the PPD power profile to a desired AMD PState EPP.
  • Write the selected AMD PState EPP to the kernel sysfs interface. This is written on all available CPU cores/threads that are exposed.

It also comes with a conveniet systemd unit file to launch the service in the background.

Getting started

There are pre-built binaries available for download in the Releases section. Otherwise, the project is built using cargo. Nothing special there.

cargo build --release

Configure the mapping from Power Profile to EPP and scaling governor in a config.toml file. The file should preferrably be placed in /etc/pstate_update/config.toml, but a local config.toml file is also accepted. This repo contains a sample config.toml with a reasonable configuration for low power consumption.

For convenience, there is also a small deployment script which copies files to various places (deploy.sh). If you use the deployment script, you should only need the following two commands.

./deploy.sh
sudo systemctl start pstate_update.service

Make sure to also enable the systemd service if you want it to start automatically.

sudo systemctl enable pstate_update.service

pstate_update's People

Contributors

endrebjorsvik avatar

Stargazers

yehun avatar  avatar AVA avatar  avatar  avatar  avatar  avatar Tamado Ramot Sitohang avatar Santiago Navatta avatar  avatar Adrian Gygax avatar Marin Kirkov avatar Abdulhafiz KAŞGARLI avatar

Watchers

 avatar

Forkers

theramottamado

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.