Categories
Computers

Graphics Switching Returns

Within the past couple of days, the alternatives system for debian/wheezy has been updated to support nvidia again. That means it’s once again possible to graphics switch on the 1015PN. There are a few changes as packages have changed names and dependencies have changed as well. Details after the jump.

Here’s a list of the packages required to make it work:

  • nvidia-glx
  • xserver-xorg-video-nvidia
  • libgl1-nvidia-glx
  • nvidia-alternative
  • nvidia-kernel-dkms
  • libgl1-nvidia-alternatives
  • lib-glx-nvidia-alternatives
  • nvidia-kernel-common
  • glx-alternative-nvidia
  • glx-alternative-mesa
  • glx-diversions
  • nvidia-support

There’s a labrynthian mix of dependencies between these, so selecting just a few will likely bring along the others. All of these are installed on my machine at the moment and removing any of them broke the graphics switching. If anyone figures out a better way, I’m all ears, or err… eyes, since I’ll likely be reading instead of listening.

To support the Intel graphics, I believe all that’s necessary is xserver-xorg-video-intel. Or at least, that one will pull in whatever else is necessary.

Once all those are installed, the two scripts I use for switching are as follows:

For nvidia:

#! /bin/sh

if lsmod | grep -q acpi_call; then
    echo "acpi_call module already loaded"
else
    modprobe acpi_call
    sleep 2
fi

echo "\OSGS 0x02" > /proc/acpi/call
update-alternatives --set glx /usr/lib/nvidia
ldconfig
cp ~/xorg.conf.nvidia /etc/X11/xorg.conf
if [ $1 ]; then
    $1;
fi

For intel:

#! /bin/sh

if lsmod | grep -q acpi_call; then
    echo "acpi_call already loaded"
else
    modprobe acpi_call
    sleep 
fi

echo "\OSGS 0x01" > /proc/acpi/call
update-alternatives --set glx /usr/lib/mesa-diverted
ldconfig
cp ~/xorg.conf.intel /etc/X11/xorg.conf
if [ $1 ]; then 
    $1;
fi

The xorg.conf files from this post need no modification.

That should do it. The scripts can be invoked a couple of ways. By simply calling them, the system will be primed to boot into the appropriate mode the next time around. Conversely, a command such as halt or reboot can be added as an argument for immediate action.

4 replies on “Graphics Switching Returns”

Hi, thank’s for your work, before I read your post I use to switch lib with cp ^^, it’s much better with update-alternative.

I got one question, how do you get 8 hours of battery life, what are the conditions (wifi, brightness, … ) ? Did u optimize somethings ?

I’m interested about optimization, Currently I can only reach 6 hours without wifi and with low brightness.

Glad it helped.

The only thing I had to do was use low brightness settings.

Personally, I’m convinced not all battery packs are created equal. I’ve read others who only claim 6 hours or so after getting switching the graphics chip. So, I think my battery life was more attributable to luck (got one with a fresher battery pack to start).

I don’t get that much life anymore, less than 6 hours now with light browsing and mail usage. An unfortunate side effect of the heat when using graphics I suspect. Plus, I use it quite a bit.

Leave a Reply

Your email address will not be published. Required fields are marked *