{"id":47078,"date":"2024-08-22T16:12:05","date_gmt":"2024-08-22T16:12:05","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=47078"},"modified":"2024-09-02T07:29:37","modified_gmt":"2024-09-02T07:29:37","slug":"thinkpad-fan-speed-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2024\/08\/thinkpad-fan-speed-ubuntu-24-04\/","title":{"rendered":"How to Control ThinkPad Fan Speed in Ubuntu 24.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-47079\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-logo-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This is a step by step beginner&#8217;s guide shows how to control the fan speed in Lenovo ThinkPad laptop running Ubuntu 24.04.<\/p>\n<p>The fan speed control solution differs depends on computer manufacturers. For my ThinkPad T480s, fan is usually not spinning when doing the basic web browsing and other light works.<\/p>\n<p>But if you want, it&#8217;s easy to set a fixed fan speed, or adjust the speed automatically according to the core temperature.<\/p>\n<p><!--more--><\/p>\n<h3>Step 1: Enable the Kernel Option for Fan Control<\/h3>\n<p>Linux Kernel includes a <code>thinkpad_acpi<\/code>\u00a0module for supporting ThinkPad laptops. It supports fan control operations, but disabled by default due to safety reasons.<\/p>\n<p><b>1.<\/b> To enable this fan control feature, open terminal (<code>Ctrl+Alt+T<\/code>) and run command to create a config file under <code>\/etc\/modprobe.d\/<\/code> directory:<\/p>\n<pre>sudo nano \/etc\/modprobe.d\/thinkpad_acpi.conf<\/pre>\n<p><i>The command uses <code>nano<\/code> command line text editor that works in most Linux Desktops. You may replace it with <code>gnome-text-editor<\/code> for Ubuntu 24.04 or other Linux with recent GNOME Desktop, <code>mousepad<\/code> for XFCE, or <code>pluma<\/code> for MATE.<\/i><\/p>\n<p><b>2.<\/b> When file opens, simply add the line below:<\/p>\n<pre>options thinkpad_acpi fan_control=1<\/pre>\n<p>Then save it. For nano text editor, press Ctrl+S to save and Ctrl+X to exit.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/enable-fan-control.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47080\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/enable-fan-control-700x499.webp\" alt=\"\" width=\"610\" height=\"435\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/enable-fan-control-700x499.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/enable-fan-control-300x214.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/enable-fan-control.webp 762w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3.<\/b> To apply the change, just run command below to remove the kernel module, then re-load it:<\/p>\n<pre>sudo modprobe -r thinkpad_acpi &amp;&amp; sudo modprobe thinkpad_acpi<\/pre>\n<p><b>4.<\/b> To verify, use command:<\/p>\n<pre>systool -v -m thinkpad_acpi<\/pre>\n<p><i>Run <code>sudo apt install sysfsutils<\/code> to install the tool if command not found.<\/i> In the terminal output, the &#8220;fan_control&#8221; parameter equals to &#8220;Y&#8221; means the feature is enabled.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/verify-fancontrol.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47081\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/verify-fancontrol-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/verify-fancontrol-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/verify-fancontrol-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/verify-fancontrol.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Step 2: Set Fan Speed Manually<\/h3>\n<p>After enabled the Kernel module option, you can manually set fan speed by writing custom level value into <code>\/proc\/acpi\/ibm\/fan<\/code> file. This can be done by either <b>running single command<\/b> in terminal or <b>using a graphical tool<\/b>.<\/p>\n<h4>Option 1: Single Command to Set Fan Speed<\/h4>\n<p>To set fan speed from in a terminal window, use command:<\/p>\n<pre>echo level 0 | sudo tee \/proc\/acpi\/ibm\/fan<\/pre>\n<p>The command will set fan speed to <code>level 0<\/code> (fan off). For choice, you may replace it with <code>level 1<\/code>, <code>level 2<\/code>, &#8230;, <code>level 7<\/code>.<\/p>\n<p>For example, set medium fan speed with <code>level 4<\/code>:<\/p>\n<pre>echo level 4 | sudo tee \/proc\/acpi\/ibm\/fan<\/pre>\n<p>Or, set the maximum regulated speed with <code>level 7<\/code>:<\/p>\n<pre>echo level 7 | sudo tee \/proc\/acpi\/ibm\/fan<\/pre>\n<p>The default is <code>level auto<\/code>, which can be set via command:<\/p>\n<pre>echo level auto | sudo tee \/proc\/acpi\/ibm\/fan<\/pre>\n<p>While there&#8217;s also <code>level disengaged<\/code> for the maximum unregulated speed, that&#8217;s even much faster than the maximum regulated speed.<\/p>\n<p>After changing the fan speed, either run command to monitor your fan speed or just move your ear closer to the air outlet and listen to the fan noise.<\/p>\n<pre>cat \/proc\/acpi\/ibm\/fan<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/manual-controlfan.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47082\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/manual-controlfan-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/manual-controlfan-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/manual-controlfan-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/manual-controlfan.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>Option 2: Use Graphical Tool to set Fan Speed<\/h4>\n<p>If you would like to use a graphical tool to control your fan speed, then here&#8217;s an open-source tool <code>thinkfan-ui<\/code> available for choice.<\/p>\n<p>For Arch and Manjaro Linux, it&#8217;s available as <code>thinkfan-ui<\/code> package in the <a href=\"https:\/\/aur.archlinux.org\/packages\/thinkfan-ui\/\" target=\"_blank\" rel=\"noopener\">AUR repository<\/a>.<\/p>\n<p>While, Debian and Ubuntu based system can download the <code>.deb<\/code> package from its project page:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/github.com\/zocker-160\/thinkfan-ui\/releases\" target=\"_blank\" rel=\"noreferrer noopener\">Download ThinkFan-UI (under Assets)<\/a><\/div>\n<\/div>\n<p>Then double-click the .deb package in file manager to install via either App Center or Software Install.<\/p>\n<p>Once installed, launch it and use either the pop-up dialog or top-right system indicator to monitor and control fan speed:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47083\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-700x278.webp\" alt=\"\" width=\"610\" height=\"242\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-700x278.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-300x119.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui-768x305.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-ui.webp 1216w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Step 3: Auto Fan Speed According to CPU\/GPU Temperature<\/h3>\n<p>If the default <code>auto<\/code> fan control does NOT meet your need, then you may use <a href=\"https:\/\/github.com\/vmatare\/thinkfan\" target=\"_blank\" rel=\"noopener\">thinkfan<\/a> to auto-adjust fan speed according to the CPU\/GPU temperature.<\/p>\n<p>Thinkfan automatically writes speed level into the <code>\/proc\/acpi\/ibm\/fan<\/code> file, according to the core device temperature reported by lm-sensors. By editing the config file, user can control how fast the fan is spinning according to given temperature range.<\/p>\n<p><b>1.<\/b> First, open terminal (Ctrl+Alt+T) and run command to install thinkfan, as well as lm-sensors:<\/p>\n<pre>sudo apt install thinkfan lm-sensors<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/apt-thinkfan.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47084\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/apt-thinkfan-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/apt-thinkfan-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/apt-thinkfan-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/apt-thinkfan.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2.<\/b> Then, run the command below to detect your laptop monitoring chips or sensors:<\/p>\n<pre>sudo sensors-detect<\/pre>\n<p>In terminal output, you may hit Enter to choose default answers for all questions.<\/p>\n<p><b>3.<\/b> Before configuring thinkfan, you need to find out where to read the core temperatures from.<\/p>\n<p>To do so, use command:<\/p>\n<pre>find \/sys\/devices -type f -name \"temp*_input\"|sed 's\/^\/hwmon \/g'<\/pre>\n<p>In the terminal output, you may copy all the outputs, or choose some of them accordingly, then use for next step.<\/p>\n<p>In my case, according to the hardinfo (System Profiler and Benchmark) tool, only the 5 highlight lines (see screenshot below in terminal) are the ones that monitoring my CPU cores temperatures. Since my laptop does not have dedicated GPU, I&#8217;m going to use them in next steps.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/hardinfo-tempo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47085\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/hardinfo-tempo-700x325.webp\" alt=\"\" width=\"610\" height=\"283\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/hardinfo-tempo-700x325.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/hardinfo-tempo-300x139.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/hardinfo-tempo-768x356.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/hardinfo-tempo-1320x612.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/hardinfo-tempo.webp 1468w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>4. Edit <code>\/etc\/thinkfan.conf<\/code><\/b> file, by running command:<\/p>\n<pre>sudo gnome-text-editor \/etc\/thinkfan.conf<\/pre>\n<p>Replace <code>gnome-text-editor<\/code> according to your desktop environment, or use <code>nano<\/code> that works in most desktops.<\/p>\n<p>When file opens, add following lines:<\/p>\n<ul>\n<li>First, add the line below to tell which file to control fan speed:\n<pre>tp_fan \/proc\/acpi\/ibm\/fan<\/pre>\n<\/li>\n<li>Then, add lines below to tell where to read the core temperatures:\n<pre>hwmon \/sys\/devices\/platform\/coretemp.0\/hwmon\/hwmon9\/temp3_input\r\nhwmon \/sys\/devices\/platform\/coretemp.0\/hwmon\/hwmon9\/temp4_input\r\nhwmon \/sys\/devices\/platform\/coretemp.0\/hwmon\/hwmon9\/temp1_input\r\nhwmon \/sys\/devices\/platform\/coretemp.0\/hwmon\/hwmon9\/temp5_input\r\nhwmon \/sys\/devices\/platform\/coretemp.0\/hwmon\/hwmon9\/temp2_input<\/pre>\n<p><b>You need to replace them according to last step!!!<\/b><\/li>\n<li>Finally, configure temperature ranges and which speed level the fan should run in the ranges.\n<pre>(0, 0,  50)\r\n(2, 50, 60)\r\n(4, 60, 70)\r\n(7, 70, 32767)<\/pre>\n<p>In the case, fan off when CPU temperature in range of 0 to 50, low speed for 50 ~ 60, medium speed for 60 ~ 70, and maximum speed when temperature higher than 70. You can add\/skip speed levels (0 ~ 7) and change the temperatures as you prefer.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-config.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47086\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-config-700x519.webp\" alt=\"\" width=\"610\" height=\"452\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-config-700x519.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-config-300x222.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-config-768x569.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-config.webp 905w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>5.<\/b> After saving the file in last step, run the command below to test if it&#8217;s working properly.<\/p>\n<pre>sudo thinkfan -n<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-test.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47087\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-test-700x309.webp\" alt=\"\" width=\"610\" height=\"269\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-test-700x309.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-test-300x133.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-test-768x340.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkfan-test.webp 794w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>6.<\/b> If everything goes well, you may start thinkfan as systemd service to control your fan speed automatically.<\/p>\n<pre>sudo systemctl enable thinkfan thinkfan-sleep thinkfan-wakeup<\/pre>\n<pre>sudo systemctl start thinkfan thinkfan-sleep thinkfan-wakeup<\/pre>\n<h3>Undo:<\/h3>\n<p>If you want to restore the fan control of your ThinkPad to its previous state, first open terminal (Ctrl+Alt+T) and run command to remove the Kernel module config file:<\/p>\n<pre>sudo rm \/etc\/modprobe.d\/thinkpad_acpi.conf<\/pre>\n<p>Then, re-load to disable the fan control option:<\/p>\n<pre>sudo modprobe -r thinkpad_acpi &amp;&amp; sudo modprobe thinkpad_acpi<\/pre>\n<p>Next, remove <code>thinkfan<\/code> and <code>thinkfan-ui<\/code> if installed, via command:<\/p>\n<pre>sudo apt remove thinkfan thinkfan-ui<\/pre>","protected":false},"excerpt":{"rendered":"<p>This is a step by step beginner&#8217;s guide shows how to control the fan speed in Lenovo ThinkPad laptop running Ubuntu 24.04. The fan speed control solution differs depends on computer manufacturers. For my ThinkPad T480s, fan is usually not spinning when doing the basic web browsing and other light works. But if you want, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":47079,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[2200,1391],"class_list":["post-47078","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-fan-speed","tag-thinkpad"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/47078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=47078"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/47078\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/47079"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=47078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=47078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=47078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}