Wednesday, May 15, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 4922  / 2 Years ago, mon, april 25, 2022, 3:39:56

I'm testing the new amd-pstate driver on my laptop, I've installed the latest kernel 5.18 via ppa:tuxinvader/lts-mainline, changed some boot options and everything works flawlessly.


Unfortunately when I run the command cpupower, I'm getting:


WARNING: cpupower not found for kernel 5.18.5-051805

You may need to install the following packages for this specific kernel:
linux-tools-5.18.5-051805-generic
linux-cloud-tools-5.18.5-051805-generic

You may also want to install one of the following packages to keep up to date:
linux-tools-generic
linux-cloud-tools-generic

linux-tools-generic is already installed and can't find linux-tools-5.18.5-051805-generic, the latest version on my system is linux-tools-5.13.0-25-generic.
I can't find a way to install cpupower.


More From » 20.04

 Answers
5

If you do not have access to the most recent cpupower, or even if you do, you can just use the basic commands to make changes to the operating parameters of the CPU frequency scaling driver:


Examples:


Just look at what is available:


doug@s19:~/kernel/linux$ grep . /sys/devices/system/cpu/cpu0/cpufreq/*
/sys/devices/system/cpu/cpu0/cpufreq/affected_cpus:0
/sys/devices/system/cpu/cpu0/cpufreq/base_frequency:4100000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq:4800000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq:800000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency:20000
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences:default performance balance_performance balance_power power
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference:balance_performance
/sys/devices/system/cpu/cpu0/cpufreq/related_cpus:0
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors:conservative ondemand userspace powersave performance schedutil
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:800000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver:intel_cpufreq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:schedutil
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:4800000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:800000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed:<unsupported>

O.K. I would rather use the ondemand CPU frequency scaling governor, so change it and then check it:


doug@s19:~/kernel/linux$ echo ondemand | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
ondemand
doug@s19:~/kernel/linux$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu11/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu8/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu9/cpufreq/scaling_governor:ondemand

I think I would like to limit my max CPU frequency, so change it and check it:


doug@s19:~/kernel/linux$ echo 4400000 | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
4400000
doug@s19:~/kernel/linux$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu10/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu11/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu8/cpufreq/scaling_max_freq:4400000
/sys/devices/system/cpu/cpu9/cpufreq/scaling_max_freq:4400000

I wonder if the frequency is actually limiting? put a heavy load on the CPUs and then check:


doug@s19:~/kernel/linux$ grep . /sys/devices/system/cpu/cpu*/cpufreq

/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:4399985
/sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq:4400002
/sys/devices/system/cpu/cpu11/cpufreq/scaling_cur_freq:4400022
/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq:4399980
/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq:4400004
/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq:4400007
/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq:4399988
/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq:4400017
/sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq:4399985
/sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq:4400003
/sys/devices/system/cpu/cpu8/cpufreq/scaling_cur_freq:4400006
/sys/devices/system/cpu/cpu9/cpufreq/scaling_cur_freq:4399997

I think I would like to go back to max CPU frquency:


doug@s19:~/kernel/linux$ echo 4800000 | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
4800000
doug@s19:~/kernel/linux$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:4800002
/sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq:4799995
/sys/devices/system/cpu/cpu11/cpufreq/scaling_cur_freq:4799998
/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq:4800010
/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq:4800016
/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq:4799994
/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq:4799987
/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq:4800012
/sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq:4800000
/sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq:4799985
/sys/devices/system/cpu/cpu8/cpufreq/scaling_cur_freq:4800022
/sys/devices/system/cpu/cpu9/cpufreq/scaling_cur_freq:4799989

[#400] Tuesday, April 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bsorbedeldy

Total Points: 315
Total Questions: 110
Total Answers: 108

Location: Reunion
Member since Mon, Dec 28, 2020
3 Years ago
;