nan0s7 / nfancurve

A small and lightweight POSIX script for using a custom fan curve in Linux for those with an Nvidia GPU.
GNU General Public License v3.0
314 stars 57 forks source link

Hysteresis #39

Closed SeanDS closed 2 years ago

SeanDS commented 3 years ago

I've been using your script for a week and it is working quite nicely - thanks a lot! I have a question about adding some hysteresis though: I set up my curve to keep the fans off until 50°, and above that start at 20%. I've found that sometimes the fans often come on briefly - for a few seconds - then stop - then come on again for a few seconds then stop - and this repeats for a few minutes. Ideally I'd reduce the fan to e.g. 10% at some intermediate temperature but this isn't enough to operate the fans on my card (they go into an annoying mode of switching on and off rapidly - something about the PWM control I guess). So, I'd like to add some hysteresis so that the fans, when they come on, stay on until the temperature is well below the threshold temperature that triggered them - so if rising to 50° switched the fans on, they will stay on until the temperature is e.g. 45°. Is this possible to do with the current script?

nan0s7 commented 3 years ago

There is minimal support right now; on line 132 there's this bit: if [ "$cur_t" -le "$((arr_t-2))" ]; then that -2 part is technically hysteresis, so change that to whatever value you like. In future there'll be a proper way to change this, I just haven't had the time to work on the script.