Skip to content

pccr10001/ryzen-auto-undervolt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ryzen-auto-undervolt

A simple systemd package that uses ryzenadj to apply different --set-coall values based on power source:

  • AC power: apply AC_UNDERVOLT
  • Battery power: apply BATTERY_UNDERVOLT

Configuration is stored in /etc/default/ryzen-auto-undervolt.

Value Rules

  • Allowed range: -30 to 30
  • Negative values mean undervolt
  • Values are converted to the 20-bit format required by ryzenadj --set-coall=0x...
  • Example: -16 becomes 0xFFFF0

Requirements

  1. ryzenadj is installed
  2. Your device supports --set-coall
  3. ryzenadj -i works correctly

Example:

sudo /usr/bin/ryzenadj -i

Or if you use a custom path:

sudo /home/deck/.local/bin/ryzenadj -i

Configuration

After installation, edit:

sudoedit /etc/default/ryzen-auto-undervolt

Default values:

RYZENADJ_BIN=/usr/bin/ryzenadj
AC_UNDERVOLT=-30
BATTERY_UNDERVOLT=-10
DRY_RUN=0

systemd Behavior

  • ryzen-auto-undervolt.service runs once at boot
  • A udev rule monitors Mains state changes in power_supply
  • Plugging/unplugging power triggers the same service again

View logs:

journalctl -u ryzen-auto-undervolt.service -b

Build a deb Package

Run in project root:

dpkg-buildpackage -us -uc -b

Install the built package:

sudo dpkg -i ../ryzen-auto-undervolt_0.1.0-1_all.deb

If debhelper is not available, use the included script:

./build-deb.sh
sudo dpkg -i ./ryzen-auto-undervolt_0.1.0-1_all.deb

Manual Test

sudo systemctl restart ryzen-auto-undervolt.service
sudo systemctl status ryzen-auto-undervolt.service --no-pager

Stability Notice

--set-coall tuning can affect stability. Increase/decrease gradually (for example -5, then -10) instead of using aggressive values immediately.

About

Enable undervolting automatically when power source is changed.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages