User Tools

Site Tools


public:script_for_controlling_intel_cpu_frequencies
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


public:script_for_controlling_intel_cpu_frequencies [2019/07/31 10:30] (current) – created fangfufu
Line 1: Line 1:
 +====== Scripts for controlling Intel CPU frequency ======
 +My laptop is a Lenovo T440p with a i7-4900MQ. I run Folding@Home on two of my CPU cores. The CPU constantly overheats, and my fan is always spinning at 4440 RPM. I find the noise annoying. Here is what I have done to alleviate the problem. 
 +
 +===== Enable or disable Intel Turbo Boost(TM) =====
 +<code bash>
 +#!/bin/bash
 +    echo "Intel Turbo Boost(TM) Status:"
 +    if [[ $1 == "off" ]]; then
 +        echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
 +    fi
 +    if [[ $1 == "on" ]]; then
 +        echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
 +    fi
 +
 +    state=$( cat /sys/devices/system/cpu/intel_pstate/no_turbo )
 +    if [[ $state -eq 1 ]]; then
 +        echo "Off"
 +    else
 +        echo "On"
 +    fi
 +
 +</code>
 +
 +===== Setting maximum CPU frequency =====
 +<code bash>
 +#!/bin/bash
 +
 +if ! [[ -z $@ ]]; then
 +  for i in {0..7} ; do
 +    echo $@00000 > /sys/devices/system/cpu/cpufreq/policy${i}/scaling_max_freq
 +  done
 +fi
 +
 +cpufreq-info | grep "current policy" | head -1 | cut -d ' ' -f 3-
 +</code>
 +
 +===== Setting CPU frequency governor =====
 +<code bash>
 +#!/bin/bash
 +if ! [[ -z $@ ]]; then
 +  for i in {0..7} ; do
 +    cpufreq-set -c $i -g $@
 +  done
 +fi
 +
 +cpufreq-info | grep "The governor" | head -1 | cut -d ' ' -f 19-
 +</code>
 +
  
public/script_for_controlling_intel_cpu_frequencies.txt · Last modified: 2019/07/31 10:30 by fangfufu