Bug#1056162: linux-cpupower: could use a little amd support
Package: linux-cpupower
Version: 6.5.3-1~bpo12+1
Severity: wishlist
Tags: upstream
Dear Maintainer,
The linux-cpupower pkg doesn't seem able to support CPU frequency control mechanism on modern AMD APU
and CPU series in Linux kernel.
current kernel efforts for amd cpu:
https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html
-- System Information:
Debian Release: 12.2
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.5.0-0.deb12.1-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages linux-cpupower depends on:
ii libc6 2.36-9+deb12u3
ii libcap2 1:2.66-4
ii libcpupower1 6.5.3-1~bpo12+1
ii libpci3 1:3.9.0-4
linux-cpupower recommends no packages.
linux-cpupower suggests no packages.
-- no debconf information
#!/bin/sh
# /usr/local/sbin/amdepp.sh
# uncomment one in each group to enable
ACTIVE_GOV=powersave
#ACTIVE_GOV=performance
#ACTIVE_PREF=performance
ACTIVE_PREF=balance_performance
#ACTIVE_PREF=balance_power
#ACTIVE_PREF=power
#PASSIVE_GOV=powersave
PASSIVE_GOV=ondemand
#PASSIVE_GOV=conservative
#PASSIVE_GOV=performance
TEEPATH=/sys/devices/system/cpu/cpu*/cpufreq
READPATH=/sys/devices/system/cpu/cpufreq/policy0
if [ ! -d /sys/devices/system/cpu/amd_pstate ] ; then
echo not amd_pstate compatible cpu
exit 1
fi
read DRIVER_NAME <$READPATH/scaling_driver || exit 2
case "$1" in
set)
case $DRIVER_NAME in
amd-pstate-epp)
echo $ACTIVE_GOV | /usr/bin/tee $TEEPATH/scaling_governor
echo $ACTIVE_PREF | /usr/bin/tee $TEEPATH/energy_performance_preference
;;
amd-pstate|acpi-cpufreq)
[ -d /sys/module/cpufreq_$PASSIVE_GOV ] || modprobe cpufreq_$PASSIVE_GOV
echo $PASSIVE_GOV | /usr/bin/tee $TEEPATH/scaling_governor
;;
*) echo no compatible scaling driver
esac
;;
*|get)
# default info only
echo driver: $DRIVER_NAME
read DRIVER_MODE </sys/devices/system/cpu/amd_pstate/status || exit 2
echo mode: $DRIVER_MODE
read CURR_GOV <$READPATH/scaling_governor || exit 2
echo current governor: $CURR_GOV
read AV_GOV <$READPATH/scaling_available_governors || exit 2
echo available governors: $AV_GOV
read CURR_EPP <$READPATH/energy_performance_preference || exit 3
echo current epp: $CURR_EPP
read AV_EPP <$READPATH/energy_performance_available_preferences
echo available epp: $AV_EPP
esac
exit 0
# Enable on bootup with /etc/systemd/system/amdepp.service
#[Unit]
#Description=Set AMD CPU Scaling Governor and Energy Performance Preference
#
#[Service]
#Type=oneshot
#ExecStart=-/usr/local/sbin/amdepp.sh set
#
#[Install]
#WantedBy=multi-user.target
Reply to: