Search This Blog

Monday, May 4, 2015

How to Install the latest Nvidia Driver in Ubuntu 14.04.2/14.10/15/04 via Bumblebee

How to Install the latest  Nvidia Driver in Ubuntu 14.04.2/14.10/15/04 via Bumblebee    

This is a followup post to one of my earlier posts which was appreciated by the community and I felt like I was able to help people with my work. I would like to carry on with this. I know for a fact that the only problem with installing Ubuntu on a Laptop with Optimus Nvidia Graphic Cards is that people get black screen after installing the Proprietary Nvidia Drivers. I would like to step up and be a source of help for Getting bumblebee installed and configured on these laptops so people could continue using Ubuntu.

OK first things first. If you want to understand how Bumblebee Works? How it handles the Hybrid Graphics? Please read this first.


This is my earlier blog post which provides some clarity on what Bumblebee is and how it works

Now lets get down to business. I am going to focus on getting the Latest Nvidia Driver 349.16 on Ubuntu 14.04 and later.

The official Repository of Ubuntu has only old and dated drivers. I don't use that myself and would suggest you do the same if you want the latest Nvidia Driver without any problems.

Steps:-

1) First step after installing Ubuntu is to install all updates. You may use the software updater or simply run sudo apt-get update && sudo apt-get upgrade

2) Add the Xorg-edgers ppa using

sudo apt-add-repository ppa:xorg-edgers/ppa and then sudo apt-get update

Update :- There is just one more PPA which you need to add to get the Nvidia-Drivers now.

ppa:graphics-drivers/ppa, Please add this PPA as well only then will you be able to install latest Nvidia Drivers.
 
3) Run sudo apt-get upgrade && sudo apt-get dist-upgrade

This is the most Important step. If you miss this you will see a black screen after reboot. Please do this as we are using the xorg-edgers ppa. We need to ensure all packages required for bumblebee and nvidia are taken from the ppa.

4) Now Install bumblebee and Nvidia drivers using

sudo apt-get install bumblebee bumblebee-nvidia primus nvidia-349

5) Add the current user to the bumblebee security group.

sudo gpasswd -a $USER bumblebee

for Ubuntu 15.04 only you need to manually enable to bumblebee daemon using

sudo systemctl enable bumblebeed

6) This will take care of the Installing the required software on your system. We need to configure it.

I can assure you if you followed these steps so far then configuring should be a breeze.

We start by enabling bbswitch and intel i915 Driver.

7) sudo gedit /etc/modules 

Ubuntu 15.04 the file is /etc/modules-load.d/modules.conf

add these two lines to it

i915
bbswitch

8) Edit the bumblebee configuration file.
sudo gedit /etc/bumblebee/bumblebee.conf

1. line 22:

Driver=nvidia

2. line 55:

KernelDriver=nvidia-349

3. line 58:

LibraryPath=/usr/lib/nvidia-349:/usr/lib32/nvidia-349

4. line 61:

XorgModulePath=/usr/lib/nvidia-349/xorg,/usr/lib/xorg/modules

In addition to this there is another file that needs to edited.

9) sudo gedit /etc/modprobe.d/bumblebee.conf

Add the below lines to end.

#349
blacklist nvidia-349

Now you may reboot. After reboot.

Check using

sudo apt-get install mesa-utils if mesa-utils is not already installed.

primusrun glxinfo | grep OpenGL

This should tell you that nvidia-349.16 driver in use.
Please note that nvidia-349 is the latest driver at the time of writng this. Please check the launchpad page for xorg-edgers ppa an accordingly replace nvidia-349 with the latest version if any.

Let me know if this works for you.