Set CPU Turbo Frequency Limit using acpi-cpufreq driver in Linux
This article will guide you through the process of setting the CPU Turbo Frequency Limit using the acpi-cpufreq driver in Linux. If you are using a Clevo laptop/desktop with an i5-11400 CPU and have disabled the intel_pstate driver by adding intel_pstate=disable to the kernel command line, this guide is for you.
1. Check the current frequency scaling driver
First, check the current frequency scaling driver by running the following command:
cat /sys/kernel/debug/cpu/cpu0/cpufreq/scaling_driver
The output should be acpi-cpufreq if you are using the acpi-cpufreq driver.
2. Check the available CPU frequency ranges
Next, check the available CPU frequency ranges by running the following command:
cat /sys/kernel/debug/cpu/cpu0/cpufreq/scaling_available_frequencies
This command will display a list of available frequencies in Hertz. Make a note of the maximum frequency in this list, as you will use it later.
3. Set the CPU Turbo Frequency Limit
Now, you can set the CPU Turbo Frequency Limit using the cpufreq-set command. Replace FREQUENCY with the maximum frequency you noted earlier:
sudo cpufreq-set -u FREQUENCY
This command sets the upper limit of the CPU frequency to the specified value. To verify the new limit, you can use the following command:
cpufreq-info
4. Save the changes persistently
To make the changes persistent across reboots, you need to create a new file in the /etc/sysctl.d/ directory:
sudo nano /etc/sysctl.d/cpufreq-limit.conf
Add the following lines to the file: (Replace FREQUENCY with the maximum frequency you noted earlier)
# Disable intel_pstate
intel_pstate=disable
# Set the CPU Turbo Frequency Limit
cpufreq.default_policy=0
cpufreq.default_policy_ondemand=0
cpufreq.min_freq=100000
cpufreq.max_freq=FREQUENCY
Save and close the file. Then, update the sysctl configuration:
sudo sysctl --system
- Check the current frequency scaling driver
- Check the available CPU frequency ranges
- Set the CPU Turbo Frequency Limit using the
cpufreq-setcommand - Save the changes persistently by creating a new file in the
/etc/sysctl.d/directory