Thursday, November 25, 2010

Ubuntu - Set CPU Frequency

  1. Find supported frequencies
    1. cat /sys/devices/system/cpu/cpu/cpufreq/scaling_available_frequencies
      1. Examples:
        1.  cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
        2. cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_available_frequencies 
  2. Display your current set frequencies
    1. grep MHz /proc/cpuinfo
  3. Set the freqency
    1. cpufreq-selector -c -f
      1. For example:
        1. cpufreq-selector -c 0 -f 2401000
        2. cpufreq-selector -c 1 -f 2401000
  4. Your max speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq.
    # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
    700000
    Your min speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq.
    # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
    500000
    If you are using the userspace governor, you can write to /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed to change the current speed.
    # echo 700000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
    # cat /proc/cpuinfo
    cpu MHz  : 697.252
    # echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
    # cat /proc/cpuinfo
    cpu MHz  : 976.152

No comments: