{"id":838,"date":"2023-12-13T00:08:08","date_gmt":"2023-12-13T03:08:08","guid":{"rendered":"https:\/\/freeshell.de\/~felipe\/blog\/?p=838"},"modified":"2024-06-09T15:43:58","modified_gmt":"2024-06-09T18:43:58","slug":"tips-to-reduce-laptop-temperature","status":"publish","type":"post","link":"https:\/\/freeshell.de\/~felipe\/blog\/12\/2023\/linux\/tips-to-reduce-laptop-temperature\/","title":{"rendered":"Tips to Reduce Laptop Temperature"},"content":{"rendered":"\n<p>The solution is to limit the speed. When we use our laptops disconnected from the power source, the system &#8220;changes personality.&#8221; Now, the focus is not on providing maximum performance but on obtaining the maximum autonomy from our battery.<\/p>\n\n\n\n<p>To achieve decent autonomy, the CPU speed is limited to the minimum possible, reducing CPU consumption, which, in turn, lowers its temperature and consequently reduces the time the fans need to be active, preserving our precious battery.<\/p>\n\n\n\n<p>If you want to get the most out of your laptop&#8217;s battery on GNU\/Linux, you can take a look at Slimbook Battery, a program designed by SLIMBOOK to improve the autonomy of their own laptops. It may also work on laptops from other brands, provided they are based on Intel processors.<\/p>\n\n\n\n<p><strong>cpupower<\/strong> allows us to manage our CPU more easily and even automate the parameters we want to use when our system starts.<\/p>\n\n\n\n<p>Installation<\/p>\n\n\n\n<p>For Arch Linux and its derivatives:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><br \/>sudo pacman -S cpupower<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Manual Usage<\/p>\n\n\n\n<p>First, we need to use this command to find out which speeds our CPU accepts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><br \/>sudo cpupower frequency-info<\/code><\/pre>\n\n\n\n<p><br \/>This command will give us a result like the following, where we will find the information we need:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsudo cpupower frequency-info\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>analyzing CPU 0:<br \/>driver: intel_pstate<br \/>CPUs which run at the same hardware frequency: 0<br \/>CPUs which need to have their frequency coordinated by software: 0<br \/>maximum transition latency: Cannot determine or is not supported.<br \/>hardware limits: 800 MHz \u2013 4.50 GHz<br \/>available cpufreq governors: performance powersave<br \/>current policy: frequency should be within 800 MHz and 2.60 GHz.<br \/>The governor \u00abpowersave\u00bb may decide which speed to use<br \/>within this range.<br \/>current CPU frequency: Unable to call hardware<br \/>current CPU frequency: 809 MHz (asserted by call to kernel)<br \/>boost state support:<br \/>Supported: yes<br \/>Active: yes<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\nTo limit the maximum frequency of the CPU, you can use this command:\n\n\ncpupower frequency-set -u 2600MHz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><br \/>To set the minimum frequency of the CPU, you can use this command:<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><br \/>cpupower frequency-set -d 800MHz<\/code><\/pre>\n\n\n\n<p><br \/>Remember to change the frequency values in the above commands to the desired value. But do not remove the unit (MHz), otherwise, it will not work.<\/p>\n\n\n\n<p>Daemon Configuration<\/p>\n\n\n\n<p>The great advantage of cpupower is that it provides a systemd service that we can configure to start with the system and set the parameters we want at startup, so we don&#8217;t have to type any commands every time we turn on the computer.<\/p>\n\n\n\n<p>First, we have to configure the service, for which we need to edit the \/etc\/default\/cpupower file, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><br \/><br \/>sudo nano \/etc\/default\/cpupower<\/code><\/pre>\n\n\n\n<p><br \/>Then, remove the hashtags (#) from the following lines and put the values you want to use. For example, my configuration is as follows:<br \/><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\ngovernor='powersave'<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>min_freq=\"800MHz\"<br \/>max_freq=\"2.6GHz\"<\/code><\/pre>\n\n\n\n<p><br \/>Depending on your CPU, frequency values may be different.<\/p>\n\n\n\n<p>Pay attention to the units used to set the frequency. The file usually includes comments with details about the allowed units.<\/p>\n\n\n\n<p>Finally, activate and start the service to make the changes effective, and these will be applied automatically every time you start the system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsudo systemctl enable cpupower.service\nsudo systemctl start cpupower.service<\/code><\/pre>\n\n\n\n<p><br \/>If you want to disable the cpupower service, you can do it like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><br \/>sudo systemctl disable cpupower.service<br \/>sudo systemctl stop cpupower.service<\/code><\/pre>\n\n\n\n<p><br \/>If you have modified the configuration file and want the changes to take effect immediately without restarting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsudo systemctl restart cpupower.service\n<\/code><\/pre>\n\n\n\n<p><strong>Checking Your System:<\/strong><\/p>\n\n\n\n<p>Here are the commands from the ls family that serve to obtain detailed information about the hardware you have. Their operation is simple, and they obtain information through the identification of each component and the information available on the internet.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>lscpu<\/strong>: This command will show detailed information about the central processor in your CPU; it does not have any additional options or functionality.bashCopy code<code>lscpu<\/code><\/li>\n\n\n\n<li><strong>lshw -short<\/strong>: This is a general-purpose utility that reports detailed but summarized information about all the hardware installed on the system, such as the processor, RAM, storage, USB drivers, or network adapters.bashCopy code<code>lshw -short<\/code><\/li>\n\n\n\n<li><strong>lspci<\/strong>: This command will display a list of all the peripherals connected to the PCI ports on your PC, along with their details. You can filter the results using grep, for example:bashCopy code<code>lspci -v | grep \"VGA\" -A 12<\/code><\/li>\n\n\n\n<li><strong>lsscsi<\/strong>: Shows information about SCSI devices connected to the system.bashCopy code<code>lsscsi<\/code><\/li>\n\n\n\n<li><strong>lsusb<\/strong>: Lists all devices connected to USB ports, as well as the USB controllers on the system. This helps you identify working ports and troubleshoot problematic peripherals.bashCopy code<code>lsusb<\/code><\/li>\n\n\n\n<li><strong>lsblk<\/strong>: Lists information about partitions on hard drives and other storage devices, including optical drives like DVD or BluRay.bashCopy code<code>lsblk<\/code><\/li>\n<\/ol>\n\n\n\n<p><strong>Additional Commands:<\/strong><\/p>\n\n\n\n<p>Apart from the ls commands described earlier, there are other very useful commands that provide more information than a simple list of components. They are more precise in showing the exact overall state of the system:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>df -H<\/strong>: Displays all system partitions, their mount points, and the available space on each.bashCopy code<code>df -H<\/code><\/li>\n\n\n\n<li><strong>fdisk<\/strong>: Equivalent to Diskpart in Windows, fdisk not only shows information about system partitions and volumes but also allows you to make modifications to them.bashCopy code<code>fdisk<\/code><\/li>\n\n\n\n<li><strong>free -m<\/strong>: Shows the amount of installed, free, and used RAM.bashCopy code<code>free -m<\/code><\/li>\n\n\n\n<li><strong>dmidecode<\/strong>: Differs from the previous commands as it extracts hardware information directly from the DMI tables.bashCopy code<code>dmidecode<\/code><\/li>\n\n\n\n<li><strong>hdparm<\/strong>: Shows information about SATA devices connected to the system.bashCopy code<code>hdparm<\/code><\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p>This article has been written based on readings from the websites: https:\/\/tecnoysoft.com\/2023\/03\/08\/como-reducir-la-temperatura-de-trabajo-de-nuestros-portatiles\/ and https:\/\/hardzone.es\/tutoriales\/mantenimiento\/informacion-hardware-linux\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The solution is to limit the speed. When we use our laptops disconnected from the power source, the system &#8220;changes personality.&#8221; Now, the focus is not on providing maximum performance but on obtaining the maximum autonomy from our battery. To achieve decent autonomy, the CPU speed is limited to the minimum possible, reducing CPU consumption, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,70],"tags":[66,67,79,95],"class_list":["post-838","post","type-post","status-publish","format-standard","hentry","category-arch","category-linux","tag-arch","tag-linux","tag-system","tag-temperature"],"_links":{"self":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/comments?post=838"}],"version-history":[{"count":1,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/838\/revisions"}],"predecessor-version":[{"id":839,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/838\/revisions\/839"}],"wp:attachment":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/media?parent=838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/categories?post=838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/tags?post=838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}