Remastersys and AVLinux Forum
May 25, 2013, 04:55:39 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Remastersys depends on user donations to survive.  Please help keep Remastersys going.

http://www.remastersys.com
 
   Home   Remastersys Home Remastersys downloads Donate Login Register AV LINUX Home Help Search  
Pages: [1]
  Print  
Author Topic: HowTO: Set 'performance' as the default CPU Governor  (Read 10857 times)
0 Members and 3 Guests are viewing this topic.
GMaq
Administrator
Hero Member
*****
Offline Offline

Posts: 2164


A/V 'Nixer


WWW
« on: February 13, 2011, 02:52:38 PM »

Hi

Although many people with newer multicore CPU's may find that CPU governing has no adverse effect on Audio performance, others may want to ensure that they are getting full performance from their CPU's. We can tell the system what default governor to use by specifying it in /etc/default/ by creating a 'cpufrequtils' configuration file.

From a Root Terminal do this:
Code:
gedit /etc/default/cpufrequtils

This will open and create a blank text file called 'cpufrequtils'.

Now copy and paste the following text into the blank cpufrequtils file and save it:

Code:
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="0"
MIN_SPEED="0"

Now reboot and 'performance' will be the default CPU governor that the system boots with.
Logged

AV Linux, Proudly created with Remastersys: http://www.bandshed.net/AVLinux.html
danboid
Full Member
***
Offline Offline

Posts: 46


« Reply #1 on: March 17, 2011, 04:41:28 AM »

With any luck we won't need this HOWTO when AV5 is released but I'm not having much luck with this under 4.2 on my AMD Turion(tm) 64 X2 Mobile TL-58 laptop here- not sure what I should be expecting but I've followed the guide above but the output of:

Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Periodically comes back with 'performance' but most of the time it says 'powersave'. On top of that I've also added the lines

Code:
devices/system/cpu/cpu0/cpufreq/scaling_governor = performance
devices/system/cpu/cpu1/cpufreq/scaling_governor = performance

to /etc/sysfs.conf (after installing sysfsutils) but I'm still on 'powersave' mode mostly- even though I have my laptop plugged into mains. Should laptop users expect their CPU to revert to powersave with these settings in place and being plugged into the mains? When plugged into the mains I'd like it to always be in performance mode and so thats what I was expecting to see after following the above instructions, which I have seen recommended on other sites too.

Another aspect to consider in all this thats not covered is what daemons should/should not be loaded at boot for this configuration to work? I know having 'ondemand' enabled (if available) can cause problems for a start.
« Last Edit: March 17, 2011, 04:44:33 AM by danboid » Logged
GMaq
Administrator
Hero Member
*****
Offline Offline

Posts: 2164


A/V 'Nixer


WWW
« Reply #2 on: March 17, 2011, 11:10:12 AM »

Hmmm,

On a CoreDuo and Q6600 Quad here the instructions above are working every boot, plugged in or not, I wonder if AMD doesn't use the generic acpi-cpufreq governor and uses something AMD specific. Can you manually change the setting using these commands? :

For a single core or core 1 of a multicore:
Code:
cpufreq-set -c 0 -g performance

For a second core (ie a CoreDuo):
Code:
cpufreq-set -c 1 -g performance

Obviously for more that 2 cores just up the '-c #' until all desired cores are set

You can check the output of your CPU info with this command in a regular terminal:
Code:
cpufreq-info

You can check the driver the CPU is using with this command in a regular terminal:
Code:
cpufreq-info -d

I also have removed 'cpudyn' from AV Linux 5.0 but that shouldn't really affect your issue. What are the permissions on your /etc/default/cpufrequtils file? mine are root::root. Some things to try anyway...

« Last Edit: March 18, 2011, 10:15:23 AM by GMaq » Logged

AV Linux, Proudly created with Remastersys: http://www.bandshed.net/AVLinux.html
danboid
Full Member
***
Offline Offline

Posts: 46


« Reply #3 on: March 18, 2011, 05:51:39 AM »

If I issue the two cpufreq-set commands (for both my CPUs) as root then cpufreq-info it alternately reports both :

current policy: frequency should be within 800 MHz and 1.90 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.

then if you issue the same command immediately after you will either get the same message or just as likely

current policy: frequency should be within 800 MHz and 1.90 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.

Its constantly switching between the two governors which says to me its actually still in powersave and not performance mode as I'd expect performance mode to keep the cpu at full throttle all the time.

/etc/default/cpufrequtils is set root:root here too. If I make any discoveries wrt to the mysteries of AMD Linux power management I'll update this thread.
Logged
trulan
Global Moderator
Hero Member
*****
Offline Offline

Posts: 855


« Reply #4 on: June 14, 2011, 06:34:16 AM »

AVLinux 5.0 includes a CPU frequency scaling applet in the system tray, called trayfreq.  To set the CPU governor, simply right-click the applet and choose the desired governor or frequency.

To set the default governor for the system to use at boot, edit (as root) /usr/share/trayfreq/trayfreq.config.  Uncomment the lines you want to use.  For example, the default trayfreq.config looks like this:
Code:
#[battery]
#show=1
#governor=powersave
#[ac]
#governor=ondemand
#[events]
#activate=/usr/bin/xterm
#[governor]
#default=ondemand
#[frequency]
#default=800000
To hide the battery indicator and make the system boot with the CPU governor set to performance, you would edit it like this:
Code:
[battery]
show=0
#governor=powersave
#[ac]
#governor=ondemand
#[events]
#activate=/usr/bin/xterm
[governor]
default=performance
#[frequency]
#default=800000
For more info, see this page:
https://wiki.archlinux.org/index.php/Trayfreq#Trayfreq_Setup
« Last Edit: June 20, 2011, 05:52:05 PM by trulan » Logged
varpa
Hero Member
*****
Offline Offline

Posts: 336


« Reply #5 on: August 26, 2011, 03:42:27 PM »

Is there a command line command which an ordinary user can use to set the CPU governor?   I suppose cpufreq-set might be possible, but it seems to require root privileges.   I'd like to put this command in a Qjackctl start-up script to switch to performance when I start Jack.   The tray applet is great, but it always nice top automate configuration if possible.
Logged
trulan
Global Moderator
Hero Member
*****
Offline Offline

Posts: 855


« Reply #6 on: August 29, 2011, 08:28:32 PM »

Setting cpu frequency is going to require root privileges no matter how you slice it (the applet uses a setuid bit or whatever it is properly called).  You could control the scaling with a script in qjackctl (I did it this way for a while in Ubuntu), but then you need to enter your root password every time you start jack, which is more of a pain than clicking on the applet IMO, though that would be automated.

I did see some talk a few months ago about a cpu scaling daemon being designed for use with jack (one that ramped up the speed at a much lighter load, and held it higher for a longer period of time), I should dig that up again and see if it is in a usable state currently.  If that concept could be combined with the trayfreq applet, that would be ultra-cool.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!