So I looked for resolution and found disabling turbo boost can help.
- First, you need to install msr-tools:
sudo apt-get install msr-tools
- To disable turbo boost on all your cpu cores:
sudo wrmsr -pi 0x1a0 0x4000850089
where i is the cpu core number, e.g. 0, 1, 2, 3..., you can get those number by runningcat /proc/cpuinfo | grep processor
.
Note: you need to run the wrmsr command for each cpu core. - To re-enable turbo boost on all your cpu cores:
sudo wrmsr -pi 0x1a0 0x850089
where i is the cpu core number, e.g. 0, 1, 2, 3..., you can get those number by runningcat /proc/cpuinfo | grep processor
.
Note: you need to run the wrmsr command for each cpu core.
A script to disable/enable turbo boost
The following script can be used to turn off/on turbo boost:#!/bin/bash if [[ -z $(which rdmsr) ]]; then echo "msr-tools is not installed. Run 'sudo apt-get install msr-tools' to install it." >&2 exit 1 fi if [[ ! -z $1 && $1 != "enable" && $1 != "disable" ]]; then echo "Invalid argument: $1" >&2 echo "" echo "Usage: $(basename $0) [disable|enable]" exit 1 fi cores=$(cat /proc/cpuinfo | grep processor | awk '{print $3}') for core in $cores; do if [[ $1 == "disable" ]]; then sudo wrmsr -p${core} 0x1a0 0x4000850089 fi if [[ $1 == "enable" ]]; then sudo wrmsr -p${core} 0x1a0 0x850089 fi state=$(sudo rdmsr -p${core} 0x1a0 -f 38:38) if [[ $state -eq 1 ]]; then echo "core ${core}: disabled" else echo "core ${core}: enabled" fi done
Usage:
You can copy the above script and save it into a file named turbo-boost then set it to be executable:
sudo chmod +x turbo-boostyou can then use it to disable/enable turbo boost:
turbo-boost disable
turbo-boost enable
Brilliant. This script works perfectly on my laptop's poor, overheating Sandy Bridge i7-2760QM quad core CPU that was routinely hitting 92°C while doing WCG/BOINC cancer gene marker research 24/7/365 (cores 0-4 ranging between 87°-92°C). Now at a much more reasonable 76°C - 85°C. Ubuntu Linux 18.04. CPU is on rails at its rated 2.4 GHz base clock speed, which is what I want. It kept trying to go higher w/Turbo mode. I was desperate, and this is the only solution on the entire web I could find that was clear, direct, simple and 100% effective. Just brilliant. Many thanks!
ReplyDeleteThanks for this. I noticed that running the disable option turns the turbo boost off, but also sets the governor to powersave mode. I would like to simply turn off the the turbo boost, keeping my cpu governor set to performance. Any suggestions?
ReplyDelete