Last active
September 26, 2024 12:11
-
-
Save queses/6315598d4694a8fdb6a73785a62adc40 to your computer and use it in GitHub Desktop.
Linux No TurboBoost Fix. Doesn't work with enabled SecureBoot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Enable Turbo Boost on Intel CPUs | |
[Service] | |
ExecStart=/bin/sh -c "/usr/sbin/modprobe msr && /root/turbo-boost.sh enable" | |
RemainAfterExit=yes | |
[Install] | |
WantedBy=sysinit.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl status myservice#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install msr-tools | |
sudo chmod +x /root/turbo-boost.sh | |
sudo systemctl daemon-reload | |
sudo systemctl enable enable-turbo-boost.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment