Go To Blogs

Fan speed control on Asus laptops that run Linux

Tags: Asus, Linux, Fan speed control

Categories: linux

Date: 2021.09.26


If you run any linux distro (in my case, Pop!_os) on Asus (in my case, Tuf-gaming FX505DT) and need to control fan speed, you're in the right place.

Depending on the Kernel release you use, there is a kernel module called asus-nb-wmi in Linux that allows you to control fan speed. I'm only covering the use of the thermal throttling policy to set three possible values for controlling fan speed: Silent mode, Balance mode, and Turbo mode. For manual configuration and advanced usage, check Fan speed control on Asus laptops - ArchWiki.


Check for Thermal Throttling Policy Configuration File

Firstly, check if you have a configuration file for the thermal throttling policy:

$ [ -e /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy ] && echo "exists" || echo "not exists"

If you see "exists" (otherwise, you probably have an older Asus model or kernel), the only thing you need to do is write 0, 1, or 2 to this file for Balance, Turbo, and Silent modes respectively. You can do this with a text editor or directly in the terminal.

Note: The following commands require sudo privileges

$ echo 0 > /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy  # Silent mode
$ echo 1 > /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy  # Turbo mode
$ echo 2 > /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy  # Balance mode

But if you're a lazy person like me, doing this repeatedly is a lot of typing (read For lazy people).

Tuf Series

In most Tuf series, fn+f5 does the work, but you should remember the mode or guess from the fan noise or check it with the cat file command, which is again hard work (read For lazy people).

For Lazy People

I've written a Perl script to do this with a single command.

You can install it with your browser or terminal.

Browser

  1. Open the script in raw mode.
  2. Right-click on the page and click "Save as."

Terminal

Run the following command in any directory you want (e.g. $HOME/scripts/):

$ curl -L https://raw.githubusercontent.com/ferhadme/dotfiles/master/scripts/fan_control.pl > fan_control.pl

You can also use other tools like wget.

Usage

Note: The following commands require sudo privileges

$ ./fan_control.pl balance  # Balance mode
$ ./fan_control.pl turbo    # Turbo mode
$ ./fan_control.pl silent   # Silent mode
$ ./fan_control.pl --help   # Prints help for usage

References