2

I am trying to replace value in the file of constraint_0_power_limit with new value using echo "45000000" | sudo tee constraint_0_power_limit_uw

That file is under /sys/class/powercap/intel-rapl/intel-rapl:0/

When I use above command, I get tee: constraint_0_power_limit_uw: No data available error.

How can I fix that error?

Mehmet
  • 107
  • 1
  • 1
  • 7

1 Answers1

4

The ability to adjust TDP (Thermal Design Power) at the OS (Linux) level requires:

  • An processor where TDP is configurable (actually TDP is fixed, but the max power is adjustable)
  • A BIOS that both supports this stuff AND has made it available to the O.S.

Check by looking at the enable flag. Two examples:

doug@s15:~$ cat /sys/class/powercap/intel-rapl/intel-rapl:0/enabled
0

.

doug@s18:~$ cat /sys/class/powercap/intel-rapl/intel-rapl:0/enabled
1

Now, attempt to enable the one that is disabled:

doug@s15:~$ echo 1 | sudo tee /sys/class/powercap/intel-rapl/intel-rapl:0/enabled
1
tee: '/sys/class/powercap/intel-rapl/intel-rapl:0/enabled': Function not implemented

Which does not look good. So let's check dmesg on this computer:

doug@s15:~$ dmesg | grep locked
[   21.945790] intel_rapl_common: RAPL package-0 domain package locked by BIOS
[ 5315.714761] powercap intel-rapl:0: package locked by BIOS, monitoring only

So, observe that it is BIOS that is not allowing it. And in this case, the BIOS does not support this at all, it isn't just disabled. Readers will want to check their BIOS for some sort of enable, but I could not find such a switch in the BIOS of my computer that does work.

So, for the computer where we know this will not work:

doug@s15:~$  echo "94500000" | sudo tee /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw
94500000
tee: '/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw': No data available

Now, for the computer that has enable as 1:

doug@s18:~$ cat /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw
93500000
doug@s18:~$ echo "94500000" | sudo tee /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw
94500000
doug@s18:~$ cat /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw
94500000

Note: While researching for this answer, I did find testimonies where users were able to write a 1 to enable from the 0 state. I think this would indicate that BIOS supports this stuff, but it defaulted to disabled.

Doug Smythies
  • 16,146