View Single Post
Old 04-09-08, 03:03 PM   #5
shaundennie
Registered User
 
Join Date: Nov 2006
Posts: 79
Default Re: Alternative to PerfLevelSrc (specifically for 8400M GS)

I actually updated the script slightly. There was a bug when rebooting the computer because it wasn't creating the lock until an someone was logged in. The updated script is as follows:

Code:
#!/bin/bash
# A companion script to nvidia-power.sh that removes/adds the lock that
# tells the script whether or not it should force the card into it's highest
# frequency every 25 seconds.  Think of it as sort of a poor mans powermizer
# manager.
#
# Also, see the two comments marked OPTION if you wish to save more power
# using OnDemandVBlankInterrupts and compiz.
#
# On Ubuntu install this script with the following commands:
#
# sudo install 99-nvidia.sh /etc/acpi/start.d
# sudo install 99-nvidia.sh /etc/acpi/resume.d
# sudo install 99-nvidia.sh /etc/acpi/ac.d
# sudo install 99-nvidia.sh /etc/acpi/battery.d
#

if on_ac_power; then
  touch /tmp/nv-power-on
else
  rm -f /tmp/nv-power-on
fi

for x in /tmp/.X11-unix/*; do
	displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
	getXuser;
	if [ x"$XAUTHORITY" != x"" ]; then
	    export DISPLAY=":$displaynum"

        if on_ac_power; then
          # OPTION: Uncomment next line  to turn on compiz vsync when the 
          # laptop is plugged in
          # su $user -c "gconftool-2 --type boolean --set /apps/compiz/general/screen0/options/sync_to_vblank 1"
          su $user -c "nvidia-settings -q all > /dev/null"
        else
          # OPTION: Uncomment next line if you use compiz and have 
          # OnDemandVBlankInterrupts set to true in xorg.conf.  This will 
          # remove the ~60 wakeups a second that compiz causes the nvidia 
          # driver to do.
          # su $user -c "gconftool-2 --type boolean --set /apps/compiz/general/screen0/options/sync_to_vblank 0"
        fi
	fi
done
Unfortunately, I don't know if that is going to help you. I've only tested this on Ubuntu and don't know how the acpi subsystem works on other distros. If the script doesn't work, you should be able to create /etc/modprobe.d/options and use the PerfLevelSrc hack or, adapt the script to work properly for your distro.
shaundennie is offline   Reply With Quote