Skip to content

Repository files navigation

How To Change The CPU Frequency?

Installation

sudo apt-get install cpufrequtils

Running

Save the below in a set_freq.sh file

sudo cpufreq-set -c0 -g userspace
sudo cpufreq-set -c1 -g userspace
sudo cpufreq-set -c2 -g userspace
sudo cpufreq-set -c3 -g userspace
sudo cpufreq-set -c0 -f $1GHz
sudo cpufreq-set -c1 -f $1GHz
sudo cpufreq-set -c2 -f $1GHz
sudo cpufreq-set -c3 -f $1GHz
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq
cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq
cat /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq

Now execute

chmod +x set_freq.sh

To change the frequncy exeucute the below command

./set_freq.sh 2.2

The available freqencies can be found by

more cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

Running Benchmarks

We used Lulesh benchmark and Graph 500 for studying the change in temperature and execution time with change in frequency

Results

FrequencyTemp Core 1 ℃Temp Core ℃Execution Time in Seconds
1197000353779.65
2261000394340.34
2394000394339.49
2527000414437.05
2660000434535.52
2793000434534.26
2926000434633.70
3059000444732.27
3192000454830.74
3193000455031.15

Frequency vs Tempararture Graph

Temparature-Frequency

Frequency vs Time Graph

Time-Frequency

Temparature reading in HPC Computer

Silp Temparature Reading

How to read CPU voltage for 64 bit computer

 sudo apt-get install msr-tools
sudo modprobe msr
sudo rdmsr 408 --bitfield 47:32 --decimal --processor 0

The value of register 408(x198) can be used to calculate the value of voltage. The value obtained from 32:47 bits on multiplying with (1 / 2^^13) gives the voltage.

Comparison of Frequency Vs Voltage

Max FrequencyMax VoltageMin Voltage
1.2 GHz0.86890 Volt0.70386 Volt
1.4 GHz0.86890 Volt0.71838 Volt
1.6 GHz0.86890 Volt0.73291 Volt
1.8 GHz0.86890 Volt0.75232 Volt
2.0 GHz0.87366 Volt0.81055 Volt
2.2 GHz0.87366 Volt0.80579 Volt
2.4 GHz0.90771 Volt0.86890 Volt

Graph

Freq vs Voltage

Time for Various Programs

ProgramUserspace TimeOndemand Time
Compress 10gb file01:55 Min01:20 Min
Lulesh2.048.41 Sec42.99 Sec
Convert File To Pdf - LibreOffice6.41 Sec4.30 Sec
Copy 1 GB16.128 Sec17.356 Sec

Comparison of Governors

The source code of Tebalo can be foun at https://github.com/CPUhackers/tebalo

Time

ProgramOndemandConservativePowersavePerformanceRounder @ 1Rounder @ 2Rounder @ 5
Lulesh @ 3029.7631.3574.2630.8943.2141.9143.46
Lulesh @ 3556.1656.80132.2557.0279.1082.8777.30
Lulesh @ 4097.2496.40215.0295.29136.79128.67132.02
Lulesh @ 45159.65175.90359.83157.57217.00225.11209.52
ProgramOndemandTebalo
Graph 0.3k 0.3k18.5220.24
Graph 0.5k 0.5k27.4528.42
Graph 0.7k 0.7k48.5252.24
Graph 1k 1k84.3388.41

Max Temparatue

ProgramOndemandConservativePowersavePerformanceRounder @ 1Rounder @ 2Rounder @ 5
Lulesh @ 3058,5756,5544,4356,5555,5356,5555,53
Lulesh @ 3558,5658,5645,4457,5656,5556,5555,53
Lulesh @ 4060,5860,5945,4459,5757,5658,5657,54
Lulesh @ 4559, 5760,5744,4263,5757,5557,5558,56

Min Temparatue

ProgramOndemandConservativePowersavePerformanceRounder @ 1Rounder @ 2Rounder @ 5
Lulesh @ 3044,4339,4040,4042,4241, 4141,3939,38
Lulesh @ 3541,4039,3939,3944,4239, 3940,3941,39
Lulesh @ 4041,4141,4039,3947,4540, 4041,4042,40
Lulesh @ 4537, 3639,3738,3743,4042, 4040,3941,39

Average Temparature

ProgramOndemandConservativePowersavePerformanceRounder @ 1Rounder @ 2Rounder @ 5
Lulesh @ 3056.63,55.3554.11, 52.8142.53, 41.9253.53,52.6749.68, 48.2249.22,47.9749.03,46.55
Lulesh @ 3555.32,53.9655.01, 53.6243.46,42.3255.37,53.7949.57, 48.5250.04,48.9448.36,46.01
Lulesh @ 4057.01,55.3857.09, 55.8043.71,42.6756.63,55.0850.79, 49.7951.21,50.0150.05,47.76
Lulesh @ 4555.51,52.9156.34, 53.8243.08, 40.5756.72,53.7550.65, 48.1650.99,48.6050.68,48.57

About

Where we tinker with the core and share the results

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages