Nvidia Optimus on your Linux laptop installing Bumblebee

What is Nvidia Optimus?

This technology is not new, it could well be said that it is an improvement of the "old" Hybrid SLI and Hybrid Graphics, which allowed to manage power when you combined an Nvidia GPU with a board with Nvidia Chipset in a desktop, now Optimus allows us to do the same in our laptops with Intel Sandy Brigde processors (i3, i5, and i7) and Nvidia Gpu. In simple wordsThis technology allows you to alternate between discrete and dedicated graphics according to demand, that is, if we run a Video Game, the system automatically activates the dedicated graphics, instead if we are watching a movie it will use discrete graphics. And in slightly more difficult words:

“Unlike previous generations of laptops, modern graphics cards are linked by a hardware channel to the IGP of Intel processors so there is no way to disable the processor graphics to just use the dedicated graphics card. The processor acts as a pass-through channel, when the dedicated graphics card is in sleep mode, the graphics chipset is used to render the graphics, passing the information to the internal monitor through the laptop's LVDS connector. However, if the dedicated graphics card is used, the information must also go through the graphics chipset in order to reach the monitor, for that reason it is not possible to physically deactivate the processor's IGP and therefore all this process of activating and deactivating must be carried out via software, in this case by the controller. » (Leanuxeros.com)

In Windows this works fine (I would say great, but we know that nothing works great with windows) and in LinuxFor a change, there is no official support from Nvidia and according to the news that I have been able to read they have no intention of doing so in the short or medium term, to that is added that in most computers there is no option to activate / disable one of the graphs by Bios, which leaves us with a very discouraging scenario because in the event that only the Integrated investment in Dedicated GPU it goes to the garbage can, instead if you have the Nvidia Graphics Active (this is the usual) energy performance will make us remember the Matrix and look favorably on the idea of ​​turning a relative or neighbor into a battery, because, as we all know, from the Kernel 2.6.38  laptop batteries are being decimated and autonomy has become a useful word for making protest songs (in my case the battery lasted the longest was two hours).

That is why on the Linux side of the force, projects have arisen to support this technology but without much success, that is until Bumblebee. Bumblebee It is an Open Source tool written in C language, it allows us to use the proprietary Nvidia driver or the free version New, a few days ago version 3.0 was released which among other innovations allows us to automatically activate the power manager by activating or deactivating the dedicated GPU according to the needs of the case (which is what matters to us).

We can install Bumblebee from the source file found in https://github.com/Bumblebee-Project/Bumblebee/downloads

There are packages in the repositories of Ubuntu, Gentoo, Arch y Debian.
I installed this application in the two distros that I use: Debian y Arch following the indications of their respective Wikis.

Installation in Arch

We install Bumblebee since the AUR

$ yaourt -S bumblebee

And we install bbswitch to be able to occupy the power manager

$ yaourt -S bbswitch

With Nouveau driver

If you are going to occupy the drivers New you must install the following packages:

$ sudo pacman -S xf86-video-nouveau nouveau-dri mesa

With proprietary Nvidia

If you use the proprietary Nvidia drivers, we install these packages from the AUR.

$ yaourt -S nvidia-utils-bumblebee dkms-nvidia

Configuration

We add our user to the group bumblebee:

# usermod -a -G bumblebee $USER (reemplazamos $USER por nuestro usuario)

We test that everything is properly installed and working by running bumblebee by hand:

$ sudo rc.d start bumblebeed

And magic… the Nvidia GPU is deactivated and we are only left with the integrated one, incidentally we give our battery a break.

Next we edit  /etc/rc.conf

We add Bumblebee across daemons

DAEMONS=(... bumblebeed)

We tested

$ optirun glxspheres

We can notice that the integrated one is activated and at the end of the process it turns off giving way to the dedicated one, if you want to run an application with the Nvidia GPU we do it from the console

$ optirun [opciones] <aplicaciones>

To see the list of options:

$ optirun --help

For the dedicated card to automatically turn on / off we add bbswitch in the Modules section:

MODULES=(... bbswitch …)

We edit  /etc/bumblebee/bumblebee.conf and we add the following line in the drivers section:

[bumblebeed] KeepUnusedXServer=false

We verify that PMMethod this in car:

[driver-nvidia] PMMethod=auto

[driver-nouveau] PMMethod=auto

We restart the bumblebee:

# rc.d restart bumblebeed

Installation on Debian (Only for Testing or Sid)

First you must remove any previous installation of Bumblebee, then we enable the repositories non-free.
To run 32 bit applications on 64 bit systems it is recommended to install the following packages:

$ sudo aptitude install virtualgl-libs-ia32 and libgl1-nvidia-glx-ia32

We add these repositories in  / Etc / apt / sources.list

deb http://suwako.nomanga.net/debian sid main contrib
deb-src http://suwako.nomanga.net/debian sid main

Then we lower the key and add it:

# wget -O - http://suwako.nomanga.net/suwako.asc | apt-key add -

We update:

# aptitude update

We install:

# aptitude install bumblebee bumblebee-nvidia

We add our user to the Bumblebee group:

# adduser $USER bumblebee (reemplazamos $USER por nuestro usuario)

We restart and test that it is working with:

$ optirun glxgears

If we want to run an application with a dedicated GPU, we do it as follows in a terminal

$ optirun <aplicación>

To finish I can tell you that my experience with this application has been quite good, some friends from DesdeLinux they witnessed how I gave up my head trying unsuccessfully to install the proprietary Nvidia drivers in the distros that I occupy (Debian and Arch), until I came across Bumblebee, on the other hand, the battery last two hours went to an average of three and a half hours and the laptop's temperature dropped from 54 ° to an average of 45 °.

It seems to me that as long as Nvidia doesn't decide to officially support Optimus on Linux, or if you're not interested in having proprietary drivers but running your Nvidia GPU, Bumblebee is an excellent alternative.


17 comments, leave yours

Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Diego Urbina said

    Excellent work, thanks for sharing your experience and helping us improve.

    1.    moskosov said

      Thanks to you for stopping by.

  2.   perseus said

    Excellent article friend 😉 and welcome on board: D. Best of luck bro.

  3.   moskosov said

    Thanks to you bro. 😉

  4.   JESUS ​​8) said

    Great article.

    The truth is, I recently bought a new laptop. I wanted the graphics to be NVIDIA, because in all the computers I have had, it has always done very well and with the proprietary drivers, it runs great on Linux.

    I was surprised to see the new technology using 2 graphics processors, but more surprised to see that Linux support was poor or no support.

    So I jumped in the pool and opted for an Intel graphics and so far I'm very happy.

    It is true that some games do not look quite right (small very specific problems or serious bugs in old proprietary games). But in general it seems to me that it is a very valid and good option.

    Intel graphics processors are supported by the kernel, which means that you can install your Linux distro and have 3D acceleration without doing anything. Stationery, games, etc. no need to configure or compile.

    In addition, when the kernel is updated, with the proprietary drivers it is necessary to recompile, with the free ones, everything works fine because the drivers are also updated alone.

    And finally, the drivers are being improved version by version, so I imagine and hope that in the future the small bugs that exist today will be solved.

    I wouldn't want to advertise any brand over another, but the fact that the folks at Intel are helping to make their product drivers free and Linux to have acceptable hardware support is something that we should think about when we go to buy a new computer.

    Despite the drawbacks, the fact of being able to have 3D support "out of the box" with Linux compensates me.

    A greeting!

  5.   Life plan said

    Hello:

    Does this affect desktop computers?

    A greeting.

    1.    moskosov said

      Optimus is only available on laptops.

  6.   Carlos-Xfce said

    Hello, Moscosov. Thank you very much for this article. You touch on a very important issue, that of processors. I would like to ask you a question. Look, I'm looking forward to buying a desktop computer for video editing and multimedia animation creation for educational purposes, running on GNU / Linux, of course. I would like it to be a processor of the new i7s, which is an investment that will last me at least 5 years. But I don't know anything about motherboards, or memories, and even less about processors. Could you make an article recommending something like this? I would not want to buy the best processor so that it turns out that the graphics drivers cannot show their full power because they are not running in Windows. Thanks for your attention.

    1.    moskosov said

      And how much money (in dollars) do you have Carlos?

  7.   pandev92 said

    The intel are quite good for what they say but of course, if you are going to have dual boot to play in hasefroch, the performance is terrible.

  8.   maximiliano said

    good, I tell you I have linux mint 12 and an asus k53sc, in my case when I want to add

    $ sudo aptitude install virtualgl-libs-ia32 and libgl1-nvidia-glx-ia32

    tells me that:
    Couldn't find any package whose name or description matched "virtualgl-libs-ia32"

    the other installs one.

    even so, I do not understand well how bumbleebe works, I ask is it necessary to activate the nvidia board before installing the bumblebe?

  9.   Juan said

    Excellent explanation about Bumblebee. I am trying to implement it on Centos 5.7. Do you have any idea how to do it in an easy way. I think it's not on elrepo.org yet.
    Thank you

  10.   Taranis said

    Hello,
    excellent contribution. I've been behind something like this for a long time, although I was hoping to load it up from scratch so that the desktop would take advantage of Nvidia.
    How can I know if an application works taking advantage of Nvidia. I mean like this, for example, executing a game through wine and wine loading it through optirun.
    I do not know if I explain myself very well.

    Thank you very much for the document.
    Greetings.

  11.   faster said

    many thanks…. It didn't work for a long time trying to install the primitive drivers or the free ones, nothing worked but this ... it worked ... you're great ... !!

  12.   armandoplc said

    Testing .. Thank you .. !!! .. a question, the only way to open the applications using Nvidia would then be from the console ?? .. Greetings

    1.    Jorge said

      Sure, or creating a script to invoke optirun every time you want to use the Nvidia card. It still gives excellent graphics performance, and I use it more to play Minecraft and the odd game that requires it 😛

  13.   DCOY said

    Excuse the ignorance but would it work with my nvidia ?, doing an lspci I get this:

    04: 00.0 3D controller: NVIDIA Corporation GK107M [GeForce GT 750M] (rev a1)

    Thank you! 😀