Announcement

Collapse
No announcement yet.

AMD Phenom II C3 frequency scaling under Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AMD Phenom II C3 frequency scaling under Linux

    Hi,

    This is my first post on Phoronix. A quick introduction: I'm running a home Linux server 24/7 with openSUSE. Recently I upgraded to a 965 BE (C3 stepping) processor and I'm trying to get the most out of it. Performance wise, but also with the lease amount of power consumption as possible.

    I want to start this thread to discuss cpu frequency scaling issues (in combination with under/overvolting and underclocking/overvolting with the AMD Phenom II C3 stepping (because of the C1E hardware implementation and indepedent frequency scaling of the cores).

    My aim: lowest idle power consumption as possible, highest overclock when needed (without reboot).

    To give it a headstart, some of my findings:

    1) I see that the bogomips are not recalculated when doing a cat /proc/cpuinfo when a core is in a different powerstate - with my AMD 4850e it was... Does anybody know why?

    2) With k10ctl you can change the frequency and voltage of each core independently. It also support changing the NB voltage and divider. But according to an AMD whitepaper it cannot be changed after booting, behaviour after changing it anyway is unspecified. By the way I wrote a wrapper script for k10ctl.

    3) Tip: in a server you can clock the GPU speed and HT speed down to save some considerable amount of watts. All my BIOS setting (I've got an Asus M3A78 Pro) can be found here. It doesn't seem to affect harddisk throughput.

    4) Tip: you can use cpufreqd (this is a daemon that uses cpufreq) to set cpufreq governors on different conditions (eg. CPU load or a specific process that is running). You can even use scripts. I used it to overclock my system - with k10ctl - when mencoder is running.

    5) cpufreq speeds are not updated when overclocked or underclocked, until a core is disabled and enabled again.

    6) Disabling cores (from Linux or BIOS) does not improve power consumption, does anybody know why?

    Currently I'm running an underclock script for each multiplier to see what the lowest voltage is for each CPU frequency. Mail me if you want to try it yourself.

  • #2
    Real dynamic frequency scaling?

    I did some more tests. Currently I'm collecting the bottom voltages of each frequency with Cool n Quiet (CnQ) enabled. I found out that CnQ can lockup the system if the voltage is incremented with too great steps.

    From 800 MHz @ 0.775V (0.7V measured) to 3.2 GHz @ 1.275V (0.125V measured) will not work. Smaller increments are needed.

    My aim is to get my server running on anything beteen 400 and 4000 MHz, incrementing the frequency when needed, lowering when it's too hot, etc. I made a first start with cpufreqd, see my story.

    However, I'm now facing the problem when the voltage is bumped in too great steps. I'm thinking of these solutions.

    1. Stil use cpufreqd, but wrap k10ctl with a script and check if the voltage increment. If it is too big (I think > 0.1V?) that increment voltage and speed in steps
    2. Or writing a different governor (userspace or kernel space) that selects any frequency between 400 and 4000 MHz in 100 MHz steps (that's 36 P-states). Dunno if it's possible to have this much P-states. This will allow almost a full dynamical speed. So much P-states will probably slow things down, but I can always lower the number to an optimal (where voltage increments are within limits)

    I think I start with 1) to see if it solves my problems and to find the maximum voltage increments.

    Comment


    • #3
      I used cpufreq, cpufreqd, and k10ctl, wrote some scripts around it and have dynamic frequency scaling from anything between 800 and 4000 MHz.

      See this Youtube movie

      400 MHz is not stable and anything above 3800 MHz also seems to crash when running mprime, so for now I'm running 3400 MHz max. When using k10ctl to change frequencies the trick is don't take too large steps.

      I defines these 'meta P-states':
      Code:
      MP0	3400    3300    3200    3000 'Fast'
      MP1	3000	2800	2000	1000 'Allround'
      MP2	1000	1000	1000	800 'Powersave'
      I configured cpufreqd to use the 'Powersave' profile for cpu utilisation < 10%, using 'Allround' for 10-80% and 'Fast' for > 80%.

      When I increase the meta-P state I first lock to P0 (with cpufreq-set) then I increase the frequencies for P1-3. Then I lock to P3 and also increase the frequency for P0. After that I unlock all frequencies again.

      For anyone who is interested in my scripts, just mail me. More info on http://www.ruwebit.net/article/413

      Comment


      • #4
        thank you v much for sharing your AMD Dynamic Power Management experimentation user888. Might be handy for me to choose a new rig, preferably AMD based for a desktop system.

        It looks like one shouldn't bother getting lowest frequencies (like 800 or 400MHz at highest p-state), if I belive Arnawa Widagda Voltage Ramp And Power Consumption, Continued : Tuning Cool'n'Quiet: Maximize Power And Performance, Part 1 article: In his tests he couldn't get the Phenom II X4 945's idle consumption any lower under 2.5 GHz / 0.950V (74W).

        Comment


        • #5
          I've been using your scripts to experiment with overclocking a X3 720.
          This CPU overclocks fine using the BIOS at 3.4GHz with unchanged voltage.

          When using these scripts, or k10ctl alone, I can set the desired multiplier but I'm not able to use it:

          # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
          3400000 2800000 2000000 800000

          cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
          2800000

          # cpufreq-info
          cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
          Report errors and bugs to [email protected], please.
          analyzing CPU 0:
          driver: powernow-k8
          CPUs which run at the same hardware frequency: 0
          CPUs which need to have their frequency coordinated by software: 0
          maximum transition latency: 8.0 us.
          hardware limits: 800 MHz - 3.40 GHz
          available frequency steps: 3.40 GHz, 2.80 GHz, 2.00 GHz, 800 MHz
          available cpufreq governors: ondemand, userspace, performance
          current policy: frequency should be within 800 MHz and 2.80 GHz.
          The governor "ondemand" may decide which speed to use
          within this range.
          current CPU frequency is 2.80 GHz (asserted by call to hardware).
          cpufreq stats: 3.40 GHz:0.00%, 2.80 GHz:40.42%, 2.00 GHz:6.21%, 800 MHz:53.36% (63930)
          analyzing CPU 1:

          ...

          Any suggestions on how to use the overclocked frequency?

          Comment


          • #6
            Sorry for the late reply. I don't have time to go into details because I'm working on a different project. Good news is that my scripts are running stable for months now.

            Latest scripts can be found on http://www.ruwebit.net/archive/k10_scripts/ --- no support ;-)

            Voltages I found stable (for 965BE) (frequency mV) - note that swithing to 400 and 600 where NOT stable:

            # cat /var/ruwebit/k10_voltage_table
            400 750 # oc_tester.sh
            600 775
            800 775 # oc_tester.sh
            1000 900
            1200 925
            1400 925 # oc_tester.sh
            1600 975
            1800 1000
            2000 1025 # oc_tester.sh
            2200 1025
            2400 1050
            2600 1075 # oc_tester.sh
            2800 1125 # stable
            3000 1200 # stable
            3100 1200
            3200 1200 # oc_tester.sh
            3300 1250
            3400 1275 # oc_tester.sh
            #3600 1350 # oc_tester.sh
            3600 1400 # 1350 was NOT mprime stable!
            3800 1475 # for test with mprime
            3900 1500
            4000 1550

            I defined three 'meta' P-states with these frequencies (and voltages used from table above).

            cat /var/ruwebit/k10_meta_pstates
            0 3400 3300 3200 3000
            1 3000 2800 2000 1000
            2 1000 1000 1000 800

            Comment

            Working...
            X