Tuesday, July 3, 2012

Ubuntu 11.10 on Lenovo W520

At work, I got a new laptop -- a Lenovo W520. It came with Ubuntu 11.10 ("Oneiric Ocelot") pre-installed by the support team. My first impression was that it worked pretty well, but I quickly discovered that I couldn't change the brightness of the display through the Fn+Home/End keys.


The W520 uses this "Optimus" technology with an integrated on-board graphics card plus a separate NVIDIA card, where both cards can be switched on-the-fly -- on Windows. The default installation used the high performance card and I suspected that the video card driver was keeping me from adjusting the brightness. As it turns out, after switching to the on-board Intel card, things worked fine. Here's what I needed to do:


First, I needed to disable the NVIDIA card in "the BIOS" and switch to the on-board card. There's an option somewhere under "Setup", then "Display", if I recall correctly.


Next, I changed the video card section in my /etc/X11/xorg.conf to read this:


Section "Device"
  Identifier "Device0"
  Driver "intel"
  Option "Shadow" "True"
  Option "DRI" "True"
EndSection

In fact, I added the two Option lines later on and only changed the Driver line at first. I then discovered that most of the little try icons in the upper right corner of the Gnome desktop wouldn't show anymore. A look at /var/log/Xorg.0.log turned up some errors and running glxinfo yielded lines like these:


Xlib:  extension "GLX" missing on display ":0.0".

Luckily, someone else ran into the same issues over at http://theiszm.wordpress.com/2010/06/27/glx-missing-on-display/. As indicated there, I also ran these commands:


$ sudo apt-get purge nvidia*
$ sudo apt-get install --reinstall xserver-xorg-video-intel \
    libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
$ sudo dpkg-reconfigure xserver-xorg
$ sudo update-alternatives --remove gl_conf /usr/lib/nvidia-current/ld.so.conf

The first command hinted that some "ubuntu-desktop" package would also be removed. I don't know what that is, but I don't miss it, yet. Anyways, after a final reboot, the brightness adjustment now works and all my tray icons are back in place.

No comments: