cpufreqコマンドのインストール
> sudo apt install cpufrequtils
現在のCPU情報のダンプ。設定できるガバナーがavailable cpufreq governors
で表示される。現在のガバナーがThe governor "performance" may decide...
と文章で表示される。
> cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 0.97 ms.
hardware limits: 1.60 GHz - 2.60 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 1.60 GHz and 2.60 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 1.63 GHz.
:
ガバナーはコア単位で指定する。ただし再起動するとリセットされる。
> cpufreq-set -c 0 -g performance
> cpufreq-set -c 1 -g performance
> cpufreq-set -c 2 -g performance
> cpufreq-set -c 3 -g performance
恒久的にCPUのガバナーを変更する場合は、/etc/default/cpufrequtils
ファイルを作成して、以下の設定を追記する。
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED=0
MIN_SPEED=0
追記したらCPUクロック周波数を調整しているデーモンを再起動する。再起動すると、上記で追加したファイルをロードして監視してくれるようになる。
> sudo /etc/init.d/cpufrequtils restart
可能なら、OSを再起動して以下を実行し、最初から指定したガバナーになっていればOK
> cpufreq-info | grep "The governor"
The governor "performance" may decide which speed to use
The governor "performance" may decide which speed to use
The governor "performance" may decide which speed to use
The governor "performance" may decide which speed to use
cpuinfoをつかった現在のクロック周波数の値
> cat /proc/cpuinfo | grep MHz
cpu MHz : 2016.523
cpu MHz : 2260.882
cpu MHz : 1637.695
cpu MHz : 1798.976
コア単位?で温度がダンプされているので、ワイルドカードでダンプしている。
> cat /sys/class/thermal/thermal_zone*/temp
32000 <-- 32度
31000 <-- 31度