Open LDrawe opened 3 months ago
I've made a fork and edited cpufreqctl.sh
. Instead of getting the CPU Max Frequency from /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq
, it gets from /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
. As mentioned above, scaling_max_freq
gets the actual max frequency. By doing so it works correctly:
If scaling_max_freq or scaling_min_freq value in the config file is greater than the CPU max frequency of auto-cpufreq --stats , the config file is ignored, and the GUI App only shows "Battery is: Charging".
This is unfortunately true, and something I was aware of. As like you I would prefer to have I'd like to have scaling_min_freq = 1800000
(1800Mhz), but instead I'll might see a message like i.e with --stats
:
Given value for 'scaling_min_freq' is not within the allowed frequencies 400000-4600000 kHz
So I'd have to set it to 400000
instead, but I also found a way I can make this message dissapear even with 1800000
if I restart auto-cpufreq daemon after making changes to auto-cpufreq.conf
systemctl stop auto-cpufreq
systemctl start auto-cpufreq
But even then I might see them go to 800Mhz instead when 1800 should be the scaling_min_freq
. If I leave turbo = auto
instead of turbo = always
where indeed then it never goes under 1800.
I never had the problem you had, as my max frequencies were always reached. I will even get same values for both:
Output of cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq: 1600000 Output of cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: 3400000
Where in my case these values are the same:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
4600000
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
4600000
But I also see you're limiting the scaling_max_freq
, why are you doing this?
scaling_max_freq = 2600000
I've made a fork and edited cpufreqctl.sh
I would encourage you to contribute to the project and you will be credited for your work as part of future release, as if it fixes an issue it's def worth having.
But can you share are you values before and after the changes? Because for me they are all the same between max & min:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
400000
400000
400000
400000
400000
400000
400000
400000
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
4600000
4600000
4600000
4600000
4600000
4600000
4600000
4600000
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq
4600000
4600000
4600000
4600000
4600000
4600000
4600000
4600000
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_min_freq
400000
400000
400000
400000
400000
400000
400000
400000
And finally just wanted to add that both my min & max frequency are correctly identified in both --stats
and --debug
, i.e:
Linux distro: Ubuntu 24.04 Noble Numbat
Linux kernel: 6.8.0-38-generic
Processor: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Cores: 8
Architecture: x86_64
Driver: intel_pstate
------------------------------ Current CPU stats ------------------------------
CPU max frequency: 4600 MHz
CPU min frequency: 1800 MHz
Core Usage Temperature Frequency
CPU0 2.0% 64 °C 4210 MHz
CPU1 4.0% 63 °C 1800 MHz
CPU2 9.0% 61 °C 4515 MHz
CPU3 6.0% 63 °C 4111 MHz
CPU4 4.0% 64 °C 1800 MHz
CPU5 5.1% 63 °C 4583 MHz
CPU6 3.0% 61 °C 4433 MHz
CPU7 3.9% 63 °C 1800 MHz
CPU fan speed: 3412 RPM
---------------------------- CPU frequency scaling ----------------------------
Battery is: charging
Setting to use: "performance" governor
Setting to use: "performance" EPP
Total CPU usage: 4.7 %
Total system load: 1.08
Average temp. of all cores: 62.75 °C
Configuration file enforces turbo boost
setting turbo boost: on
-------------------------------------------------------------------------------
Also some potentially related EPP changes to this issue were merged with #738
But even then I might see them go to 800Mhz instead when 1800 should be the scaling_min_freq. If I leave turbo = auto instead of turbo = always where indeed then it never goes under 1800.
Interesting. Maybe when the CPU enter turbo state it's exposing these frequencies to the system? That would explain why setting to "always" it would never go down 1800, as this frequency is always available. I will try this and report back.
But I also see you're limiting the scaling_max_freq, why are you doing this?
Mainly because of temps and fan noise. When gaming it would almost always reach 3.4GHz and increase the temperature to the thermal limit of 100°, to then throttle down to 400mhz because of these high temps, even tough I'm not playing heavy or CPU intensive games. . Even on desktop it reaches 85° on normal use, along with the noisy fans. I found that between 2.1 - 2.7Ghz is the sweet spot, where I can get stable FPS, frametime and good temps.
I would encourage you to contribute to the project and you will be credited for your work as part of future release, as if it fixes an issue it's def worth having.
That would be super cool! I can make a PR with these changes I've made if you want, as it should get a ""more accurate"" info.From what I've seen shouldn't be a problem as for most systems these values are the same, and it would now cover these weird cases(like mine) where they aren't.
But can you share are you values before and after the changes? Because for me they are all the same between max & min
Sure, here you go: Before
# I will keep only 1 value in each command, as they're all the same, to keep this shorter
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
400000
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
3400000
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq
1600000
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_min_freq
400000
After
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
1800000
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
2600000
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq
1600000
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_min_freq
400000
I'm no expert with GUI's,but I can try giving it a look into this problem when the value(s) is not within the allowed frequencies, maybe auto-setting the max
and/or min
to default in the script when they surpass the limits. But I would need to see why the GUI refuses to show anything else in these cases.
That would be great, @shadeyg56 is the one who originally introduced GUI, so if you have some questions he might be able to help. We're also all hanging around in auto-cpufreq Discord community.
Fill out information requested in this template, without doing so issue will be ignored & closed!
Have you tried?
Error output:
System information:
Add/paste output of:
Also please be descriptive about the issue you're reporting, i.e: what you tried & what's the expected behaviour.
The output of
auto-cpufreq --debug
reports that the max CPU frequency is 3400Mhz, but the output ofauto-cpufreq --stats
says that it's 1600Mhz( The max frequency without turbo boost). Ifscaling_max_freq
orscaling_min_freq
value in the config file is greater than the CPU max frequency ofauto-cpufreq --stats
, the config file is ignored, and the GUI App only shows "Battery is: Charging".Expected Behaviour
It should use the real CPU Max frequency(3400Mhz) as the limit and not the max without turbo
Proof
auto-cpufreq.conf
Additional Information
Output of
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
:1600000
Output of
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
:3400000
I'm using msr-tools to edit the CPU registers to enable turbo boost, since the option is not present in my Bios. Without it the turbo would be permanently disabled, and if I use the
acpi-cpufreq
driver the turbo works, but it doesn't expose the real max frequency of the CPU, and therefore I can't limit it. Also I'm using a notebook, but I removed the battery since it died