Power Management with AMI (standard) vs Coreboot BIOS on Protectli devices

Started by logi, September 12, 2024, 07:29:05 PM

Previous topic - Next topic
I have two Protectli devices VP2420 and VP4670, initially I was using both of them with the AMI BIOS (standard), and the default power management was not very good, even with PowerD enabled, more details on these discussions, links below:

https://forum.opnsense.org/index.php?topic=28031.0

https://www.reddit.com/r/opnsense/comments/1fdzknu/how_to_enable_low_power_c_states_with_intel_core/

Bottom line, with the AMI BIOS I had to set the C3 state in Tunables with hw.acpi.cpu.cx_lowest or dev.cpu.0.cx_lowest. Before applying those settings the 2420 and 4670 consumed ~12 and ~14 watts respectively. After the C3 tweaks in Tunables, their power consumption got reduced to ~8.7 and ~10.7 watts respectively. Huge improvements with the tweaks.

The other day, I decided to test the Coreboot BIOS on both devices with fresh OPNsense installs, I noticed from the beginning the devices were running cooler, I have NOT configured C3 in Tunables (fresh install), meaning the CPU is always running on the C1 state, the 2420 and 4670 were consuming ~9.3 and 10.7 watts respectively, very close to the measurements with C3 enabled with the AMI BIOS.

If I enable C3 state with the Coreboot BIOS, their will be a small gain with the 2420 of about 0.6 watts and the 4670 will have not change, both use a different CPU:

2420: Intel Celeron J6412
4670: Intel Core i7-10810U

It seems with the openBSD kernel defaults, and the Coreboot BIOS power management is already optimized, vs using the default AMI BIOS on the Protectli devices, any previous experience, thoughts? Thanks for the feedback

Just a quick question:
Would this energy efficiency gain be available only on bare metal installations or also if running OPNsense as a VM through Proxmox?

I am running OPNsense through Proxmox installed on Protectli VP2420.

Quote from: gspannu on September 12, 2024, 09:14:55 PM
Just a quick question:
Would this energy efficiency gain be available only on bare metal installations or also if running OPNsense as a VM through Proxmox?

I am running OPNsense through Proxmox installed on Protectli VP2420.

In theory should be in both, what is happening is that Coreboot is exposing more hardware information to the OS at boot time, and FreeBSD/OPNsense is leveraging that during kernel boot configuration, I have to assume that Proxmox who is using Linux, the king of drivers and hardware compatibility, should be able to leverage it as well.

I am going to rebuild my VP2420 in a few weeks time, I will then start with a Coreboot BIOS...
I don't have any measuring equipment, but I guess using a new-gen BIOS can't hurt either and if the appliance happens to run more efficiently, then all is good.

I also own a VP2420 flashed with Corebios.

After the installation of Opnsense i was a little bit concerned about the CPU temperature because it was running hotter than my previous system (APU4).
I don't have the option to use lots of fans in this environment and therefore sensitive to heat dissipation.
After some time i realized that the powerd-setting has no effect on this system. The CPU is not supported by the daemon. After using the tunables "dev.hwpstate_intel.*.epp" and setting them to "90" the CPU was running cooler and used lower frequencies most of the time.

After setting "dev.cpu.*.cx_lowest" to "C3" i am back at the level of the APU or evevn better.

Correct, I forgot to mention yesterday, I am also using the Tunable dev.hwpstate_intel.x.epp = 90 (x = 0...5), on top of the dev.cpu.y.cx_lowest = C3 (y = 0...11)

Please could you share the link to the site with the information on what CPUs are compatible with the PowerD daemon, thank you

I also use a Protectli VP2420, and after the 24.7 update have had higher CPU temps and utilization. After a little research on things to mitigate the problem, I added the "dev.cpu.0.cx_lowest" tunables.

This reduced my CPU temps by ~4C, and haven't noticed any issues. I was concerned about possible stability or latency issues, but so far it has been a positive improvement.

Quote from: irrenarzt on September 14, 2024, 02:10:05 AM
I also use a Protectli VP2420, and after the 24.7 update have had higher CPU temps and utilization. After a little research on things to mitigate the problem, I added the "dev.cpu.0.cx_lowest" tunables.

This reduced my CPU temps by ~4C, and haven't noticed any issues. I was concerned about possible stability or latency issues, but so far it has been a positive improvement.

Instead of doing one entry for each cpu in Tunables, you can just do hw.acpi.cpu.cx_lowest = C3 one time

Quote from: logi on September 14, 2024, 02:37:50 AM
Quote from: irrenarzt on September 14, 2024, 02:10:05 AM
I also use a Protectli VP2420, and after the 24.7 update have had higher CPU temps and utilization. After a little research on things to mitigate the problem, I added the "dev.cpu.0.cx_lowest" tunables.

This reduced my CPU temps by ~4C, and haven't noticed any issues. I was concerned about possible stability or latency issues, but so far it has been a positive improvement.

Instead of doing one entry for each cpu in Tunables, you can just do hw.acpi.cpu.cx_lowest = C3 one time

I am ruining OPNsesne as a VM on Proxmox on Protectli VP2420.
I do not see this entry hw.acpi.cpu.cx_lowest in OPNsense tunables, do I need to manually create this entry and assign it a value of C3? Could you send a screenshot please?

Since the VP2420 does not pass through the thermal sensor information to VMs, I will just have to rely on 'hand felt' temperature to see if it makes any difference...

You cannot in any way control CPU power states from within a VM. That has to be done on your hypervisor, i.e. Proxmox.

In the case of OPNsense running on hardware: yes, you are supposed to add tunables that are not present in the default setup.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Patrick M. Hausen on September 14, 2024, 10:00:40 PM
You cannot in any way control CPU power states from within a VM. That has to be done on your hypervisor, i.e. Proxmox.

In the case of OPNsense running on hardware: yes, you are supposed to add tunables that are not present in the default setup.

Thanks for the clarification. 👍
Do you have any idea for the settings for Proxmox ? (I believe that the core of Proxmox is effectively Debian).

I do not run Proxmox, sorry. Maybe try the Proxmox community/forum/whatever?

I tried it and was really disappointed.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: logi on September 13, 2024, 02:09:59 PM
Correct, I forgot to mention yesterday, I am also using the Tunable dev.hwpstate_intel.x.epp = 90 (x = 0...5), on top of the dev.cpu.y.cx_lowest = C3 (y = 0...11)

Please could you share the link to the site with the information on what CPUs are compatible with the PowerD daemon, thank you

Sorry. I don't have a link i could provide. I just tried different settings of PowerD and saw no effect on frequencies or temperature. Afterwards i searched the forum and found some discussions about the topic that confirmed my suspicions.

In general, i guess, all CPUs that support Intel Speedshift have to use hwp instead of PowerD. Maybe you can find some information in the official FreeBSD documentation (https://docs.freebsd.org/en/books/handbook/config/#hwpstate_intel).

Quote from: MenschAergereDichNicht on September 15, 2024, 09:24:51 AM
Quote from: logi on September 13, 2024, 02:09:59 PM
Correct, I forgot to mention yesterday, I am also using the Tunable dev.hwpstate_intel.x.epp = 90 (x = 0...5), on top of the dev.cpu.y.cx_lowest = C3 (y = 0...11)

Please could you share the link to the site with the information on what CPUs are compatible with the PowerD daemon, thank you

Sorry. I don't have a link i could provide. I just tried different settings of PowerD and saw no effect on frequencies or temperature. Afterwards i searched the forum and found some discussions about the topic that confirmed my suspicions.

In general, i guess, all CPUs that support Intel Speedshift have to use hwp instead of PowerD. Maybe you can find some information in the official FreeBSD documentation (https://docs.freebsd.org/en/books/handbook/config/#hwpstate_intel).

I found it (related to not use PowerD), is in the Handbook:

https://docs.freebsd.org/en/books/handbook/config/#hwpstate_intel

NOTE: Users accustomed to using powerd or sysutils/powerdxx will find these utilities have been superseded by the hwpstate_intel driver and no longer work as expected.

I have disabled PowerD on my devices, no difference.