Add config for Lenovo Yoga 500-15IBD
Hi,
Looking at the list of PRs I'm not sure if this issue tracker is dead or not, but in case anyone needs it, here is a config for Lenovo Yoga 500-15IBD (80N6).
It is very different from the existing config of similarly named Yoga 510, but it uses the same registers 147 / 148 / 149 (enable / write / read) as many other Lenovo models (Ideapad U160 and 500S-14ISK, Thinkpad L530 and L380 Yoga, V580 or U41-70). The main difference from these is MaxSpeedValue (reacts down to 0x80) and speeds / thresholds (changed + tweaked for my machine as described below).
Notes for users There seems to be an issue with the controller: the PID or whatever regulator inside does a pretty poor job of keeping RPM at the set value. Instead, it can start to oscillate approximately +-5 % RPM around the set value, with period around one or two seconds. This can be quite annoying and is the reason why I looked into manual fan control in the first place.
It only happens at certain values and situations. For example, setting speed to 8 % may result in stable ~13 % RPM when ramping up from 0, but may start to oscillate between 0 and 14 % when ramping down from high RPM. Similarly, setting 36 % RPM results in stable 40 % RPM, but setting 38 % results in oscillation (33 % to 42 %). Lower speeds seem to be more prone to these problems.
I assume the behavior may be slightly different on other machines (e.g. dirty old fan may be harder to spin than a new one, so it may not overshoot the target as easily), so you may need to tweak the speeds +- a few percent to get the best, stable result on your machine.
Note about performance This laptop has bad thermal design. With many loads it will throttle down to ~500 MHz even when the fan is set to constantly run at maximum speed. This configuration can't solve that, but it may improve the performance for some loads, since it can go to 100 % RPM when temperature rises over 90 °C (the default automatic mode only ever goes up to around 80 %).
~~If you want to get better sustained performance from this laptop, you have to limit the frequency to 2.3 GHz by:~~
EDIT: I found a better approach, see the post below.
sudo sh -c "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo"
Unfortunately, tweaking max_perf_pct does not help, as value 76 equals 2.3 GHz, and values ranging from 77 to 100 enable all the turbo P-states at once, right up to the original 3.0 GHz maximum. Keeping the turbo mode enabled is only better for bursts up to 10 seconds. If you decide to disable turbo mode to get better sustained performance, you can also consider increasing EcPollInterval in this config from 300 to a higher value (e.g. 1500) since there is no need to react quickly to big temperature spikes.
Just a quick addition for anyone interested: I found a better solution to the throttling problem. It amazes me that I did not have the slightest idea that this exists, but apparently it is possible to easily set CPU power limits form user-space, it is not buried in the hardware.
All you is need is made available by the intel-rapl module; you can tweak how much power the CPU (and individual cores I believe) can take during short bursts, how much during long, sustained loads, and what time period is considered a "short burst". Here is an example configuration for Yoga 500 (put it into /etc/rc.local or somewhere to make it persistent):
# decrease long-term power limit time window from ~28s to 3s
echo 3000000 > /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_time_window_us
# decrease the maximum sustained power to 11 W to prevent throttling
echo 11000000 > /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw
# limit short-term bursts (under 3s) to a more manageable power (14 W instead of 25 W)
echo 14000000 > /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_1_power_limit_uw
EDIT: Oh, sorry, I almost forgot NBFC is multi-platform; these commands are obviously Linux-only. But I assume some tools that allow you to set power limits on Windows should be available as well.