Ubuntu – Do I need to install Bumblebee for Hybrid Graphics system to enable Optimus on Ubuntu 16.04

bumblebeegraphicshybridnvidia-optimus

I am asking this question because I have found articles basically saying that some computers have enabled Optimus technique with some propriatory graphics drivers, for example this one from Ubuntu Wiki page and this one from pilot6, while a lot of people are still seeking methods to install Bumblebee over internet. So, I got confused. Meanwhile, although my laptop, Lenovo Thinkpad P50, is listed on the document linked above as a supported system, but I haven't make the propriatory nvidia-361 driver successfully installed (see this question) which is told by the document to be working on my system. I have a little suspect about the authority of the document.

Could anyone offer some reliable sources, evidence and real experiences (or techniques to confirm if no success instance found yet) to confirm Ubuntu 16.04 indeed natively supports hybrid graphics — one integrated card and one discrete card — no worse than Bumblebee? I haven't built enough confidence by simple searching. Thanks!

Best Answer

Currently, you have (at the best of my knowledge) three possibilities regarding Nvidia hybrid graphics (the so-called Optimus technology) under Linux:

  • Bumblebee. While this project might seem dead, it’s not (discloser: I’m part of the dev team). It has been slowly developing for a very long time, because we were all quite busy, but things have gone better recently, and we received help from new contributors. The 4.0 version is on track, it’s mostly bug fixes and the primus backend becoming the default (most people won’t notice since they were already using it). Bumblebee allows you to run your desktop and display on the integrated Intel chip, while running selected applications on the discrete Nvidia card. It can use either nouveau or nvidia driver (given that they support your card, which they should both do), and relies on bbswitch for power management (with the option of using vga_switcheroo if using nouveau). On the performance side, because of how it works, Bumblebee is PCIe bottlenecked, which means you can not achieve very high framerates (which is not really usefull anyway) but also that you can never reach the full power of your dedicated Nvidia card. In case some of the display outputs on your laptop are wired to the Nvidia chip (often the case of HDMI on Lenovo laptop), Bumblebee allows you to use them, but it requires a bit of configuration, is probably far less than ideal and above all not tested since no any of Bumblebee devs own an affected laptop. Otherwise, Bumblebee works with either DRI2 or DRI3.
  • PRIME. This is the proper solution for this technology, and is implemented at the right level: drivers, kernel, Xorg… PRIME allows you the same setup as Bumblebee, however, due to legal concerns, only nouveau is supported. Outside of that, it has also some issues with tearing because of changes needed in the i915 driver. Also, nouveau still has a lot of issues regarding performances, so until it gets proper reclocking, you might have less perfs than in the Bumblebee + nvidia setup (Bumblebee + nouveau suffers from the same issue obviously). PRIME does not rely on bbswitch for power management, but rather use nouveau/kernel integrated one. PRIME also allows you to use outputs wired to the Nvidia chip quite transparently AFAIK. When running on DRI2, it requires a bit of configuration (depending on whether you also have Bumblebee/bbswitch installed, the exact amount may vary), but nothing outstanding. VDPAU is supported too in this mode (but only with nouveau driver again). When running on DRI3, it’s very seemless to use (so much that Bumblebee will probably gain support for this mode in the next release). However, you don’t get VDPAU support, and apparently no Nvidia outputs support either.
  • Reverse PRIME. Here, the idea is to use the Nvidia card for everything including the desktop, and only use the Intel chip as an output sink for the laptop display. This is supported by both nouveau (with the same performances issues as above) and nvidia (with the dedicated nvidia-prime tool under Ubuntu for instance). This means you don’t get powersaving at all (and get increased power consumption at all stages), but as with PRIME you can easily and fully utilize any display output. In this mode, you get the best of your dedicated card when using the nvidia driver. This is also the only configuration where you can get VDPAU working on the Nvidia chip using the nvidia driver. However, it has also some issues with tearing because of changes needed in the i915 driver. This mode only works with DRI2. In fact, this is for the same reason as why you can’t use outputs in PRIME+DRI3: Reverse PRIME is in fact the name of the support for using another card outputs (whether it’s Intel ones while running on Nvidia here or Nvidia ones when running on Intel above), and that currently does not work under DRI3.

Note that things like CUDA or OpenCL do not require any of these tools, just a bit of configuration, but Bumblebee as a mode to use them easily while still getting its other advantages.

PRIME and Bumblebee can cohabit when using DRI3, but under DRI2 or switching to Reverse PRIME requires a switch of configuration files and restarting the X server. So, depending on your needs, this is what I would advice:

  1. If you don’t care about performances, but care about ease of utilisation (for external outputs mainly — if affected) and FLOSS, go for PRIME.
  2. If you care a bit more on performances but often use your laptop in battery mode and don’t want to restart your X server all the time, go for Bumblebee.
  3. If you care about performances and mostly use your laptop while plugged on AC (and don’t care about some extra W saving), take a look at Reverse PRIME using nvidia (you can use nvidia-prime to switch to Intel only mode when running occasionally on battery, but I’m not sure if the Nvidia card is turned off in this setup).