Getting Optimus in Debian (kernel 3.1.0) with developer drivers a story of struggle

I wanted to share my experience which may be helpful for others like myself. My goal was to install the development drivers on my Debian laptop ASUS N53SN-SZ129V with a Geforce GT 550m with Optimus support. Details are like so:

lspci |grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: nVidia Corporation Device 0df6 (rev a1)

I installed the stable version of Debian and eventually upgraded to sid by altering the /etc/apt/sources.list file and doing a aptitude update, aptitude dist-upgrade sequence.

Next I installed the debumblebee which is a very nice toolkit doing most of the job. Basically once you have Debian sid installed, you should run the ./install.sh script and most of the job is done. Kudos to Igor Urazov. Note that my system required me to install lsb (aptitude install lsb) before a sucessful run of the script.

debumblebee will install the standard drivers and amazingly it will work. You can test this after you reboot, with the following commands

glxgears -info

will run glxgears with the on board GMA graphics chip.

optirun glxgears -info

will run glxgears with the mighty GT 550m. This is a very neat trick which involves running two separate Xorg instances. One for the GMA (:0) and one for the GT 550m (:8). You can check this by inspecting the /var/log/Xorg.0.log and /var/log/Xorg.8.log log files. You should see the correct version of drivers running with a line like so in Xorg.8.log file:

NVIDIA dlloader X Driver XXX.XX.XX

Now the thing to note here is that this is not the development driver. To install the development drivers you should fetch the 4.1 RC development drivers. Note that 4.0 development driver will not work out of the box with kernel > 3. There are several reasons most important one I could find was ABI version conflicts.

Once you run the devdriver_4.1_linux_64_285.05.15.run file you will get development drivers installed on your system. Make sure you have correct linux-headers package installed before you try to install the driver.

The last step is to fix the debumblebee installation which was broken by the devdriver installation. To do that I used the following method:

aptitude reinstall xserver-xorg-core

This will get the GMA’s libglx (/usr/local/lib/debumblebee/libglx.so) back in place. Next we must provide the correct libglx to the Nvidia Xorg instance:

ln -s /usr/lib/xorg/modules/extensions/libglx.so.285.05.15 /usr/local/lib/debumblebee/libglx.so

After you restart the Xorg servers

/etc/xdm/restart

(xdm may be gdm or kdm depending on your window manager choice) you should have access to both GMA and GT 550m.

Note that there is nothing specific to GT 550m, so this method should work for other Optimus systems as well.

If you still can not get your fans to stop, then the problem may be the currently incomplete support for the Intel’s Sandy Bridge framework available on Core i3/i5/i7 processors. The problem is more specifically related with the ASPM (Active State Power Management). There appears to be patches going into the 3.3 kernel to solve these issues. However given even 3.2 is not released yet, it may take some time to get this hold of this kernel officially.

If you do not want to wait, you can use the pointers I received from Igor Urazov.

3.1 kernel including some ASPM patches: http://liquorix.net/

Some kernel parameters which may help: http://techpatterns.com/forums/about1963.html

Using these I have achieved following stats, which I think is impressive on a 15.6", Core i7 platform.

Wireless off
Brightness low
System idle
Battery consumption: 9 W

Wireless off
Brightness low
System: playing mp3, browsing pdf file on Google Chrome
Battery consumption: 12 W

If I enable the mighty GT 550m with wireless on consumption hits 40 Watts! If you want to save power do not forget to turn it off. If you ctrl+C out of your applications, optirun may not be able to run the disabling commands. In such case use the disablecard command available after you install debumblebee.

You can use procmeter3 or powertop to watch your battery consumption. Note that you must be running on batteries to read this value.

ASPM support in kernel 3.2-rc6! Just grab the kernel from kernel.org and compile it for your distribution. Without any fiddling I got my fans stopped using this kernel!