DevHeads.net

setting CPU frequency

My CPU will run up to 4.4Ghz but I want to limit it to a maximum of
4.0Ghz to avoid overheating problems.

When I try:
sudo cpufreq-set -u 4.0Ghz
or indeed any cpufreq-set command, I get:-

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?

What do I need to do to get cpufreq-set working? I'm using 16.04 with
4.13.0-26-generic

Comments

Re: setting CPU frequency

By Oliver Grawert at 01/17/2018 - 09:52

hi,
Am Mittwoch, den 17.01.2018, 12:35 +0000 schrieb Richard Kimber:
If thats an intel CPU, cpufreq is disabled since a few years in the
kernel in favour of the intel_pstate driver ... if you want to go back
to generic cpufreq you will have to disable the intel_pstate driver via
the kernel command line ...

(wasnt there the same discussion on this list just recently ?)

ciao
oli

Re: setting CPU frequency

By Oliver Grawert at 01/17/2018 - 09:58

hi,
Am Mittwoch, den 17.01.2018, 14:52 +0100 schrieb Oliver Grawert:
...for managing pstate:

<a href="https://askubuntu.com/a/614390/217953" title="https://askubuntu.com/a/614390/217953">https://askubuntu.com/a/614390/217953</a>

ciao
oli

Re: setting CPU frequency

By R Kimber at 01/18/2018 - 07:07

On Wed, 17 Jan 2018 14:58:46 +0100

Thanks. That document implies that I can do
sudo sh -c 'echo -n 85 >
/sys/devices/system/cpu/intel_pstate/max_perf_pct'
but although after doing that
cat /sys/devices/system/cpu/intel_pstate/max_perf_pct says '85',
cat /proc/cpuinfo gives "cpu MHz : 4000.016" which doesn't
seem to be 85% of 4.4Ghz

Does /proc/cpuinfo not give the actual frequency? If not what does?

- Richard

Re: setting CPU frequency

By Oliver Grawert at 01/18/2018 - 07:16

hi,
Am Donnerstag, den 18.01.2018, 11:07 +0000 schrieb Richard Kimber:
while true; do sleep 0.1; cat /proc/cpuinfo|grep MHz; done

and you should see it go up and down with more accurate values ...

ciao
oli

Re: setting CPU frequency

By R Kimber at 01/18/2018 - 09:36

On Thu, 18 Jan 2018 12:16:43 +0100

Thanks. I tried that but there was no variation at all. All the
reported values were cpu MHz : 4000.016

- Richard

Re: setting CPU frequency

By Colin Law at 01/18/2018 - 10:03

On 18 January 2018 at 13:36, Richard Kimber
< ... at politicsresources dot net> wrote:
What does it say if don't set it to 85?

Colin

Re: setting CPU frequency

By R Kimber at 01/18/2018 - 10:21

On Thu, 18 Jan 2018 14:03:34 +0000

If I set it to 100, it still says
cpu MHz : 4000.016

- Richard

Re: setting CPU frequency

By Colin Law at 01/18/2018 - 10:42

On 18 January 2018 at 14:21, Richard Kimber
< ... at politicsresources dot net> wrote:
Since it is already running at the speed you want then it seems you
don't need to do anything.

Colin

Re: setting CPU frequency

By R Kimber at 01/18/2018 - 17:01

On Thu, 18 Jan 2018 14:42:13 +0000

Well, OK, but what if I need it lower? I'm trying to understand what's
going on.

Given that I've tried to set it to 85% (which is lower than 4.0) and
that doesn't seem to have had an effect, my question is - why?

The situation is further complicated by the fact that the Mate panel CPU
monitor claims I'm mostly running at 4.4

- Richard.

Re: setting CPU frequency

By Nils Kassube at 01/19/2018 - 02:48

Richard Kimber wrote:
Maybe your mainboard only provides 4.0 and 4.4 GHz. If I let Oli's
command run on my desktop, I only get two different values but on a
laptop I get at least five different values.

Nils

Re: setting CPU frequency

By R Kimber at 01/19/2018 - 13:12

On Fri, 19 Jan 2018 07:48:49 +0100

Maybe. But I'd bet it's kernel-related, or something to do with
software settings.

- Richard