4

Is there a way to change min/max frequency for the CPU in Ubuntu 18.04 Bionic beaver? I want to lower my max CPU frequency to maybe 1700000 to make my laptop run more silent. Below is CPU frequency results.

$ paste <(cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_min_freq) <(sudo cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq) <(cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq) | column -s $'\t' -t
cat: '/sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq'
800000 2194.934 2200000
800000 2194.911 2200000
800000 2194.916 2200000
800000 2194.940 2200000
6
  • 1
    Are you asking about overclocking the CPU? If so, that is done in the BIOS. – jones0610 Jul 19 '18 at 22:37
  • I've posted a preliminary answer on how to discover your frequencies. Update your question with your results and specify how you would like them changed. Then I'll update my answer with the new values and commands. Thanks. – WinEunuuchs2Unix Jul 19 '18 at 23:49
  • I've changed the commands to enter in my answer. This will eliminate the error message you are getting for the current frequency. Please update your question with new commands. – WinEunuuchs2Unix Jul 24 '18 at 11:01
  • I can see your CPUs are running at full speed. There might be other problems. – WinEunuuchs2Unix Jul 24 '18 at 20:01
  • @WinEunuuchs2Unix I have monitored my CPU and it jumps between min and max values. My CPU usage is roughly about 30% when I'm using my computer, and almost never over 50%. So I should be able to lower max frequency about half to make it cooler and quieter. And I dont care if computer becomes slower. – Kemzen Jul 25 '18 at 1:43
6

Edit May 13, 2019 - simple bash GUI script

I wrote this simple bash GUI script to change minimum and maximum frequencies:

cpuf.png


Original Answer

Discover your Min/Max/Current Frequencies

To discover your frequencies copy and paste this command into your terminal (without the $ or # prompts):

$ sudo -i
# paste <(cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_min_freq) <(cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq) <(cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq) | column -s $'\t' -t
800000  900757  3500000
800000  921781  3500000
800000  857695  3500000
800000  904921  3500000
800000  816664  3500000
800000  845203  3500000
800000  892835  3500000
800000  844187  3500000
# exit
$

The minimum frequency, current frequency and maximum frequency is listed for each CPU. In my case it is 8 CPUs, in your case it will be 4 CPUs (dual core x 2 threads per core).

Values are listed in MHz with three decimals. So CPU 0 showing:

800000  900757  3500000
  • Minimum Frequency 800.000 MHz
  • Current Frequency 900.757 MHz
  • Maximum Frequency 3500.000 Mhz

How to reset Max Frequency

To change the maximum frequency lower (you can't change it higher) use this command to change it from 2200 Mhz to 1700 Mhz:

for x in /sys/devices/system/cpu/*/cpufreq/; do echo 1700000 | sudo tee $x/scaling_max_freq; done
6
  • It works, thank you very much. A short explanation of the command would be beautiful too. Anyway, thanks again. – Kemzen Jul 25 '18 at 3:46
  • @Kemzen Glad it works. Can you click the grey check mark next to the answer to let others know it works? For more explanation please read this: askubuntu.com/questions/340626/… – WinEunuuchs2Unix Jul 25 '18 at 10:37
  • how do we install cpuf man? – Olegzandr Denman Mar 31 '20 at 0:54
  • @OlegzandrDenman click on the underlined link. If you have a question ask it there. – WinEunuuchs2Unix Mar 31 '20 at 1:32
  • Can you write values to scaling_min_freq that are lower than cpuinfo_min_freq? My Xeon is set to 1.2GHz for min_freq, and still uses 45W at mains, when idle. I need that to be lower, because my motherboard does not have suspend-to-ram. – Bram Dec 18 '20 at 16:50
1

I found the following project that worked for me:

https://github.com/konkor/cpufreq

It comes with a deb package for easy installation, for more info. read the installation README.md file

https://github.com/konkor/cpufreq/blob/master/INSTALL.md#releases-page

1
  • Thank you so much for this answer! I installed their gnome extension (extensions.gnome.org/extension/1082/cpufreq) and now I can really easily control the number of active cores. My laptop temperature and fan activity came down to bearable levels again! And if I need some extra power it's easy to pump up the number of active cores. – Delestro Apr 30 '20 at 8:29
0

Not in the kernel, but you can go into your BIOS/Setup and disable power saving features (which differ between main boards, so I don't know what those options are and therefore can't be specific). When you disable power saving features, you lock in the CPU to its maximum speed all the time.

1
  • 3
    I do not want to disable Power saving features. I want to set Max CPU frequency to 1.7 GHz in OS. – Kemzen Jul 24 '18 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.