AMD pstate driver steps and discussion

My doubt was whether the 2022 information is still valid.
My installation is fresh and totally updated. I have not installed/modified anything.
I expect proxmox to integrate the best drivers by default.

If you tell me that it is not so and that on the 8000 series mobile cpu it is better to switch to amd-pstate from acpi-cpufreq then I will do it.
It is always nice to have better performance but with lower consumption.
 
My doubt was whether the 2022 information is still valid.
My installation is fresh and totally updated. I have not installed/modified anything.
I expect proxmox to integrate the best drivers by default.

If you tell me that it is not so and that on the 8000 series mobile cpu it is better to switch to amd-pstate from acpi-cpufreq then I will do it.
It is always nice to have better performance but with lower consumption.
I can't really answer that for you, but it's been better for me across two different machines, at least for keeping performance and dropping idle wattage. I imagine Proxmox uses acpi-cpufreq because it's supported by the most CPUs. Also, it's done at the kernel level, so they may not even have control over it. I don't really know.

My suggestion would be to try it if you want/need something better. You can always go back if you don't like it, just read the docs so you know what's going on. I seem to recall needing a kernel cmd-line parameter to re-enable acpi-cpufreq. Just removing the blacklist wasn't enough to go back to it. The info was easy to find last time I needed it, but I can't remember where I found that tid-bit.

Most if not all of the info about amd-pstate drivers can be found here:
https://docs.kernel.org/admin-guide/pm/amd-pstate.html
 
Among the various searches I found this link:

https://www.phoronix.com/review/amd-pstate-epp-ryzen-mobile

I added the string to my grub:
Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet initcall_blacklist=acpi_cpufreq_init amd_pstate=active"

Then I had to modify the profile verification and set commands since I no longer use the governor but the drivers:
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences

my system has the following options available
Code:
default performance balance_performance balance_power power

I chose balance_power because it almost reaches the ACPI power state but loses much less performance
Code:
echo "balance_power" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference


Code:
root@pve2:~# grep "cpu MHz" /proc/cpuinfo
CPU MHz: 400,000
CPU MHz: 1771.374
CPU MHz: 400,000
CPU MHz: 4674.754
CPU MHz: 2336.478
CPU MHz: 2344.900
CPU MHz: 3276.278
CPU MHz: 1330.510
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 1597.927
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000

root@pve2:~# cpupower frequency-info
analyzing CPU 0:
 driver: amd-pstate-epp
 CPUs which run at the same hardware frequency: 0
 CPUs which need to have their frequency coordinated by software: 0
 maximum transition latency: Cannot determine or is not supported.
 hardware limits: 400 MHz - 5.10 GHz
 available cpufreq governors: performance powersave
 current policy: frequency should be within 400 MHz and 5.10 GHz.
 The governor "powersave" may decide which speed to use
 within this range.
 current CPU frequency: Unable to call hardware
current CPU frequency: 400 MHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
Boost States: 0
Total States: 3
Pstate-P0: 3800MHz
Pstate-P1: 2200MHz
Pstate-P2: 1600MHz

now I have to find how to make this state fixed at boot
with the ACPI governor I had inserted in grub "cpufreq.default_governor=powersave", I have to find how to do it with the amd pstate
 
Among the various searches I found this link:

https://www.phoronix.com/review/amd-pstate-epp-ryzen-mobile

I added the string to my grub:
Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet initcall_blacklist=acpi_cpufreq_init amd_pstate=active"

Then I had to modify the profile verification and set commands since I no longer use the governor but the drivers:
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences

my system has the following options available
Code:
default performance balance_performance balance_power power

I chose balance_power because it almost reaches the ACPI power state but loses much less performance
Code:
echo "balance_power" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference


Code:
root@pve2:~# grep "cpu MHz" /proc/cpuinfo
CPU MHz: 400,000
CPU MHz: 1771.374
CPU MHz: 400,000
CPU MHz: 4674.754
CPU MHz: 2336.478
CPU MHz: 2344.900
CPU MHz: 3276.278
CPU MHz: 1330.510
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 1597.927
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000

root@pve2:~# cpupower frequency-info
analyzing CPU 0:
 driver: amd-pstate-epp
 CPUs which run at the same hardware frequency: 0
 CPUs which need to have their frequency coordinated by software: 0
 maximum transition latency: Cannot determine or is not supported.
 hardware limits: 400 MHz - 5.10 GHz
 available cpufreq governors: performance powersave
 current policy: frequency should be within 400 MHz and 5.10 GHz.
 The governor "powersave" may decide which speed to use
 within this range.
 current CPU frequency: Unable to call hardware
current CPU frequency: 400 MHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
Boost States: 0
Total States: 3
Pstate-P0: 3800MHz
Pstate-P1: 2200MHz
Pstate-P2: 1600MHz

now I have to find how to make this state fixed at boot
with the ACPI governor I had inserted in grub "cpufreq.default_governor=powersave", I have to find how to do it with the amd pstate
I just have crontabs set up to do it at boot:

Code:
@reboot sleep 5 && echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
@reboot sleep 10 && echo "balance_power" | tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference

EDIT: Another good thing is if you have emails set up from Proxmox, you'll get an email about the crontab completing. I use it as a sort of pseudo alert that I had a power or system failure.
 
Last edited:
Among the various searches I found this link:

https://www.phoronix.com/review/amd-pstate-epp-ryzen-mobile

I added the string to my grub:
Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet initcall_blacklist=acpi_cpufreq_init amd_pstate=active"

Then I had to modify the profile verification and set commands since I no longer use the governor but the drivers:
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences

my system has the following options available
Code:
default performance balance_performance balance_power power

I chose balance_power because it almost reaches the ACPI power state but loses much less performance
Code:
echo "balance_power" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference


Code:
root@pve2:~# grep "cpu MHz" /proc/cpuinfo
CPU MHz: 400,000
CPU MHz: 1771.374
CPU MHz: 400,000
CPU MHz: 4674.754
CPU MHz: 2336.478
CPU MHz: 2344.900
CPU MHz: 3276.278
CPU MHz: 1330.510
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 1597.927
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000
CPU MHz: 400,000

root@pve2:~# cpupower frequency-info
analyzing CPU 0:
 driver: amd-pstate-epp
 CPUs which run at the same hardware frequency: 0
 CPUs which need to have their frequency coordinated by software: 0
 maximum transition latency: Cannot determine or is not supported.
 hardware limits: 400 MHz - 5.10 GHz
 available cpufreq governors: performance powersave
 current policy: frequency should be within 400 MHz and 5.10 GHz.
 The governor "powersave" may decide which speed to use
 within this range.
 current CPU frequency: Unable to call hardware
current CPU frequency: 400 MHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
Boost States: 0
Total States: 3
Pstate-P0: 3800MHz
Pstate-P1: 2200MHz
Pstate-P2: 1600MHz

now I have to find how to make this state fixed at boot
with the ACPI governor I had inserted in grub "cpufreq.default_governor=powersave", I have to find how to do it with the amd pstate
Thank you so much for sharing this!!

I run Proxmox 8.2-1 on an AMD Ryzen 5950X and had with chatGPT made a script to initialize the server. This was my GRUB part
# Modify /etc/default/grub
echo "Modifying /etc/default/grub..."
sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_pstate=active amd_iommu=on iommu=pt pcie_acs_override=downstream,multifunction video=HDMI-A-5:1920x1080@60e"/' /etc/default/grub
echo "Successfully modified /etc/default/grub."

I didnt blocklist the driver still it says
root@x:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
amd-pstate-epp

root@x:~# cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences
performance

So it seems it only does performance?

After reading the link you shared I would love to use amd_pstate_epp powersave power

ChatGPT sais to do GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_pstate=active amd_pstate_epp=powersave power" But I think it might halucinate.

Yet another instance ChatGPT advices me to make changes to the driver and make them persistent after reboot by making a service.

Would anybody be so kind to help me with the right steps to implement "amd_pstate_epp powersave power" on this AMD Ryzen 5950X running Proxmox 8.2-1 kernel 6.8.4-2-pve (yes because of modified nVidiaGRID drivers I can't update the kernel)?

Thank you!
 
If you've recently installed Proxmox just like me and need to adjust kernel parameters (e.g., for CPU power management), you might run into issues when using proxmox-boot-tool. Unlike GRUB, which is commonly used on Linux, Proxmox often defaults to systemd-boot when using UEFI. This guide explains how to configure Proxmox’s boot tool correctly and adjust CPU frequency settings.

---

Step 1: Check Your Bootloader

First, determine whether your system is using proxmox-boot-tool (which means systemd-boot instead of GRUB).

Run:
Bash:
proxmox-boot-tool status

If you see something like:
Bash:
System currently booted with uefi
<UUID> is configured with: uefi (versions: 6.8.12-4-pve)
your system is using systemd-boot, and you should not edit /etc/default/grub. Instead, modify /etc/kernel/cmdline.

---

Step 2: Identify the Correct root= Parameter

Proxmox requires a valid root= parameter in /etc/kernel/cmdline. If this is missing, running proxmox-boot-tool refresh will result in:

Bash:
No root= parameter in /etc/kernel/cmdline found!


To find the correct root partition, use:
Bash:
findmnt /

Example output:
Bash:
TARGET    SOURCE               FSTYPE OPTIONS
/         /dev/mapper/pve-root ext4   rw,relatime,errors=remount-ro
In this case, the root partition is /dev/mapper/pve-root (common with LVM installations). If using ZFS, it might look like:
Bash:
/      rpool/ROOT/pve-1    zfs    rw,relatime
where rpool/ROOT/pve-1 is the ZFS root.

---

Step 3: Update Kernel Parameters

Now, edit /etc/kernel/cmdline:
Bash:
nano /etc/kernel/cmdline

Modify it to include the correct root partition:

- For LVM-based installs (EXT4/BTRFS):
Bash:
root=/dev/mapper/pve-root quiet amd_pstate=passive

- For ZFS-based installs:
Bash:
root=ZFS=rpool/ROOT/pve-1 quiet amd_pstate=passive

Ensure that everything is on a single line with no line breaks!

---

Step 4: Apply Changes

After updating /etc/kernel/cmdline, refresh the boot configuration:
Bash:
proxmox-boot-tool refresh

If no errors appear, reboot your system:
Bash:
reboot

---

Step 5: Verify amd_pstate is Active

After rebooting, check whether amd_pstateis correctly loaded:
Bash:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

If the output is:
Bash:
amd_pstate
then the new driver is active.

To check the minimum allowed CPU frequency:
Bash:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq

If you want to lower it further, try:
Bash:
echo 800000 | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
(800000 represents 800MHz; adjust as needed.)

---

What If My CPU Doesn't Go Below 2.2GHz?

If your CPU still doesn’t go below a certain frequency (e.g., 2.2 GHz), it might be limited by:
1. Your processor's hardware P-state restrictions.
2. BIOS/UEFI settings—some CPUs allow setting a lower minimum frequency via the BIOS.

---

Final Notes

- Do NOT edit /etc/default/grub on systems using proxmox-boot-tool. Use /etc/kernel/cmdline instead.
- Always run proxmox-boot-tool refresh after modifying kernel parameters.
- Check /proc/cmdline after reboot to confirm that the parameters are applied:
Bash:
cat /proc/cmdline
- If using amd_pstate, ensure your kernel supports it (Proxmox 6.8+ is recommended).

This guide should help users properly configure proxmox-boot-tool and adjust CPU power management settings without running into boot issues.
 
Last edited:
If you've recently installed Proxmox just like me and need to adjust kernel parameters (e.g., for CPU power management), you might run into issues when using proxmox-boot-tool. Unlike GRUB, which is commonly used on Linux, Proxmox often defaults to systemd-boot when using UEFI. This guide explains how to configure Proxmox’s boot tool correctly and adjust CPU frequency settings.

---

Step 1: Check Your Bootloader

First, determine whether your system is using proxmox-boot-tool (which means systemd-boot instead of GRUB).

Run:
Bash:
proxmox-boot-tool status

If you see something like:
Bash:
System currently booted with uefi
<UUID> is configured with: uefi (versions: 6.8.12-4-pve)
your system is using systemd-boot, and you should not edit /etc/default/grub. Instead, modify /etc/kernel/cmdline.

---

Step 2: Identify the Correct root= Parameter

Proxmox requires a valid root= parameter in /etc/kernel/cmdline. If this is missing, running proxmox-boot-tool refresh will result in:

Bash:
No root= parameter in /etc/kernel/cmdline found!


To find the correct root partition, use:
Bash:
findmnt /

Example output:
Bash:
TARGET    SOURCE               FSTYPE OPTIONS
/         /dev/mapper/pve-root ext4   rw,relatime,errors=remount-ro
In this case, the root partition is /dev/mapper/pve-root (common with LVM installations). If using ZFS, it might look like:
Bash:
/      rpool/ROOT/pve-1    zfs    rw,relatime
where rpool/ROOT/pve-1 is the ZFS root.

---

Step 3: Update Kernel Parameters

Now, edit /etc/kernel/cmdline:
Bash:
nano /etc/kernel/cmdline

Modify it to include the correct root partition:

- For LVM-based installs (EXT4/BTRFS):
Bash:
root=/dev/mapper/pve-root quiet amd_pstate=passive

- For ZFS-based installs:
Bash:
root=ZFS=rpool/ROOT/pve-1 quiet amd_pstate=passive

Ensure that everything is on a single line with no line breaks!

---

Step 4: Apply Changes

After updating /etc/kernel/cmdline, refresh the boot configuration:
Bash:
proxmox-boot-tool refresh

If no errors appear, reboot your system:
Bash:
reboot

---

Step 5: Verify amd_pstate is Active

After rebooting, check whether amd_pstateis correctly loaded:
Bash:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

If the output is:
Bash:
amd_pstate
then the new driver is active.

To check the minimum allowed CPU frequency:
Bash:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq

If you want to lower it further, try:
Bash:
echo 800000 | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
(800000 represents 800MHz; adjust as needed.)

---

What If My CPU Doesn't Go Below 2.2GHz?

If your CPU still doesn’t go below a certain frequency (e.g., 2.2 GHz), it might be limited by:
1. Your processor's hardware P-state restrictions.
2. BIOS/UEFI settings—some CPUs allow setting a lower minimum frequency via the BIOS.

---

Final Notes

- Do NOT edit /etc/default/grub on systems using proxmox-boot-tool. Use /etc/kernel/cmdline instead.
- Always run proxmox-boot-tool refresh after modifying kernel parameters.
- Check /proc/cmdline after reboot to confirm that the parameters are applied:
Bash:
cat /proc/cmdline
- If using amd_pstate, ensure your kernel supports it (Proxmox 6.8+ is recommended).

This guide should help users properly configure proxmox-boot-tool and adjust CPU power management settings without running into boot issues.
Thank you for your tutorial. Yet my system seems to succesfully use GRUB

root@xxxx:~# proxmox-boot-tool status
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
E: /etc/kernel/proxmox-boot-uuids does not exist.

Could you please help me how to implement "amd_pstate_epp powersave power" on this AMD Ryzen 5950X running Proxmox 8.2-1 kernel 6.8.4-2-pve when defaulted to GRUB?

Thank you!