From 77225e3f53f0662099ebad183528fc7e511088ea Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Sun, 19 May 2024 22:26:00 -0700 Subject: [PATCH] Revert "Drop the ryzenadj service, now built in." This reverts commit 7d3ae0fff79c7a3907633ddc89021956ff59879e. --- README.md | 1 + system_files/deck/shared/usr/etc/default/ryzenadj | 8 ++++++++ .../shared/usr/lib/systemd/system/ryzenadj.service | 11 +++++++++++ 3 files changed, 20 insertions(+) create mode 100644 system_files/deck/shared/usr/etc/default/ryzenadj create mode 100644 system_files/deck/shared/usr/lib/systemd/system/ryzenadj.service diff --git a/README.md b/README.md index cbe49d99..3c149fb4 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ Variant designed for usage as an alternative to SteamOS on the Steam Deck, and f - Applies SteamOS's kernel parameters. - Color calibrated display profiles for matte and reflective Steam Deck screens included. - Default-disabled power-user features, including: + - Service for low-risk undervolting of the Steam Deck via [RyzenAdj](https://github.com/FlyGoat/RyzenAdj) and [Ryzen SMU](https://gitlab.com/leogx9r/ryzen_smu), see `ryzenadj.service` and `/etc/default/ryzenadj`. - Service for limiting the max charge level of the battery, see `batterylimit.service` and `/etc/default/batterylimit`. (Works even when the device is off) - Built in support for display overclocking. For example, add `GAMESCOPE_OVERRIDE_REFRESH_RATE=40,70` to `/etc/environment`. - 32GB RAM mod your Steam Deck? Enjoy double the maximum VRAM amount, automatically applied. (Can you share your soldering skills?) diff --git a/system_files/deck/shared/usr/etc/default/ryzenadj b/system_files/deck/shared/usr/etc/default/ryzenadj new file mode 100644 index 00000000..d0988248 --- /dev/null +++ b/system_files/deck/shared/usr/etc/default/ryzenadj @@ -0,0 +1,8 @@ +# https://github.com/NGnius/PowerTools/issues/84#issuecomment-1482736698 +# https://www.amd.com/system/files/documents/faq-curve-optimizer.pdf +# Expect your UV to be 3-5x your set curve value. IE: -5 = -15mv to -25mv +# 0x100000 - 5 (Range: -30, 30) +UNDERVOLT_AMOUNT=0xFFFFB +# WARNING: As with any undervolt exercise caution. +# There is no guarantee you won't damage your hardware. +# USE AT YOUR OWN RISK. diff --git a/system_files/deck/shared/usr/lib/systemd/system/ryzenadj.service b/system_files/deck/shared/usr/lib/systemd/system/ryzenadj.service new file mode 100644 index 00000000..9b953533 --- /dev/null +++ b/system_files/deck/shared/usr/lib/systemd/system/ryzenadj.service @@ -0,0 +1,11 @@ +[Unit] +Description=CPU Curve Undervolt for Steam Deck + +[Service] +Type=oneshot +EnvironmentFile=-/etc/default/%p +ExecStartPre=/usr/bin/sleep 10 +ExecStart=/usr/bin/ryzenadj --set-coall=${UNDERVOLT_AMOUNT} + +[Install] +WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target ac.target battery.target