Ubuntu – Laptop Nvidia Bumblebee clarification

bumblebeedriverslaptopnvidianvidia-optimus

So this is partly clarification (to help future users) and partly questions to make sure I understand what's going on.

Recently attempted to make the switch from MacOSX to Ubuntu as I can't afford Mac hardware for my purposes (using Blender 3d open source graphics program). I'm selling my Macbook Pro & have bought an Optimus IV custom build laptop with integrated Intel graphics & an Nvidia GTX660M, i7 etc. After fruitless DAYS trying to successfully install Nvidia drivers on a clean install of 12.04 using all methods I could find I decided I'm not savvy enough for Ubuntu to be my primary OS for my work and couldnt risk it (using 'Blender').

New plan, 2 hard drives;

1st SSD for Windows 7 upon which I'll be running my work (Blender) exclusively & thus reliably

2nd HDD for Ubuntu, it looks like a great OS that I'm keen to learn & get to grips with for the future and I'll be using it for 'everything else' docs, file management and so forth. Would still like to get the graphics to work on it though.

Today I clean installed 13.04 (I thought as it's newer, Nvidia might play nicer). No proprietary drivers have ever been recognised by Ubuntu on either 12.04 or 13.04. I take it that Ubuntu isn't recognising my Nvidia card natively..

After reading this very informative article on Nvidia drivers, I first tried installing Bumblebee and things for the first time seem to be working, – I can 'switch my Nvidia card on':

Now when I run glxspheres I get a framerate of ~60fps (intel Ivybridge Mobile)
When I optirun glxspheres I get a framerate of ~120fps – OpenGL renderer (GTX660M/PCIe/SSE2)
The instructions seem to be that, whenever I wish to enable my Nvidia GLU for increased performance, enter terminal & type eg optirun chrome, or optirun blender etc. depending on which application I'd like to make use of it..

Great.

My questions now:

  1. Do I need to 'switch it off' afterwards, or just exit the application?

  2. I don't play computer games. Since I'm going to be using my Windows OS & SSD for running Blender and video editing (as I can rely on it) which applications would you recommend I use the optirun command for in Ubuntu? Watching youtube videos? Watching VLC videos? Streaming from Ubuntu via HDMI to my TV? Or is the Intel integrated GLU capable of comfortably dealing with those? Even if the Intel is capable will the Nvidia GPU give a better performance?

  3. When I installed Bumblebee did this automatically install Nvidia drivers or is running 'optirun' switching between Intel drivers and Nouveau drivers?

  4. If switching to Nouveau, I'd like it to download and enable Nvidia drivers for better performance. I've tried to see which Nvidia driver is recommended for my card as advised in the article above using:

ubuntu-drivers devices

ubuntu-drivers devices | grep recommended
however nothing comes up..

From reading, looks like I need to run:

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates  
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nvidia-319  (I've read this is a good package for the 600 series cards). 

I think something that's confusing about Ubuntu are that there seem to be 5 ways to do the same thing, I've seen commands that recommend 'install nvidia-current' etc & that this will automatically pick the best drivers for you, seems to be a lot of conflicting information.

Seems like I can install primus according to this article
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get update
sudo apt-get install primus
sudo apt-get install primus-libs-ia32:i386

However what's confusing here is that my Terminal, when installing Bumblebee, also instructed me to change the bumblebee.conf

  1. Why?

A lot of real basics I'm trying to understand here, your patience is much appreciated.
Laptop Nvidia drivers Bumblebee Optimus Primus

Best Answer

  1. It depends on how have you configured Bumblebee. If you open /etc/bumblebee/bumblebee.conf you will see the following option:

    TurnCardOffAtExit=true
    

    Depending if it is true or false, Bumblebee will turn off the card for you after optirun finishes or not.

  2. It depends if your applications use or not the GPU. In my system the discrete card is enough to play 1080p videos and use HDMI, so I really only use it for games.

  3. When you installed Bumblebee it should have installed bumblebee-nvidia, which if I'm not wrong will install nvidia-current. You can check which nVidia packages you have installed with dpkg --get-selections | grep nvidia.

  4. That's the strength of opensource: you have N ways to do something, and if you don't like any probably you are able to make your own way :) . In regard the driver, I would say the best is the one that is more recent and works (this may not always be true). So you can try each one and see which works the best.

  5. If you read that file you will understand why. There are many options that you need to specify (ex: which driver to use, make Bumblebee turn card off or not, what Bumblebee should do if anything fails, etc)that Bumblebee can not guess by itself. For example, take this section from that file:

    [driver-nvidia]
    # Module name to load, defaults to Driver if empty or unset
    KernelDriver=nvidia-current
    PMMethod=auto
    # colon-separated path to the nvidia libraries
    LibraryPath=/usr/lib/nvidia-current:/usr/lib32/nvidia-current
    # comma-separated path of the directory containing nvidia_drv.so and the
    # default Xorg modules path
    XorgModulePath=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules
    XorgConfFile=/etc/bumblebee/xorg.conf.nvidia
    

    If you only install nvidia-319 for example, probably Bumblebee will stop working because when asked to use the card, it will try to use nvidia-current.

So, if you want to make this as simple as possible, use nvidia-current or nouveau. If they work I doubt the performance increase to use a more modern driver pays the hassle. Primus is not required, but should give you a performance boost.

Related Question