← Back to team overview

hybrid-graphics-linux team mailing list archive

Re: asus-switcheroo

 

On Mon, Apr 18, 2011 at 9:12 PM, Jorge Sousa <jorge.msl.sousa@xxxxxxxxx> wrote:
> Working great in ASUS N82JV. Core i5 / nvidia GT 335M. Kernel 2.6.38. Arch
> Linux.
> In fact, for some reason, it's working better than the old acpi call method,
> in the sense that power usage is slightly lower about 1-2W when idle
> (getting as low as 10W, when 12W was the norm). Congrats

Great!  Thanks for the report

> However, there is one issue. What version of upower are you guys using?

I don't use upower.

> version 0.9.8 (20/01/2011) and 0.9.9 (testing in Arch Linux) have problems
> with this. I need to blacklist the driver and use the old acpi call method
> (since switcheroo only works with the driver loaded).

You might be able to take a page from the nvidia support hack in
asus-switcheroo.  If you load asus-switcheroo with the dummy-client=1
option, you don't need nouveau.  Then you can echo ON/OFF to the
vgaswitcheroo/switch file.  I don't know if the power saving is as
good as when the nouveau driver does it, but I can definitely tell a
difference in watching the battery stats.  If you don't need/want
nouveau, you don't have to go through all the hassle of loading
asus-switcheroo in the initramfs and making sure it gets loaded before
nouveau.  You can load it much later in init for that.

> The problem is documented here and here (timing fits the timeframe for
> 0.9.8) and consists on upowerd going berserk, sucking 100% of CPU, and it
> happens with either the old or this new method.
> version 0.9.7 works fine, though.
> Since it happens with both methods, the problem should lie in upower.

Perhaps it sees nouveau is loaded and tries to interact with it while
it's powered off.

> Below are the instructions for Arch Linux

Thanks for the Arch instructions, I'll add them to the tree.

Alex

> This isn't ideal though.
> First,
> The equivalent to
>>
>> # fedora
>> install -m 0644 asus-switcheroo.conf-dracut
>> /etc/dracut.conf.d/asus-switcheroo.conf
>
> and
>>
>> # ubuntu
>>
>> sed -i -e "/asus-switcheroo/D" /etc/initramfs-tools/modules
>> echo asus-switcheroo >> /etc/initramfs-tools/modules
>
> is to add asus-switcheroo to the modules line in /etc/rc.conf
> Another tricky part,
> Possible, but bit hard to translate it to sed, since the relevant line
> content varies from user to user and the order of the items may or may not
> be important. Anyway, sed's command would be:
>>
>> sed -i -e "s/MODULES=(/MODULES=(asus-switcheroo /" /etc/rc.conf
>
> About the last two commands: Arch Linux doesn't name /boot/*.img by uname
> -r. Instead, it uses kernel26 for the official kernel, kernel26-lts for the
> official long term release and kernel26-whatever, for custom kernels
> available in AUR. This means these two lines won't apply to everyone:
>>
>> cp /boot/kernel26.img /boot/kernel26.img.bak
>> mkinitcpio -p kernel26
>
> Here is the Makefile order (changes in bold):
>>
>> install-arch:
>>         install -m 0644 -D asus-switcheroo.ko /lib/modules/$(uname
>> -r)/extra/asus-switcheroo/asus-switcheroo.ko
>>         depmod -a
>>         install -m 0755 asus-switcheroo-pm
>> /etc/pm/sleep.d/75-asus-switcheroo-pm
>>         install -m 0644 asus-switcheroo.conf-modprobe.d
>> /etc/modprobe.d/asus-switcheroo.conf
>>         sed -i -e "s/MODULES=(/MODULES=(asus-switcheroo /" /etc/rc.conf
>>         cp /boot/kernel26.img /boot/kernel26.img.bak
>>         mkinitcpio -p kernel26
>
> Jorge


References