Ubuntu / Linux news and application reviews.

As you probably know, the Nvidia graphics drivers have received initial Optimus support a while back. Currently, the Nvidia GPU can be used to render the desktop, but there's no power saving yet. That means you can for instance play games or watch videos using hardware acceleration.

But to be able to take advantage of this feature in the latest Nvidia drivers, you need up-to-date dependencies (such as Randr 1.4, Xorg 1.13 - that's what the initial Nvidia release notes mention, but it seems you actually need 1.14 -, Linux Kernel 3.9 with some special flags enabled), as well as a custom xorg.conf file and some other bits.

That means that out of the box, the only Ubuntu version that can use this initial Optimus support in the Nvidia graphics drivers is Ubuntu 13.10 Saucy Salamander, but even in Saucy, you need to configure some things to get it to work.

If you're using Ubuntu 13.10 Saucy Salamander or newer, things got a lot easier and you don't need to configure anything to be able to take advantage of this Optimus feature in the Nvidia graphics drivers 319.12+: a package called "nvidia-prime", which comes with a set of tools that enable Nvidia's Prime on MUXless systems, has been uploaded to the Ubuntu 13.10 Saucy Salamander repositories about a month ago and it has currently reached version 0.4 (released today).

This package automatically checks if your system supports Nvidia Optimus and the required packages, creates the xorg.conf file and tweaks the LightDM configuration to support this.

In my test, I've installed the Nvidia 319.32 drivers and the "nvidia-prime" package (both from the Ubuntu 13.10 repositories) and after a reboot, the Nvidia card was used on my Optimus laptop (Dell XPS L702X):

Nvidia settings optimus
(Bumblebee was removed and as you can see, I didn't launch "nvidia-settings" using "optirun")

I was also able to play a h264 video using Mplayer with VDPAU (hardware acceleration):

Nvidia Optimus Prime VDPAU hardware acceleration mplayer Ubuntu

Nvidia Optimus VDPAU Ubuntu

glxspheres reports some insane framerates - this is most probably a bug, but here's a screenshot anyway:

Nvidia Optimus glxspheres

That's all nice, but there are some important issues I've encountered during my test (the issues are most probably in the Nvidia graphics drivers and not in the nvidia-prime package):
  • my laptop got pretty hot, especially when running glxspheres or playing a video using VDPAU;
  • Multiple monitors don't work out of the box; to enable multiple monitors, you need to edit the xorg.conf file, comment <Option "UseDisplayDevice" "none"> and add the devices sections as explained HERE;
  • this occurs sometimes: changing the theme from Ambiance to some other theme doesn't change the GTK theme (only the window borders changes) and GTK2 theming is broken so GTK2 apps used the ugly Windows 98-like fallback theme;

Install Nvidia-Prime in Ubuntu 13.10 or 14.04

Follow the instructions below only if you know what you're doing and how to revert the changes in case LightDM fails to start, etc.!

Update: the instructions below should work under Ubuntu 14.04 Trusty Tahr too.

Note: the  nvidia-prime package only supports the proprietary Nvidia drivers and won't work with Nouveau!

If you're using Ubuntu 13.10 Saucy Salamander or 14.04 Trusty Tahr and want to test the Optimus support in the Nvidia Graphics Drivers 319.12+, here's what you need to do:

1. Firstly, purge Bumblebee if installed:
sudo apt-get purge bumblebee*

Also, make sure libvdpau-va-gl1 is not enabled system-wide because it causes Nvidia Settings to crash on start - if it is, either disable it or simply remove the package:
sudo apt-get purge libvdpau-va-gl1

2. Install the proprietary Nvidia drivers and the Nvidia Prime package:
sudo apt-get install nvidia-319 nvidia-settings-319 nvidia-prime

3. Reboot the system.

That's it, after a reboot, your laptop should be using the Nvidia GPU to render the desktop.