Ubuntu 14.04: Hybrid Graphics

This is part of my series on installing Ubuntu 14.04 on my laptop.  In the previous post, I worked through installing Virtualbox for VMs.  In this post, I am working through installing the video drivers for optimal use of the video cards.  My laptop has a hybrid graphics card, so I attempted to use Nvidia Prime.  When that didn’t work, I dropped back to Bumblebee.

Just so you can see what I have, I looked in lspci.  Here’s the Nvidia controller:

01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 650M] (rev a1)

Here’s the Intel controller:

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)

 

Here’s what I did…

Activating Nvidia Prime

First, I tried the Nvidia option in “Additional Drivers”.  Additional Drivers is now in the Software & Updates program.

Enabling NVidia in Software & Updates

I was very surprised that it didn’t make me reboot, but I did it anyway.  After applying this change, I could confirm that NVidia Prime was installed by opening the Nvidia Settings program.  It has an option to switch between the two cards:

NVIDIA X Server Settings

I was a little disappointed in that I couldn’t switch on the fly.  I wants me to log out and back in, which means closing all my applications.

Log out dialog for switching modes

After installing this though, I started to notice the system freezing.  I could unfreeze it by pressing Ctrl+Alt+F6.  That would take me out to the command-line.  Then, I could go back to GUI with Alt+F7.  So far, it seems to be only when I am in NVIDIA (Performance Mode).

Prime Indicator

Next, I saw this indicator that makes switching back and forth very easy.  So, I thought that I would give it a try.  Here are the commands to install it:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install mesa-utils prime-indicator

After that, I had to log out and back in again to get the indicator to show up.  When I hadn’t installed the mesa-utils package, it looked like this:

Nvidia Indicator without mesa-utils

With mesa-utils, it displayed the current graphics card that was enabled.

Switching graphics cards

 

The worst part about the whole thing is that it requires restarting the X Server, which means logging out and logging back in again.  This kills any applications that you have running and aborts any Virtualbox machines that you have running.

Nvidia Prime X Server Restart

 

Switch Issue

I ran into this issue with switching to the Nvidia processor.  It’s almost exactly like this post on Ask Ubuntu.

Graphics Card Switch Error

To fix it, I reinstalled Nvidia Prime:

sudo apt-get purge libvdpau-va-gl1 bumblebee* nvidia*
sudo apt-get install nvidia-331 nvidia-settings nvidia-prime

I restarted to make sure that it took effect.  After that, I got back on the Nvidia driver.

Installing Bumblebee

Nvidia Prime is still not for me.  I still get the screen freezes.  I don’t like having to reboot or at least close everything and log back in.  So, I uninstalled Prime and installed Bumblebee…

sudo apt-get purge libvdpau-va-gl1 bumblebee* nvidia*
sudo apt-get install bumblebee bumblebee-nvidia primus nvidia-331

Then, I installed Bumblebee GUI:

sudo apt-get install python-appindicator
sudo apt-get install git
cd ~/Downloads/
mkdir bumblebee-gui-workdir
cd bumblebee-gui-workdir
git clone https://github.com/Bumblebee-Project/bumblebee-ui.git
cd bumblebee-ui
sudo ./INSTALL

After that, I rebooted.

To make the indicator automatically start, I added bumblebee-indicator to the startup applications.

Auto-starting bumblebee indicator

 

In addition, the icons had an issue.  I manually copied them to the ~/.icons directory:

 mkdir ~/.icons
cp ~/Downloads/bumblebee-gui-workdir/bumblebee-ui/icons/* ~/.icons

After that it worked.  It’s just that the performance was horrible.  I’ll have to figure that out at some point.  If you know how to fix it, please comment below.

Performance

So, I ran a test using glxgears (out of the mesa-utils package), and I get about 60 FPS on the Intel card:

glxgears on the Intel card

 

On the Nvidia graphics card, I was getting around 9800 FPS:

Nvidia card glxgears

 

Here’s the performance with Bumblebee.  You’ll notice that with and without “optirun” in front that it is getting about 60 FPS:

Bumblebee Performance

 

Next Steps

If you are following along with my series, you can proceed to the next post about miscellaneous settings and utilities.  Or, you can look at the list of install posts in the series.

Resources

Leave a Comment

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