2

Newbie here. I have a Dell Inspiron 3442 who suffers from the "CPU stuck at 800Mhz" problem. In Windows, I used to run ThrottleStop at every startup and disable BD PROCHOT... So I installed Ubuntu recently and learned to solve this problem with a set of commands in this answer:

https://askubuntu.com/a/1192949/1053161

Which are :

sudo cpufreq-set -c 0 -g performance
sudo cpufreq-set -c 1 -g performance
sudo cpufreq-set -c 2 -g performance
sudo cpufreq-set -c 3 -g performance
sudo modprobe msr
sudo wrmsr 0x1FC 17422

These completely solved my problem. Now I want to make a script that could be run automatically on startup / after login. What is the easiest way to accomplish this?

Thanks in advance!

Arthur Tabbal
  • 123
  • 2
  • 6

1 Answers1

3

Script should look like:

#!/bin/sh

# Prevent unset variable problems
set -u

# Change CPU setting
cpufreq-set -c 0 -g performance
cpufreq-set -c 1 -g performance
cpufreq-set -c 2 -g performance
cpufreq-set -c 3 -g performance
modprobe msr
wrmsr 0x1FC 17422

Save the script somewhere: /Path/to/script.sh

Open the root crontab using:

# crontab -u root -e

In it, add these lines:

# Set CPU frequency on reboot
@reboot /Path/to/script.sh

Save and exit.

Hope that helps!

jdrch
  • 120
  • 1
  • 12