Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu 10.10 64bit on a system with an AMD Phenom II X2 550 CPU overclocked to 3.5ghz (from the default 3.1ghz).

When I perform an Xvid encode using k9copy/mencoder and check the speed of the CPU using cat /proc/cpuinfo, neither of the cores ever seem to go above 2400mhz (sometimes less due to AMD Cool'n'Quiet).

Assuming this is the true speed, how do I ensure that the processor operates at full speed when performing a CPU intensive task such as encoding video?

Edit - some further info below:

william@optimus:/usr/bin$ sudo dmesg | grep "powernow"
[    0.985857] powernow-k8: Found 1 AMD Phenom(tm) II X2 550 Processor (2 cpu cores) (version 2.20.00)
[    0.985885] powernow-k8:    0 : pstate 0 (3500 MHz)
[    0.985886] powernow-k8:    1 : pstate 1 (2400 MHz)
[    0.985887] powernow-k8:    2 : pstate 2 (1900 MHz)
[    0.985888] powernow-k8:    3 : pstate 3 (800 MHz)

william@optimus:/usr/bin$ sudo dmidecode | grep "Max Speed"
    Max Speed: 3200 MHz
william@optimus:/sys/devices/system/cpu/cpu0/cpufreq/ondemand$ cpufreq-info
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, 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.50 GHz
  available frequency steps: 3.50 GHz, 2.40 GHz, 1.90 GHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 3.10 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz.
  cpufreq stats: 3.50 GHz:0.00%, 2.40 GHz:5.63%, 1.90 GHz:1.63%, 800 MHz:92.74%  (109352)
analyzing CPU 1:
  driver: powernow-k8
  CPUs which run at the same hardware frequency: 1
  CPUs which need to have their frequency coordinated by software: 1
  maximum transition latency: 8.0 us.
  hardware limits: 800 MHz - 3.50 GHz
  available frequency steps: 3.50 GHz, 2.40 GHz, 1.90 GHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 3.10 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz.
  cpufreq stats: 3.50 GHz:0.00%, 2.40 GHz:8.58%, 1.90 GHz:2.47%, 800 MHz:88.95%  (76452)
share|improve this question
    
I'm not sure, but is it possible that the de/recoders actually tries to use your GPU instead, thous unloading the CPU..? –  Source Lab Oct 25 '10 at 21:09
    
Thanks, but it seems that this is not the cause as even using cpuburn never pushes either core past 2400mhz. –  William Lannen Oct 26 '10 at 7:28

2 Answers 2

up vote 1 down vote accepted

It's likely your CPU scaling governor is set to "ondemand" (you can check by looking at /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor). Similarly, you can check scaling speeds by comparing /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq and /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq.

The "ondemand" frequency scaler is not great for some workloads, and I've found encoding to be one of those. The are a number of tunables in /sys/devices/system/cpu/cpu0/cpufreq/ondemand that may help, especially the up_threshold. For one machine, I set this to 20 and that seemed to help.

In a more extreme case, you can replace the frequency scaler with "performance" which will force maximum CPU frequency:

for i in /sys/devices/system/cpu/cpu*; do echo performance | sudo tee $i/cpufreq/scaling_governor; done
share|improve this answer
    
Thanks for that. It's very strange, even if I set the frequency scaler to "performance", both cores simply max out at 2400mhz. I've added the output from cpufreq-info to the end of my question, which seems to suggest that the system is aware that the CPU can go to 3.1ghz/3.5ghz. –  William Lannen Oct 25 '10 at 21:56
    
Ah, I've now clocked the CPU back down to the default 3.1ghz in the BIOS and it now seems to operate correctly (i.e. maxes out at 3100mhz when required). Not massively bothered about the extra 400mhz so that will do me for now :) –  William Lannen Oct 26 '10 at 7:30

Disabling Cool'n'Quiet in your Bios will always make sure your CPU runs at the maximum frequency also. But if you trying to save power then you might want to keep it on.

share|improve this answer
    
Thanks. As you say, that does work but I would ideally like to keep it on for the power saving. –  William Lannen Oct 26 '10 at 7:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.