I’m trying to change the cpu frequency on my laptop (running Linux), and not having any success.
Here are some details:
# uname -a
Linux yoga 3.12.21-gentoo-r1 #4 SMP Thu Jul 10 17:32:31 HKT 2014 x86_64 Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz GenuineIntel GNU/Linux
# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="056675706377607445736260772b6e60776b60692b6a7762">[email protected]</a>, please.
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 0.97 ms.
hardware limits: 800 MHz - 2.60 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 800 MHz and 2.60 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 2.42 GHz (asserted by call to hardware).
(similar information for cpus 1, 2 and 3)
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
performance powersave
I initially had the userspace governor built into the kernel, but then I also tried building it as a module (with the same results); it was loaded while running the above commands (and I couldn’t find any system messages when loading it):
# lsmod Module Size Used by cpufreq_userspace 1525 0 (some other modules)
And here are the commands I tried for changing the frequency:
# cpufreq-set -f 800MHz Error setting new values. Common errors: - Do you have proper administration rights? (super-user?) - Is the governor you requested available and modprobed? - Trying to set an invalid policy? - Trying to set a specific frequency, but userspace governor is not available, for example because of hardware which cannot be set to a specific frequency or because the userspace governor isn't loaded? # cpufreq-set -g userspace Error setting new values. Common errors: - Do you have proper administration rights? (super-user?) - Is the governor you requested available and modprobed? - Trying to set an invalid policy? - Trying to set a specific frequency, but userspace governor is not available, for example because of hardware which cannot be set to a specific frequency or because the userspace governor isn't loaded?
Any ideas?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
This is because your system is using the new driver called intel_pstate. There are only two governors available when using this driver: powersave and performance.
The userspace governor is only available with the older acpi-cpufreq driver (which will be automatically used if you disable intel_pstate at boot time; you then set the governor/frequency with cpupower):
- disable the current driver: add
intel_pstate=disableto your kernel boot line - boot, then load the
userspacemodule:modprobe cpufreq_userspace - set the governor:
cpupower frequency-set --governor userspace - set the frequency:
cpupower --cpu all frequency-set --freq 800MHz
Method 2
The answer is in your question:
for core in $(seq 0 "$(($(getconf _NPROCESSORS_ONLN) - 1))"); do
echo {performance|powersave} >/sys/devices/system/cpu/cpu$core/cpufreq/scaling_governor ;
done
That and the kernel must be compiled with userspace governor enabled.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0