Cpufrequtils
From FrugalWiki
Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어
- Cpufrequtils** is a set of utilities designed to assist CPU frequency scaling, a technology used primarily by notebooks that enables the operating system to scale the CPU speed up or down, depending on the current system load.
When used in conjunction with pm-utils, it provides a complete power management suite.
This article covers installation and basic configuration of the cpufrequtils package.
Contents |
Installation
Configuration
CPU frequency driver
In order for frequency scaling to work properly, the operating system must first know the limits of the CPU(s). To accomplish this, a kernel module is loaded that can read and manage the specifications of the CPU(s).
Most modern notebooks and desktops can simply use the acpi-cpufreq driver. However, other options include the p4-clockmod, powernow-k8, and speedstep-centrino drivers. To see a full list of available drivers, run the following:
To load the CPU frequency driver manually:
Intel
For older Intel CPUs, the command above may return with:
FATAL: Error inserting acpi_cpufreq ([...]/acpi-cpufreq.ko): No such device
In this case, replace the kernel module acpi-cpufreq with speedstep-centrino, p4-clockmod or speedstep-ich.
- Notice that the speedstep-centrino module is deprecated.**
AMD
Loading at boot
To load the driver automatically at startup, add the appropriate driver to the MODULES array within /etc/sysconfig/modules.
Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running:
The output should appear similar to the following:
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009 Veuillez rapportez les erreurs et les bogues à cpufreq@vger.kernel.org, s'il vous plait. analyse du CPU 0 : pilote : acpi-cpufreq CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 10.0 us. limitation matérielle : 1000 MHz - 1.67 GHz plage de fréquence : 1.67 GHz, 1.33 GHz, 1000 MHz régulateurs disponibles : performance, powersave, ondemand, conservative, userspace tactique actuelle : la fréquence doit être comprise entre 1.67 GHz et 1.67 GHz. Le régulateur "performance" est libre de choisir la vitesse dans cette plage de fréquences. la fréquence actuelle de ce CPU est 1.67 GHz. des statistique concernant cpufreq:1.67 GHz:39,64%, 1.33 GHz:5,80%, 1000 MHz:54,57% (11126) analyse du CPU 1 : pilote : acpi-cpufreq CPUs which run at the same hardware frequency: 1 CPUs which need to have their frequency coordinated by software: 1 maximum transition latency: 10.0 us. limitation matérielle : 1000 MHz - 1.67 GHz plage de fréquence : 1.67 GHz, 1.33 GHz, 1000 MHz régulateurs disponibles : performance, powersave, ondemand, conservative, userspace tactique actuelle : la fréquence doit être comprise entre 1.67 GHz et 1.67 GHz. Le régulateur "performance" est libre de choisir la vitesse dans cette plage de fréquences. la fréquence actuelle de ce CPU est 1.67 GHz. des statistique concernant cpufreq:1.67 GHz:39,25%, 1.33 GHz:5,57%, 1000 MHz:55,19% (10982)
To simply see which governors are available:
Monitoring the CPU speed in real-time can be achieved by running:
Cpufrequtils
Go through the /etc/sysconfig/cpufreq to define governors, frequencies and policies.
Scaling governors
Governors can be thought of as pre-configured power schemes for the CPU. These governors must be loaded as kernel modules in order to be seen by such programs as kpowersave and gnome-power-manager. One may load as many governors as desired (only one will be active at any given time).
Available governors:
- cpufreq_performance (default)
- The performance governor is built into the kernel and runs the CPU(s) at maximum clock speed
- cpufreq_ondemand (recommended)
- Dynamically increases/decreases the CPU(s) clock speed based on system load
- cpufreq_conservative
- Similar to ondemand, but more conservative (clock speed changes are more graceful)
- cpufreq_powersave
- Runs the CPU at minimum speed
- cpufreq_userspace
- Manually configured clock speeds by user
Load the desired governor(s) with modprobe. For example:
Or, add the desired governor(s) to the MODULES array in {{Filename|/etc/sysconfig/modules} and reboot.
Manually set the governor by running the cpufreq-set command (as root). However, this setting will not be saved after a reboot/shutdown. For example:
Note that the previous command only sets the governor for the first processor. If you have a multicore or multiprocessor system, use the -c flag to set the governor for a specific core. For example, to set the governor for the fourth core (core numbers start from zero):
# cpufreq-set -c 3 -g ondemand
Run cpufreq-set --help or man cpufreq-set for more information.
For those who would like a GUI for setting governors or frequency there is trayfreq, a GTK+ application that sits in the system tray.
Daemon
cpufrequtils also includes a daemon which allows users to set the desired scaling governor and min/max clock speeds for all processor cores at boot-time, without the need for additional tools such as kpowersave.
Before starting the daemon, edit /etc/sysconfig/cpufreq as root, selecting the desired governor and setting the min/max speed for your CPU(s), for example:
#configuration for cpufreq control # valid governors: # ondemand, performance, powersave, # conservative, userspace governor="ondemand" # valid suffixes: Hz, kHz (default), MHz, GHz, THz min_freq="1GHz" max_freq="2GHz"
With the appropriate configuration, start the daemon with the following command:
To start the daemon automatically at startup,
Cpufreqd
A small daemon to adjust cpu speed and voltage (and not only) for kernels using any of the cpufreq drivers available. Cpufreqd is not a userspace governor.
Cpufreqd allows you to apply governor profiles from rules based on battery level, ac status, temperature (ACPI or sensors), running programs, cpu usage and (maybe) more. You can also change your nforce FSB clock and video card frequency (NVidia only) or execute arbitrary commands when a specific rule is applied.
You need a CPU with frequency and voltage scaling capabilities and a Linux kernel with cpufreq support.
Installation
Daemon
Configuration
See /etc/cpufreqd.conf
Sources
* https://wiki.archlinux.org/index.php/Cpufrequtils