Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Cpufrequtils ====== Dynamic CPU frequency scaling (also known as CPU throttling) is a technique in computer architecture where a processor is run at a less-than-maximum frequency in order to conserve power. Here is a setup process using "cpufrequtils". === 1. Install "cpufrequtils" === <code bash target> $ sudo apt-get install cpufrequtils </code> === 2. Set governor and cpu speed === You need to create **/etc/default/cpufrequtils** file and fill it as the following format. <code bash target> $ sudo vi /etc/default/cpufrequtils </code> <code bash target> ENABLE="true" GOVERNOR="ondemand" MAX_SPEED=1536000 MIN_SPEED=100000 </code> You can check the available list of governor and cpu speed under those nodes. <code> /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors </code> <code> /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies </code> === 3. Restart cpufrequtils service === Restart cpufrequtils service. <code bash target> $ sudo service cpufrequtils restart </code> Then, you can check the cpufreq info is updated. <code bash target> $ cpufreq-info -o minimum CPU frequency - maximum CPU frequency - governor CPU 0 100000 kHz ( 6 %) - 1536000 kHz (100 %) - ondemand CPU 1 100000 kHz ( 6 %) - 1536000 kHz (100 %) - ondemand CPU 2 100000 kHz ( 6 %) - 1536000 kHz (100 %) - ondemand CPU 3 100000 kHz ( 6 %) - 1536000 kHz (100 %) - ondemand </code> === 4. [Option] Ubuntu 18.04 - Disable ondemand.service using systemctl === In case of <color #ed1c24>**Ubuntu 18.04**</color>, ondemand.service overrides the default governor, so you should disable it to use cpufrequtils. <code bash target> $ sudo systemctl disable ondemand </code> If you want to restore this service as default, please use this command. <code bash target> $ sudo systemctl enable ondemand </code> ===== Set-up Examples ===== === [Example] ODROID-N2 === == Available governor and cpu frequency sets == <code bash target> $ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors ondemand powersave userspace conservative interactive performance schedutil </code> <code bash target> $ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies 100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1896000 $ cat /sys/devices/system/cpu/cpufreq/policy2/scaling_available_frequencies 100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1800000 </code> == cpufrequtils option == <code bash target> $ sudo vi /etc/default/cpufrequtils ENABLE="true" GOVERNOR="ondemand" </code> == cpufreq-info == <code bash target> $ sudo service cpufrequtils restart $ cpufreq-info -o minimum CPU frequency - maximum CPU frequency - governor CPU 0 100000 kHz ( 5 %) - 1896000 kHz (100 %) - ondemand CPU 1 100000 kHz ( 5 %) - 1896000 kHz (100 %) - ondemand CPU 2 100000 kHz ( 5 %) - 1800000 kHz (100 %) - ondemand CPU 3 100000 kHz ( 5 %) - 1800000 kHz (100 %) - ondemand CPU 4 100000 kHz ( 5 %) - 1800000 kHz (100 %) - ondemand CPU 5 100000 kHz ( 5 %) - 1800000 kHz (100 %) - ondemand </code> === [Example] ODROID-XU3/XU4 === == Available governor and cpu frequency sets == <code bash target> $ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors conservative userspace powersave ondemand performance schedutil </code> <code bash target> $ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 $ cat /sys/devices/system/cpu/cpufreq/policy4/scaling_available_frequencies 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000 </code> == cpufrequtils option == <code bash target> $ sudo vi /etc/default/cpufrequtils ENABLE="true" GOVERNOR="ondemand" </code> == cpufreq-info == <code bash target> $ sudo service cpufrequtils restart $ cpufreq-info -o minimum CPU frequency - maximum CPU frequency - governor CPU 0 200000 kHz ( 13 %) - 1500000 kHz (100 %) - ondemand CPU 1 200000 kHz ( 13 %) - 1500000 kHz (100 %) - ondemand CPU 2 200000 kHz ( 13 %) - 1500000 kHz (100 %) - ondemand CPU 3 200000 kHz ( 13 %) - 1500000 kHz (100 %) - ondemand CPU 4 200000 kHz ( 10 %) - 2000000 kHz (100 %) - ondemand CPU 5 200000 kHz ( 10 %) - 2000000 kHz (100 %) - ondemand CPU 6 200000 kHz ( 10 %) - 2000000 kHz (100 %) - ondemand CPU 7 200000 kHz ( 10 %) - 2000000 kHz (100 %) - ondemand </code> === [Example] ODROID-C2 === == Available governor and cpu frequency sets == <code bash target> $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors hotplug interactive conservative ondemand userspace powersave performance </code> <code bash target> $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 100000 250000 500000 1000000 1296000 1536000 </code> == cpufrequtils option == <code bash target> $ sudo vi /etc/default/cpufrequtils ENABLE="true" GOVERNOR="performance" MAX_SPEED=1536000 MIN_SPEED=100000 </code> == cpufreq-info == <code bash target> $ sudo service cpufrequtils restart $ cpufreq-info -o minimum CPU frequency - maximum CPU frequency - governor CPU 0 100000 kHz ( 6 %) - 1536000 kHz (100 %) - performance CPU 1 100000 kHz ( 6 %) - 1536000 kHz (100 %) - performance CPU 2 100000 kHz ( 6 %) - 1536000 kHz (100 %) - performance CPU 3 100000 kHz ( 6 %) - 1536000 kHz (100 %) - performance </code> === [Example] ODROID-C1 === == Available governor and cpu frequency sets == <code bash target> $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors hotplug interactive conservative ondemand performance </code> <code bash target> $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 96000 192000 312000 408000 504000 600000 696000 816000 912000 1008000 1104000 1200000 1296000 1416000 1488000 1536000 1632000 1728000 1824000 </code> == cpufrequtils option == <code bash target> $ sudo vi /etc/default/cpufrequtils ENABLE="true" GOVERNOR="ondemand" MAX_SPEED=1824000 MIN_SPEED=100000 </code> == cpufreq-info == <code bash target> $ sudo service cpufrequtils restart $ cpufreq-info -o minimum CPU frequency - maximum CPU frequency - governor CPU 0 96000 kHz ( 5 %) - 1824000 kHz (100 %) - ondemand CPU 1 96000 kHz ( 5 %) - 1824000 kHz (100 %) - ondemand CPU 2 96000 kHz ( 5 %) - 1824000 kHz (100 %) - ondemand CPU 3 96000 kHz ( 5 %) - 1824000 kHz (100 %) - ondemand </code> odroid-xu4/application_note/software/cpufrequtils_cpufreq_govornor.txt Last modified: 2019/04/19 10:34by odroid