MrMEEE / ironhide

Optimus Support for Linux Through VirtualGL - PPA version also available: https://launchpad.net/~mj-casalogic/+archive/ironhide
http://www.martin-juhl.dk
88 stars 0 forks source link

Ironhide Performance dropped after upgrade from Ubuntu 11.04 > 11.10 #168

Closed ashon-ikon closed 12 years ago

ashon-ikon commented 12 years ago

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

~$ 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:

#!/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:

#!/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

#!/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
rockorequin commented 12 years ago

I don't think the performance and power issues are anything to do with ironhide - they are known issues in Oneiric and in the linux 3.0/3.1 kernels.

Re the performance issue, there are bugs logged about compiz/unity performance in Oneiric, eg https://bugs.launchpad.net/ubuntu/+source/unity/+bug/861061.

Re the power issue, google the following power-saving boot parameters (ie you can add them to /etc/default/grub's "GRUB_CMDLINE_LINUX" line and then run sudo update-grub and reboot to apply them):

ashon-ikon commented 12 years ago

I sincerely I apologise, I have not gotten much time to test all the options. I tried a few and they didn't appear to work.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="i915.i915_enable_rc6=1 pcie_aspm=force"

Sadly this is a development system and I barely have the luxury to shutdown often. I write codes on and off the road, so good battery life is slightly priced to me than performance. Hopefully someday I can go back to 11.04 LTS. Kernel 3 or Unity nor Gnome 3 is there yet for my enjoyment. Everything worked till 11.10. I don't know which distro to move to after 3years with Ubuntu. :(

Thanks greatly rockorequin.

Sincerely,

-iKON