MrMEEE/ironhide — Issue #168: Ironhide Performance dropped after upgrade from Ubuntu 11.04 > 11.10
Author: ashon-ikon
Created: 2011-11-08 04:04:08+00:00
State: open

After upgrade to Ubuntu 11.04 to 11.10, I began to sense
===============================================

* some fairly increased heat
* Lower battery life [from 6:45min approx to 4:40min max ]
* Windows reports 7hours on full charge. Ubuntu 11.10 reports 4:40min approx on full charge.
* More flickering in compiz [Not sure if this has everything to do with Unity/Gnome3 integration | flickering occurs most at the end of a '3D cube rotate' ]
* Touchpad freeze [This might be kernel related. "synclient TouchpadOff=0" fixes it from terminal for now ]

related info:
====================================
~$ sudo dmidecode -s system-product-name

U41SV

BASIC TROUBLESHOOTING
===============================

~$ sensors

acpitz-virtual-0
Adapter: Virtual device
temp1: +55.0°C (crit = +103.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0: +56.0°C (high = +86.0°C, crit = +100.0°C)
Core 0: +52.0°C (high = +86.0°C, crit = +100.0°C)
Core 1: +54.0°C (high = +86.0°C, crit = +100.0°C)

ENABLE DISABLE bash files...
======================================

:~$ grep rate /proc/acpi/battery/BAT0/state
present rate: 22708 mW

:~$ sudo ironhide-enablecard
DON Enabling nVidia card succeeded.

:~$ grep rate /proc/acpi/battery/BAT0/state
present rate: 30548 mW

:~$ sudo ironhide-disablecard
DOFF Disabling nVidia card succeeded.

:~$ grep rate /proc/acpi/battery/BAT0/state
present rate: 23184 mW

:~$ grep rate /proc/acpi/battery/BAT0/state
present rate: 23436 mW

*This suggests that the card switching works but it's still eats some battery. ANY HELP PROVIDED IS HIGHLY APPRECIATED. *

ironhide-enablecard:
=====================================
```bash
#!/bin/sh
# Power control for Asus U41SV Optimus
modprobe acpi_call
if ! lsmod | grep -q acpi_call; then
echo "Error: acpi_call module not loaded"
exit
fi

acpi_call () {
echo "$*" > /proc/acpi/call
result=$(cat /proc/acpi/call)
case "$result" in
Error*)
echo "Enabling nVidia card failed ($result)."
;;
*)
echo "Enabling nVidia card succeeded."
;;
esac
}
echo DON $(acpi_call "\_SB.PCI0.PEG0.GFX0.DON")

modprobe nvidia-current
```
ironhide-disablecard:
===================================
```bash
#!/bin/sh
# Power control for Asus U41SV Optimus
rmmod nvidia
if lsmod | grep -q nvidia; then
echo "Error: could not unload nvidia module, leaving card turned on"
exit
fi
modprobe acpi_call
if ! lsmod | grep -q acpi_call; then
echo "Error: acpi_call module not loaded"
exit
fi
acpi_call () {
echo "$*" > /proc/acpi/call
result=$(cat /proc/acpi/call)
case "$result" in
Error*)
echo "Disabling nVidia card failed ($result)."
;;
*)
echo "Disabling nVidia card succeeded."
;;
esac
}

echo DOFF $(acpi_call "\_SB.PCI0.PEG0.GFX0.DOFF")
```

Custom Switching Script
============
Whenever the fan blows too much I made a custom bash file to turn on and turn off the card which makes the card quieter

asusU41X.sh

```bash
#!/bin/sh
# Power control for Asus U41SV Optimus
if ! lsmod | grep -q acpi_call; then
echo "I: acpi_call module not loaded"
echo "I: loading acpi_call..."
echo result=$(modprobe acpi_call)
echo "I: Done loading acpi_call"
fi

acpi_call () {
echo "$*" > /proc/acpi/call
cat /proc/acpi/call
}

P=""
case "$1" in
off)
echo _DSM $(acpi_call "\_SB.PCI0.PEG0.GFX0._DSM" \
"{0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47," \
"0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0}" \
"0x100 0x1A {0x1,0x0,0x0,0x3}")
# ok to turn off: Buffer {0x59 0x0 0x0 0x11}
# is already off: Buffer {0x41 0x0 0x0 0x11}
echo _PS3 P=$(acpi_call "\_SB.PCI0.PEG0.GFX0._PS3");

case "$P" in
0x0)
echo "Asus U41SV Optimus appears to be ${P}";
;;
*)
echo "Error: '${P}'";
esac
;;
on)
echo _PS0 P=$(acpi_call "\_SB.PCI0.PEG0.GFX0._PS0")
;;
*)
echo "No input received. Assuming 'off'"
echo "Turning off nVidia Card..."
echo _DSM $(acpi_call "\_SB.PCI0.PEG0.GFX0._DSM" \
"{0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47," \
"0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0}" \
"0x100 0x1A {0x1,0x0,0x0,0x3}")
echo _PS3 P=$(acpi_call "\_SB.PCI0.PEG0.GFX0._PS3");
esac

echo P ${P}
#echo P3MO $(acpi_call "\_SB.PCI0.PEG0.GFX0.P3MO")
#echo DGPS $(acpi_call "\_SB.PCI0.PEG0.GFX0.DGPS")
#PSC=$(acpi_call "\_SB.PCI0.PEG0.GFX0._PSC")
#echo _PSC ${PSC}

case "$P" in
0x0)
PXX="on"
;;
0x3)
PXX="off"
;;
esac
```