Difference between revisions of "Fan speed control"

From ArchWiki
Jump to: navigation, search
m (fancontrol: update for /usr/bin merger)
(Add note to i8kutils section)
 
(29 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{Expansion|This is a bare-bones article. Additional details would help new users.}}
 
 
 
[[Category:CPU]]
 
[[Category:CPU]]
[[it:Fan Speed Control]]
+
[[it:Fan speed control]]
[[ru:Fan Speed Control]]
+
[[ja:ファンスピード制御]]
 +
[[ru:Fan speed control]]
 +
{{Related articles start}}
 +
{{Related|Lm_sensors}}
 +
{{Related articles end}}
 +
Fancontrol, part of {{Pkg|lm_sensors}}, can be used to control the speed and sound of CPU/case fans. This article covers configuration/setup of the utility.
 +
 
 +
For some Dell laptops, an alternative is [[#i8kutils|i8kutils]].
  
{{Article summary start}}
+
== Sensor driver ==
{{Article summary text|Fancontrol, part of {{Pkg|lm_sensors}}, can be used to control the speed and sound of CPU/case fans.  This article covers configuration/setup of the utility}}
+
{{Article summary heading|Related}}
+
{{Article summary wiki|Lm_sensors}}
+
{{Article summary end}}
+
  
=== Preface ===
+
Support for newer motherboards may not yet be in the Linux kernel. Check the official [http://www.lm-sensors.org/wiki/Devices lm-sensors devices] table to see if experimental drivers are available for such motherboards.
Support for newer motherboards may not yet be in the Linux kernel. Check the official [http://www.lm-sensors.org/wiki/Devices lm-sensors devices] table to see if experimental drivers are available for such motherboards.  At the time this statement was written for example, support for the ASUS P8Z77 series of motherboards was not mainlined, yet {{AUR|nct677x}} was available in the [[AUR]].
+
  
It is recommended not to use lm_sensors.service to load the needed modules for fancontrol.  Instead, manually place them in {{ic|/etc/modules-load.d/load_these.conf}} since the order in which these modules are loaded dictate the order in which the needed symlinks for hwmon get created. In other words, using the lm_sensors.service causes inconsistencies boot-to-boot which will render the configuration file for fan control worthless for a consistency point of view.
+
It is recommended not to use {{ic|lm_sensors.service}} to load the needed modules for fancontrol.  Instead, manually place them in {{ic|/etc/modules-load.d/load_these.conf}} since the order in which these modules are loaded dictate the order in which the needed symlinks for hwmon get created. In other words, using the {{ic|lm_sensors.service}} causes inconsistencies boot-to-boot which will render the configuration file for fan control worthless for a consistency point of view. To avoid this problem:
  
For more, see this thread: https://bbs.archlinux.org/viewtopic.php?pid=1251766
+
In {{ic|/etc/conf.d/lm_sensors}} you find the modules. If not there, run as root {{ic|sensors-detect}} accepting the defaults. In the {{ic|modules-load.d}} file place one module name per line. Specifying them like this will create a reproducible order. Another alternative is to use absolute device names in the configuration file.[https://bbs.archlinux.org/viewtopic.php?pid=1415552#p1415552]
  
 
=== lm-sensors ===
 
=== lm-sensors ===
Set up [[Lm_sensors|lm_sensors]].
 
  
<pre>$ sensors
+
Set up [[lm_sensors]].
 +
 
 +
{{hc|$ sensors|2=
 
coretemp-isa-0000
 
coretemp-isa-0000
 
Adapter: ISA adapter
 
Adapter: ISA adapter
 
Core 0:      +29.0°C  (high = +76.0°C, crit = +100.0°C)   
 
Core 0:      +29.0°C  (high = +76.0°C, crit = +100.0°C)   
  
coretemp-isa-0001
+
[...]
Adapter: ISA adapter
+
Core 1:      +29.0°C  (high = +76.0°C, crit = +100.0°C) 
+
 
+
coretemp-isa-0002
+
Adapter: ISA adapter
+
Core 2:      +31.0°C  (high = +76.0°C, crit = +100.0°C) 
+
 
+
coretemp-isa-0003
+
Adapter: ISA adapter
+
Core 3:      +29.0°C  (high = +76.0°C, crit = +100.0°C) 
+
  
 
it8718-isa-0290
 
it8718-isa-0290
Line 48: Line 39:
 
temp1:      +37.5°C  (low  = +129.5°C, high = +129.5°C)  sensor = thermistor
 
temp1:      +37.5°C  (low  = +129.5°C, high = +129.5°C)  sensor = thermistor
 
temp2:      +25.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode
 
temp2:      +25.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode
</pre>
+
}}
  
 
If the output does not display an RPM value for the CPU fan, one may need to increase the fan divisor. If fan speed is shown and higher than 0, skip the next step.
 
If the output does not display an RPM value for the CPU fan, one may need to increase the fan divisor. If fan speed is shown and higher than 0, skip the next step.
  
====Increasing fan_div====
+
==== Increasing fan_div ====
 +
 
 
The first line of the sensors output is the chipset used by the motherboard for readings of temperatures and voltages.  
 
The first line of the sensors output is the chipset used by the motherboard for readings of temperatures and voltages.  
  
Edit {{ic|/etc/sensors.d/sensors.conf}} and look up the exact chipset. A few chipset names are similar, so make sure the one to edit is correct. Add the line 'set fanX_div 4' near the start of the chipset config, replacing X with the number of CPU fans in the target system.
+
Create a file in {{ic|/etc/sensors.d/}}:
 +
 
 +
{{hc|/etc/sensors.d/fan-speed-control.conf|chip "''coretemp-isa-''*"
 +
set fan''X''_div 4}}
 +
 
 +
Replacing ''coretemp-isa-'' with name of the chipset and ''X'' with the number of the CPU fan to change.
  
 
Save the file, and run as root:
 
Save the file, and run as root:
 
  # sensors -s
 
  # sensors -s
  
which will reload the sensors.conf's set variables.
+
which will reload the configuration files.
Run sensors again and check if there is an RPM readout. If not, increase the divisor to 8, 16 or 32. YMMV!
+
 
 +
Run {{ic|sensors}} again, and check if there is an RPM readout. If not, increase the divisor to 8, 16, or 32. YMMV!
  
=== pwmconfig ===
+
== Configuration ==
  
 
{{Note|Advanced users may want to skip this section and write {{ic|/etc/fancontrol}} on their own, which also saves them from hearing all of the fans at full speed.}}
 
{{Note|Advanced users may want to skip this section and write {{ic|/etc/fancontrol}} on their own, which also saves them from hearing all of the fans at full speed.}}
Line 69: Line 67:
 
Once sensors is properly configured, run {{Ic|pwmconfig}} to test and configure speed control.  Follow the instructions in {{Ic|pwmconfig}} to set up basic speeds.  The default configuration options should create a new file, {{ic|/etc/fancontrol}}.
 
Once sensors is properly configured, run {{Ic|pwmconfig}} to test and configure speed control.  Follow the instructions in {{Ic|pwmconfig}} to set up basic speeds.  The default configuration options should create a new file, {{ic|/etc/fancontrol}}.
  
==== Tweaking ====
+
=== Tweaking ===
  
 
{{Warning|Some of the steps outlined below describe how to tweak fan speeds. Before doing this be sure to have a low CPU load.}}
 
{{Warning|Some of the steps outlined below describe how to tweak fan speeds. Before doing this be sure to have a low CPU load.}}
Line 86: Line 84:
 
  MINSTOP=hwmon0/device/pwm1=105
 
  MINSTOP=hwmon0/device/pwm1=105
  
* '''INTERVAL''': how often the daemon should poll CPU temps and adjust fan speeds. INTERVAL is in seconds.
+
* {{ic|INTERVAL}}: how often the daemon should poll CPU temps and adjust fan speeds. INTERVAL is in seconds.
  
 
The rest of the configuration file is split into (at least) two values per configuration option. Each configuration option first points to a PWM device which is written to which sets the fan speed.  The second "field" is the actual value to set. This allows monitoring and controlling multiple fans and temperatures.
 
The rest of the configuration file is split into (at least) two values per configuration option. Each configuration option first points to a PWM device which is written to which sets the fan speed.  The second "field" is the actual value to set. This allows monitoring and controlling multiple fans and temperatures.
  
* '''FCTEMPS''': The temperature input device to read for CPU temperature.  The above example corresponds to {{Ic|/sys/class/hwmon/hwmon0/device/temp1_input}}.
+
* {{ic|FCTEMPS}}: The temperature input device to read for CPU temperature.  The above example corresponds to {{ic|/sys/class/hwmon/hwmon0/device/temp1_input}}.
* '''FCFANS''': The current fan speed, which can be read (like the temperature) in {{Ic|/sys/class/hwmon/hwmon0/device/fan1_input}}
+
* {{ic|FCFANS}}: The current fan speed, which can be read (like the temperature) in {{ic|/sys/class/hwmon/hwmon0/device/fan1_input}}
* '''MINTEMP''': The temperature (&deg;C) at which to '''SHUT OFF''' the CPU fan.  Efficient CPUs often will not need a fan while idling. Be sure to set this to a temperature that ''you know is safe''. Setting this to 0 is not recommended and may ruin your hardware!
+
* {{ic|MINTEMP}}: The temperature (&deg;C) at which to '''SHUT OFF''' the CPU fan.  Efficient CPUs often will not need a fan while idling. Be sure to set this to a temperature that ''you know is safe''. Setting this to 0 is not recommended and may ruin your hardware!
* '''MAXTEMP''': The temperature (&deg;C) at which to spin the fan at its ''MAXIMUM'' speed.  This should be probably be set to perhaps 10 or 20 degrees (&deg;C) below your CPU's critical/shutdown temperature. Setting it closer to MINTEMP will result in higher fan speeds overall.
+
* {{ic|MAXTEMP}}: The temperature (&deg;C) at which to spin the fan at its ''MAXIMUM'' speed.  This should be probably be set to perhaps 10 or 20 degrees (&deg;C) below your CPU's critical/shutdown temperature. Setting it closer to MINTEMP will result in higher fan speeds overall.
* '''MINSTOP''': The PWM value at which your fan stops spinning.  Each fan is a little different.  Power tweakers can {{Ic|echo}} different values (between 0 and 255) to {{ic|/sys/class/hwmon/hwmon0/device/pwm1}} and then watch the CPU fan.  When the CPU fan stops, use this value.
+
* {{ic|MINSTOP}}: The PWM value at which your fan stops spinning.  Each fan is a little different.  Power tweakers can {{ic|echo}} different values (between 0 and 255) to {{ic|/sys/class/hwmon/hwmon0/device/pwm1}} and then watch the CPU fan.  When the CPU fan stops, use this value.
* '''MINSTART''': The PWM value at which your fan starts to spin again.  This is often a higher value than MINSTOP as more voltage is required to overcome inertia.
+
* {{ic|MINSTART}}: The PWM value at which your fan starts to spin again.  This is often a higher value than MINSTOP as more voltage is required to overcome inertia.
  
 
There are also two settings fancontrol needs to verify the configuration file is still up to date. The lines start with the setting name and a equality sign, followed by groups of hwmon-class-device=setting, seperated by spaces. You need to specify each setting for each hwmon class device you use anywhere in the config, or fancontrol will not work.
 
There are also two settings fancontrol needs to verify the configuration file is still up to date. The lines start with the setting name and a equality sign, followed by groups of hwmon-class-device=setting, seperated by spaces. You need to specify each setting for each hwmon class device you use anywhere in the config, or fancontrol will not work.
  
* '''DEVPATH''': Sets the physical device. You can determine this by executing the command
+
* {{ic|DEVPATH}}: Sets the physical device. You can determine this by executing the command
  readlink -f /sys/class/hwmon/<hwmon-device>/device | sed -e 's/^\/sys\///'
+
  readlink -f /sys/class/hwmon/''hwmon-device''/device | sed -e 's/^\/sys\///'
* '''DEVNAME''': Sets the name of the device. Try
+
* {{ic|DEVNAME}}: Sets the name of the device. Try:
  cat /sys/class/hwmon/<hwmon-device>/device/name | sed -e 's/[[:space:]=]/_/g'
+
  $ sed -e 's/[[:space:]=]/_/g' /sys/class/hwmon/''hwmon-device''/device/name
  
{{Tip|Use '''MAXPWM''' and '''MINPWM''' options that limit fan speed range. See {{Ic|man fancontrol}} for details.}}
+
{{Tip|Use {{ic|MAXPWM}} and {{ic|MINPWM}} options that limit fan speed range. See fancontrol manual page for details.}}
 +
{{Tip|Not only the {{ic|DEVPATH}} may change on reboot due to different timing of module loading, but also e.g. the temperature sensor paths (hwmon0/device/temp1_input becomes hwmon0/temp1_input). This usually happens on a kernel update. Check the system log to find out which is the troublemaker:
 +
# systemctl status fancontrol.service
 +
and correct your config file accordingly.}}
  
=== fancontrol ===
+
== fancontrol ==
 +
 
 +
Try to run ''fancontrol'':
  
Try to run fancontrol:
 
 
  # /usr/bin/fancontrol
 
  # /usr/bin/fancontrol
  
A properly configured setup will not error out and will take control of system fans. Users should hear system fans slowing shortly after executing this command.
+
A properly configured setup will not error out and will take control of system fans. Users should hear system fans slowing shortly after executing this command.
 +
 
 +
To make ''fancontrol'' start automatically on every boot, [[enable]] {{ic|fancontrol.service}}.
 +
 
 +
{{Note|Upon upgrading/changing the kernel, running fancontrol may result in an error regarding changed device paths. This issue may be fixed by running {{ic|sensors-detect}} and restarting the system. }}
 +
 
 +
== i8kutils ==
 +
 
 +
{{AUR|i8kutils}} provides an alternative method of controlling the fan speed on some Dell Inspiron and Latitude laptops.  It makes use of the {{ic|/proc/i8k}} interface provided by the {{ic|dell_smm_hwmon}} driver (formerly {{ic|i8k}}).  Results will vary depending on the exact model of laptop.
 +
 
 +
=== Dependencies ===
 +
 
 +
{{Pkg|tcl}} must be installed in order to run {{ic|i8kmon}} as a background service (using the {{ic|--daemon}} option).  To run the X11 desktop applet, {{Pkg|tk}} is required as well.
 +
 
 +
=== Configuration ===
 +
 
 +
By default, {{ic|i8kmon}} only monitors the CPU temperature and fan speed passively.  To enable its fan speed control, either run it with the {{ic|--auto}} option or enable the option permanently in {{ic|/etc/i8kutils/i8kmon.conf}}:
 +
 
 +
set config(auto)      1
 +
 
 +
The temperature points at which the fan changes speed can be adjusted in the same configuration file.  Only three fans speeds are supported (high, low, and off).  Look for a section similar to the following:
 +
 
 +
set config(0)  {{0 0}  -1  55  -1  55}
 +
set config(1)  {{1 1}  45  75  45  75}
 +
set config(2)  {{2 2}  65 128  65 128}
 +
 
 +
This example starts the fan at low speed when the CPU temperature reaches 55 °C, switching to high speed at 75 °C.  The fan will switch back to low speed once the temperature drops to 65 °C, and turns off completely at 45 °C.
 +
 
 +
=== Disable BIOS fan speed control ===
 +
 
 +
It may be necessary to turn off control of the fan speed by the BIOS to prevent it from "fighting" with {{ic|i8kmon}}.  On some laptops, this can be done using the {{ic|smm}} utility.  '''This utility is extremely dangerous as it writes directly to an I/O port to invoke the processor's [[Wikipedia:System_Management_Mode|System Management Mode]].  Use it at your own risk.'''
 +
 
 +
{{ic|smm}} must be compiled and installed manually.  On a 64-bit system, {{Pkg|gcc-multilib}} is required.  Locate the file {{ic|smm.c}} in the {{ic|i8kutils}} source and compile it:
 +
 
 +
$ gcc -m32 -o smm smm.c
 +
 
 +
To disable BIOS fan speed control, run (as root):
 +
 
 +
# ./smm 30a3
 +
 
 +
To enable it again:
 +
 
 +
# ./smm 31a3
 +
 
 +
{{Note|This method may disable other power management features of the BIOS as well, such as notifying Linux when the power button is pressed.}}
 +
 
 +
=== Installation as a service ===
 +
 
 +
{{ic|i8kmon}} can be started automatically as a [[systemd]] service using a unit file similar to the following:
 +
 
 +
{{hc|1=/etc/systemd/system/i8kmon.service|2=[Unit]
 +
Description=i8kmon
  
{{Note|For Dell Latitude/Inspiron laptops, {{Pkg|i8kutils}}/{{Pkg|i8kmon}} are available. Note that these two packages do ''not'' work on the Inspiron 1764.}}
+
[Service]
 +
#ExecStartPre=/usr/bin/smm 30a3  # uncomment to disable BIOS fan control
 +
ExecStart=/usr/bin/i8kmon -d
 +
Restart=always
 +
RestartSec=5
  
To make fancontrol start automatically on every boot as a service run:
+
[Install]
# systemctl enable fancontrol
+
WantedBy=multi-user.target}}
# systemctl start fancontrol
+

Latest revision as of 03:52, 9 July 2016

Related articles

Fancontrol, part of lm_sensors, can be used to control the speed and sound of CPU/case fans. This article covers configuration/setup of the utility.

For some Dell laptops, an alternative is i8kutils.

Sensor driver

Support for newer motherboards may not yet be in the Linux kernel. Check the official lm-sensors devices table to see if experimental drivers are available for such motherboards.

It is recommended not to use lm_sensors.service to load the needed modules for fancontrol. Instead, manually place them in /etc/modules-load.d/load_these.conf since the order in which these modules are loaded dictate the order in which the needed symlinks for hwmon get created. In other words, using the lm_sensors.service causes inconsistencies boot-to-boot which will render the configuration file for fan control worthless for a consistency point of view. To avoid this problem:

In /etc/conf.d/lm_sensors you find the modules. If not there, run as root sensors-detect accepting the defaults. In the modules-load.d file place one module name per line. Specifying them like this will create a reproducible order. Another alternative is to use absolute device names in the configuration file.[1]

lm-sensors

Set up lm_sensors.

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +29.0°C  (high = +76.0°C, crit = +100.0°C)  

[...]

it8718-isa-0290
Adapter: ISA adapter
Vcc:         +1.14 V  (min =  +0.00 V, max =  +4.08 V)   
VTT:         +2.08 V  (min =  +0.00 V, max =  +4.08 V)   
+3.3V:       +3.33 V  (min =  +0.00 V, max =  +4.08 V)   
NB Vcore:    +0.03 V  (min =  +0.00 V, max =  +4.08 V)   
VDRAM:       +2.13 V  (min =  +0.00 V, max =  +4.08 V)   
fan1:        690 RPM  (min =   10 RPM)
temp1:       +37.5°C  (low  = +129.5°C, high = +129.5°C)  sensor = thermistor
temp2:       +25.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode

If the output does not display an RPM value for the CPU fan, one may need to increase the fan divisor. If fan speed is shown and higher than 0, skip the next step.

Increasing fan_div

The first line of the sensors output is the chipset used by the motherboard for readings of temperatures and voltages.

Create a file in /etc/sensors.d/:

/etc/sensors.d/fan-speed-control.conf
chip "coretemp-isa-*"
set fanX_div 4

Replacing coretemp-isa- with name of the chipset and X with the number of the CPU fan to change.

Save the file, and run as root:

# sensors -s

which will reload the configuration files.

Run sensors again, and check if there is an RPM readout. If not, increase the divisor to 8, 16, or 32. YMMV!

Configuration

Note: Advanced users may want to skip this section and write /etc/fancontrol on their own, which also saves them from hearing all of the fans at full speed.

Once sensors is properly configured, run pwmconfig to test and configure speed control. Follow the instructions in pwmconfig to set up basic speeds. The default configuration options should create a new file, /etc/fancontrol.

Tweaking

Warning: Some of the steps outlined below describe how to tweak fan speeds. Before doing this be sure to have a low CPU load.
Note: On several systems, the included script may report errors as it trys to calibrate fans to the respective PWM. Users may safely ignore these errors. The problem is that the script does not wait long enough before ramping up or down the PWM.

Users wishing more more control may need to tweak the generated configuration. Here is a sample configuration file:

INTERVAL=10
DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon2=devices/platform/w83627ehf.656
DEVNAME=hwmon0=coretemp hwmon2=w83627dhg
FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp1_input
FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input
MINTEMP=hwmon0/device/pwm1=20
MAXTEMP=hwmon0/device/pwm1=55
MINSTART=hwmon0/device/pwm1=150
MINSTOP=hwmon0/device/pwm1=105
  • INTERVAL: how often the daemon should poll CPU temps and adjust fan speeds. INTERVAL is in seconds.

The rest of the configuration file is split into (at least) two values per configuration option. Each configuration option first points to a PWM device which is written to which sets the fan speed. The second "field" is the actual value to set. This allows monitoring and controlling multiple fans and temperatures.

  • FCTEMPS: The temperature input device to read for CPU temperature. The above example corresponds to /sys/class/hwmon/hwmon0/device/temp1_input.
  • FCFANS: The current fan speed, which can be read (like the temperature) in /sys/class/hwmon/hwmon0/device/fan1_input
  • MINTEMP: The temperature (°C) at which to SHUT OFF the CPU fan. Efficient CPUs often will not need a fan while idling. Be sure to set this to a temperature that you know is safe. Setting this to 0 is not recommended and may ruin your hardware!
  • MAXTEMP: The temperature (°C) at which to spin the fan at its MAXIMUM speed. This should be probably be set to perhaps 10 or 20 degrees (°C) below your CPU's critical/shutdown temperature. Setting it closer to MINTEMP will result in higher fan speeds overall.
  • MINSTOP: The PWM value at which your fan stops spinning. Each fan is a little different. Power tweakers can echo different values (between 0 and 255) to /sys/class/hwmon/hwmon0/device/pwm1 and then watch the CPU fan. When the CPU fan stops, use this value.
  • MINSTART: The PWM value at which your fan starts to spin again. This is often a higher value than MINSTOP as more voltage is required to overcome inertia.

There are also two settings fancontrol needs to verify the configuration file is still up to date. The lines start with the setting name and a equality sign, followed by groups of hwmon-class-device=setting, seperated by spaces. You need to specify each setting for each hwmon class device you use anywhere in the config, or fancontrol will not work.

  • DEVPATH: Sets the physical device. You can determine this by executing the command
readlink -f /sys/class/hwmon/hwmon-device/device | sed -e 's/^\/sys\///'
  • DEVNAME: Sets the name of the device. Try:
$ sed -e 's/[[:space:]=]/_/g' /sys/class/hwmon/hwmon-device/device/name
Tip: Use MAXPWM and MINPWM options that limit fan speed range. See fancontrol manual page for details.
Tip: Not only the DEVPATH may change on reboot due to different timing of module loading, but also e.g. the temperature sensor paths (hwmon0/device/temp1_input becomes hwmon0/temp1_input). This usually happens on a kernel update. Check the system log to find out which is the troublemaker:
# systemctl status fancontrol.service
and correct your config file accordingly.

fancontrol

Try to run fancontrol:

# /usr/bin/fancontrol

A properly configured setup will not error out and will take control of system fans. Users should hear system fans slowing shortly after executing this command.

To make fancontrol start automatically on every boot, enable fancontrol.service.

Note: Upon upgrading/changing the kernel, running fancontrol may result in an error regarding changed device paths. This issue may be fixed by running sensors-detect and restarting the system.

i8kutils

i8kutilsAUR provides an alternative method of controlling the fan speed on some Dell Inspiron and Latitude laptops. It makes use of the /proc/i8k interface provided by the dell_smm_hwmon driver (formerly i8k). Results will vary depending on the exact model of laptop.

Dependencies

tcl must be installed in order to run i8kmon as a background service (using the --daemon option). To run the X11 desktop applet, tk is required as well.

Configuration

By default, i8kmon only monitors the CPU temperature and fan speed passively. To enable its fan speed control, either run it with the --auto option or enable the option permanently in /etc/i8kutils/i8kmon.conf:

set config(auto)       1

The temperature points at which the fan changes speed can be adjusted in the same configuration file. Only three fans speeds are supported (high, low, and off). Look for a section similar to the following:

set config(0)  {{0 0}  -1  55  -1  55}
set config(1)  {{1 1}  45  75  45  75}
set config(2)  {{2 2}  65 128  65 128}

This example starts the fan at low speed when the CPU temperature reaches 55 °C, switching to high speed at 75 °C. The fan will switch back to low speed once the temperature drops to 65 °C, and turns off completely at 45 °C.

Disable BIOS fan speed control

It may be necessary to turn off control of the fan speed by the BIOS to prevent it from "fighting" with i8kmon. On some laptops, this can be done using the smm utility. This utility is extremely dangerous as it writes directly to an I/O port to invoke the processor's System Management Mode. Use it at your own risk.

smm must be compiled and installed manually. On a 64-bit system, gcc-multilib is required. Locate the file smm.c in the i8kutils source and compile it:

$ gcc -m32 -o smm smm.c

To disable BIOS fan speed control, run (as root):

# ./smm 30a3

To enable it again:

# ./smm 31a3
Note: This method may disable other power management features of the BIOS as well, such as notifying Linux when the power button is pressed.

Installation as a service

i8kmon can be started automatically as a systemd service using a unit file similar to the following:

/etc/systemd/system/i8kmon.service
[Unit]
Description=i8kmon

[Service]
#ExecStartPre=/usr/bin/smm 30a3  # uncomment to disable BIOS fan control
ExecStart=/usr/bin/i8kmon -d
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target