10 May 2011 16:49
TAGS: dev linux natty ubuntu vaio
As always, when a new Ubuntu release is done, I'm installing in onto my Sony Vaio SZ series laptop and experience some problems, that I later work on and finally fix.
To let others use this knowledge every half a year a note like this is written onto my blog.
Installation
You can read about installation LiveCD issues in a separate blog post. Let's concentrate on things specific to Sony Vaio (mostly the dual-graphics system we have from Sony).
Let's just say it's much better to install Ubuntu using the Intel graphics (the graphics-card switch in STAMINA position) card, since it's supported much much better by Linux.
Installing nVidia drivers
This should be easy, but is not due to a few glitches. Let's get through them step by step:
- Have the Ubuntu installed using Intel graphics card (STAMINA mode)
- Stop the laptop
- Put the graphics-mode switch to SPEED mode
- Start the laptop again
- Wait till you can log in
- Log in. You won't be able to use the Unity desktop, so classic Ubuntu desktop should be launched (if not, choose "Classic Ubuntu (no effects)" from drop-down list when logging in)
- Click System » Administration » Additional drivers
- Choose recommended driver and click enable. This will download and install the nVidia drivers for you.
- Don't reboot yet. You need to blacklist the nouveau driver (it's the open-source 3D nVidia driver attempt). Do this:
echo blacklist nouveau | sudo tee /etc/modprobe.d/blacklist-nv.conf - OK. Now you can reboot. The nvidia driver should kick in and you should have working Unity desktop
One more thing. Intel 3D drivers are now broken, so you won't have the Unity desktop working in there. Let's fix it!
Make 3D graphics (and Unity desktop) work in both Intel and nVidia
This is basically the same as explained in the previous post, but using separate script (so it's more elegant).
Create executable file /usr/local/bin/detect-gl :
sudo touch /usr/local/bin/detect-gl
sudo chmod +x /usr/local/bin/detect-gl
Edit it:
sudo gedit /usr/local/bin/detect-gl
Put the following into it:
#!/bin/bash
if ls -l /etc/alternatives/gl_conf | grep nvidia; then
link=nvidia
else
link=mesa
fi
if lspci | grep 'VGA compatible controller: nVidia Corporation'; then
hw=nvidia
else
hw=intel
fi
if [ "$link" = "nvidia" -a "$hw" = "intel" ]; then
update-alternatives --set gl_conf /usr/lib/mesa/ld.so.conf
ldconfig
killall Xorg
fi
if [ "$link" = "mesa" -a "$hw" = "nvidia" ]; then
update-alternatives --set gl_conf /usr/lib/nvidia-current/ld.so.conf
ldconfig
killall Xorg
fi
Call that script from /etc/rc.local (commands from this script are launched on each boot). Open file /etc/rc.local:
sudo gedit /etc/rc.local
before exit 0 line, put the following line:
/usr/local/bin/detect-gl
Your whole file should look more or less like this:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/local/bin/detect-gl
exit 0
This script will make sure the proper GL library is used for both graphics cards (Mesa lib for Intel, nVidia lib for nVidia card).
Fixing nVidia backlight issues
This is the most elegant solution I could think of. As the brightness settings almost work (when you press the Fn-F5, Fn-F6 keys, the notification appears and the bar shows you the backlight changes) we'll use D-Bus to listen for backlight change signal to set the backlight using nvclock command.
Install nvclock:
sudo apt-get install nvclock
Now create executable file:
sudo touch /usr/local/bin/nvidia-brightness-helper.py
sudo chmod +x /usr/local/bin/nvidia-brightness-helper.py
Edit it:
sudo gedit /usr/local/bin/nvidia-brightness-helper.py
Put the following into it:
#!/usr/bin/env python import dbus, gobject from subprocess import call from dbus.mainloop.glib import DBusGMainLoop def apply_brightness(new_brightness): if new_brightness < 15: new_brightness = 15 call(['nvclock', '-S', str(new_brightness)]) # only launch when nVidia is present if call(['bash', '-c', 'lspci | grep "VGA compatible controller: nVidia Corporation" 1>/dev/null']) == 0: dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() bus.add_signal_receiver(apply_brightness, dbus_interface="org.gnome.PowerManager.Backlight", signal_name="BrightnessChanged") loop = gobject.MainLoop() loop.run()
Now open your Startup programs configuration dialog and add the script to things started when you log in.
Fixing suspend
I must confess I haven't check the suspend without doing this but suspecting it IS broken like in was in Maverick, I've blacklisted the TPM modules by putting:
blacklist tpm
blacklist tpm_bios
blacklist tpm_tis
blacklist tpm_infineon
into /etc/modprobe.d/blacklist-tpm.conf file.
Poor 3D performance
When running Unity all the 3D games have poor performance. I found the easiest workaround is to log in into Classic Ubuntu (with no effects) desktop, which gives you standard GNOME with no compiz and nice 3D performance for launched apps.
Dual-screen issues
I'm using a dual-screen setup (laptop's LCD + external monitor connected via VGA port). The current version of Ubuntu has multiple issues with this, especially when aligning the screens in vertical (laptop's screen being the bottom one, big LCD the top one). The "dock" or "launcher" if you wish appears on the wrong screen (the small laptop instead of on the big screen). To fix this do this:
xrandr --output VGA1 --primary
Log out and in again after doing this. Launcher is on top screen now :-).
I found another irritating bug: when you plug in a big external monitor into the VGA port, the desktop automatically expands to both monitor (not a bug yet), but on one or both of them, some area is black, so you can't see the menus and windows. Logging out and in is also a workaround for this.
When you log in with an external monitor connected, the desktop is strangely stretched and has some artifacts. Interestingly taping Super button (to show the Ubuntu Dash) and Escape (to hide it) refreshes the screen and it looks OK then.
It's hard to put some windows on the bottom screen (your mouse pointer stops on the bottom of the top screen while dragging). You can move the windows even further down using Alt and dragging by window content (and not the title bar).
Once a window is on the bottom screen, trying to resize it crashes the application and it disappears… The workaround is to resize by holding Alt key and drag with middle mouse button.
Other issues
When using Intel graphics card and Unity, Adobe Flash movies (YouTube for example) shows some artifacts. From time to time they also crash the whole X session (I'm not sure why).
OK, this would be it. Hope this helps someone.
Thanks, I can now finally use just my integrated graphics. The backlight thingy with nvidia did definitely not work. My lenovo w520 keeps freezing with that.
@mths: it freezes when you call the nvclock, or when?
Piotr Gabryjeluk
visit my blog
You seem like the type of guy that would be using the terminal more often than not ;-)
But what is your opinion on the GUI changes, etc. in Ubuntu 11.04 ? Is it worth upgrading from 10.10 ?
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
11.04 is a massive GUI change — a revolution I would say (because of Unity). It's not as polished yet though. Still many programs miss a proper integration with the launcher and many key settings are hidden from the user, so I'm not totally convinced. They left huge room for improvements for 11.10 and unless you're impatient I would definitely wait will the next release. Also feel free to check the LiveCD and try it yourself :-).
Piotr Gabryjeluk
visit my blog
I was thinking about just upgrading my 10.10, rather than downloading the full LiveCD… thinking that would require a smaller download (?).
LiveCD is a good idea though, completely forgot about that. Let's me see everything I want without making any permanent changes.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
From my experience upgrading Ubuntu doesn't work really well (although it should work flawlessly in theory). I prefer installing a brand new system and then migrate the /etc parts that are essential for me and linking back my /home directory.
But as I do crazy stuff with my computer, maybe for regular users upgrade work just fine. Can't tell.
Piotr Gabryjeluk
visit my blog
Well upgrade from 10.04 -> 10.10 was easy, just a matter of installing updates. I can't speak for any previous versions, as I started with the 10.04 release.
So I was assuming it would be just as easy for 10.10 -> 11.04, but maybe that was asking too much :)
As for installing on a Mac… I've heard that it's possible but not exactly easy. So might as well stick with installing it on my regular notebook (currently dual-booting with Windows 7).
From the screenshots I've seen it looks like 11.04 basically has a Mac OS X dock / Windows 7 task-bar on the left of the screen now - which is a good thing.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I just updated from 10.10 > 11.04. Due to the age of my computer, Unity 3D didn't work. But because I have set auto-login on my previous installation, I had no option to login using Terminal or Ubuntu Classic. It took me at least 5 minutes of guessing where the log-off option was in the pull down because the screen was never drawn properly. In the end, I was able to use Terminal to install Unity 2D.
I'm just curious… Why hadn't they included Unity 2D with 11.04 as an automatic fallback option for bad graphic cards?
Kenneth Tsang (@jxeeno)
I have 11.04 now!
Manuals, User Guides Library: GuidesLIB.com
Top Manufacturers: JVC, Sony, Canon, etc.
Post preview:
Close preview