Coder Social home page Coder Social logo

jothi-prasath / auto-epp Goto Github PK

View Code? Open in Web Editor NEW
52.0 3.0 3.0 31 KB

auto-epp is a python script that manages the energy performance preferences (EPP) of amd-pstate-epp

License: MIT License

Python 74.50% Shell 25.50%
amd-pstate cpufreq linux python shellscript hacktoberfest

auto-epp's Introduction

auto-epp

auto-epp

auto-epp is a python script that manages the energy performance preferences (EPP) of your AMD CPU using the AMD-Pstate driver. It adjusts the EPP settings based on whether your system is running on AC power or battery power, helping optimize power consumption and performance.

Index

Requirements

  • AMD CPU with the AMD-Pstate-EPP driver enabled.
  • Python 3.x

To enable amd-pstate-epp

This can be done by editing the GRUB_CMDLINE_LINUX_DEFAULT params in /etc/default/grub. Follow these steps:

  1. Open the grub file using the following command:
sudo nano /etc/default/grub
  1. Within the file, modify the GRUB_CMDLINE_LINUX_DEFAULT line to include the setting for AMD P-State EPP:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_pstate=active"

Quick Install

To quickly install auto-epp, just copy and paste this to your terminal (if you have curl installed):

curl https://raw.githubusercontent.com/jothi-prasath/auto-epp/master/quick-install.sh | sudo bash

For Arch Linux

On Arch Linux, and Arch-based distributions, auto-epp can be found in the AUR. Install with an AUR helper like yay:

yay auto-epp

For NixOS

On NixOS (unstable for now) an option can be enabled to install and enable auto-epp.

To enable with the default configuration:

services.auto-epp.enable = true;

Detailed options available on nixos.org

Manual Install

git clone https://github.com/jothi-prasath/auto-epp
cd auto-epp
chmod +x ./install.sh
sudo ./install.sh

Usage

Monitor the service status

systemctl status auto-epp

To restart the service

sudo systemctl restart auto-epp

Edit the config file

sudo nano /etc/auto-epp.conf

uninstall

To uninstall auto-epp

chmod +x ./uninstall.sh
sudo ./uninstall.sh

auto-epp's People

Contributors

alexey336 avatar jothi-prasath avatar lamarios avatar nyanraltotlapun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

auto-epp's Issues

Failed to start auto-epp.service - auto-epp - Automatic amd-pstate epp.

× auto-epp.service - auto-epp - Automatic amd-pstate epp
     Loaded: loaded (/etc/systemd/system/auto-epp.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Fri 2023-09-29 21:49:45 CEST; 5s ago
   Duration: 1ms
    Process: 4456 ExecStart=/usr/bin/auto-epp (code=exited, status=203/EXEC)
   Main PID: 4456 (code=exited, status=203/EXEC)
        CPU: 1ms

Sep 29 21:49:45 fedora systemd[1]: auto-epp.service: Scheduled restart job, restart counter is at 5.
Sep 29 21:49:45 fedora systemd[1]: Stopped auto-epp.service - auto-epp - Automatic amd-pstate epp.
Sep 29 21:49:45 fedora systemd[1]: auto-epp.service: Start request repeated too quickly.
Sep 29 21:49:45 fedora systemd[1]: auto-epp.service: Failed with result 'exit-code'.
Sep 29 21:49:45 fedora systemd[1]: Failed to start auto-epp.service - auto-epp - Automatic amd-pstate epp.

Surface Laptop 15 AMD with surface kernel 6.4 Fedora 38 :(

Not forcing to run as root, instead check write permission on required files

I'm currently submitting this package for nixos ( see PR ) and one comment was raised that it would be better to run the service as DynamicUser and give it the permissions it needs through CapabilityBoundingSet which would make it more secure.

I believe that for this to work, it would need the main script to test write permission on the targeted files instead of checking if the user is root.

Issue when battery is plugged in, not full but not charging

So on my laptop there is a "conservative" which basically limits the charge to 80% and auto-epp reports it as on Battery because of this:

sbattery(percent=79.52387907112605, secsleft=<BatteryTime.POWER_TIME_UNKNOWN: -1>, power_plugged=None)

power_plugged is None, when on battery power_plugged=False and when charging power_plugged=True

I fixed it on my end by updating the condition

    if battery.power_plugged is None or battery.power_plugged:

but i'm not sure if that would apply to all the laptops that have similar modes hence i didn't make PR for now.

No change to amd_pstate_epp

Hi,

I have this working in tandem with auto-cpufreq and, after having enabled the auto_epp service and rebooting, the system doesnt seem to acknowledge my .conf file (eg. I wrote BAT=power, but it remains at BAT=balanced_power) even though it shows the service running.

Does this have to do with changing it to active/passive/guided mode?

forgive my ignorance if this is an obvious answer.

Cheers!

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.