[SOLVED] NVIDIA Optimus + The Bumblebee Project

Issues related to hardware problems
4hr1m4n
Posts: 11
Joined: 2012/10/30 12:00:22

[SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by 4hr1m4n » 2012/10/31 03:55:10

Hi all,

After spending the last couple of weeks trying to make my NVIDIA GPU work with CentOS 6.3 64-bit on my laptop (Alienware M14x) I finally succeeded. Now I can run OpenGL applications using either one of my GPUs, integrated Intel HD Graphics 3000 Sandy Bridge or discrete NVIDIA GeForce GT 555M. Pretty cool, heh?

My laptop uses NVIDIA Optimus technology, therefore I had to use TBP (The Bumblebee Project). Also, I've decided to use NVIDIA proprietary drivers instead of Xorg Nouveau driver, just because I wanted maximum performance.

Here is what I needed in terms of additional software, besides regular Xorg packages and drivers (make sure you have Mesa and Xorg Intel too):
- NVIDIA proprietary drivers: to drive the NVIDIA GPU chip
- bbswitch: to enable/disable NVIDIA GPU via ACPI calls, thus saving battery
- Virtual GL: to transfer rendered images from NVIDIA back to Intel GPU which then displays them
- Bumblebee daemon: to control the whole process using all the software above

Since not all this software is currently available at CentOS base repositories, I had to get them from other places (I'm lazy and I didn't want to recompile everything from the source...). Here are these places:

* kmod-nvidia-304.60-1.el6.elrepo.x86_64 from ELRepo
* nvidia-x11-drv-304.60-1.el6.elrepo.x86_64 from ELRepo
* kmod-bbswitch-0.4.2-1.el6.elrepo.x86_64 from ELRepo-Testing
* VirtualGL-2.3-20111213.1.puias6.x86_64 from PUIAS 6 Computational
* bumblebee-3.0-2.el6.elrepo.x86_64 from ELRrepo-Testing

Before start installing these packages and tweaking them to work in a NVIDIA Optimus architecture, make sure you have your X environment working fine with the integrated Intel GPU (you should also be able to run Mesa/OpenGL applications like glxgears).

NOTE: keep in mind that the tweaks below are necessary mainly because the nvidia-x11-drv & kmod-nvidia packages were created assuming the NVIDIA GPU is the main GPU, which is not the case for laptops based on NVIDIA Optimus technology.

Ok, here we go:

1) Make a back up copy of your /etc/X11/xorg.conf (if it exists).
2) Install all the packages mentioned above.
3) Delete the file /etc/ld.so.conf.d/nvidia.conf and run /sbin/ldconfig.
4) Restore your back up copy of /etc/X11/xorg.conf if you originally had one. If not then just delete the one that might be there now.
5) Move the directory /usr/lib64/xorg/modules/extensions/nvidia with all its contents to /usr/lib64/xorg/nvidia.
6) Edit the file /usr/share/applications/nvidia-settings.desktop and change the Exec line to:

Code: Select all

Exec=optirun nvidia-settings -c :8.0
7) Create a new group called bumblebee and add your user ID to it.
8) Rename the file /etc/rc.d/init.d/bumlebeed. Its name should be /etc/rc.d/init.d/bumblebeed (maybe you got a newer bumblebee package that has this typo fixed already). After correcting the file name run chkconfig --add bumblebeed.
9) Edit /etc/bumblebee/bumblebee.conf file and make sure to set the following parameters:

Code: Select all

   ServerGroup=bumblebee
   Driver=nvidia
   KernelDriver=nvidia
   Module=nvidia
   PMMethod=bbswitch
   LibraryPath=/usr/lib64/nvidia:/usr/lib64/vdpau:/usr/lib/nvidia:/usr/lib/vdpau
   XorgModulePath=/usr/lib64/xorg/nvidia,/usr/lib64/xorg/modules
10) Reboot your laptop

To test if NVIDIA GPU is now accessible, log in as usual and open NVIDIA X Server Settings application (System -> Administration). If it runs ok then it's working.
You can also execute

Code: Select all

optirun /opt/VirtualGL/bin/glxspheres64
Want to compare the Intel and NVIDIA GPUs' performance? Open a terminal, run

Code: Select all

optirun /opt/VirtualGL/bin/glxspheres64 &
and

Code: Select all

/opt/VirtualGL/bin/glxspheres64 &     #without optirun
NOTE: steps 3, 5 and 9 are critical; make sure you execute them correctly.

WARNING! These instructions come with no warranty of any type. Follow them at your own risk.

Enjoy! :-D

4hr1m4n
Posts: 11
Joined: 2012/10/30 12:00:22

[SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by 4hr1m4n » 2012/11/10 07:10:14

Hi,

Some people might also be interested in installing [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=40076&start=0#forumpost173754]libjpeg-turbo[/url] to be used by VirtualGL.
It can speed up things a bit.

Cheers.

User avatar
toracat
Forum Moderator
Posts: 7356
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

[SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by toracat » 2012/11/10 21:42:32

Thanks for putting the instructions together and making them available. Will you be willing to contribute to the CentOS wiki?

Also, I will try to fix the missing "b" in /etc/rc.d/init.d/bumlebeed as spotted in 8).

mudfox
Posts: 1
Joined: 2012/12/07 08:03:59

Re: [SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by mudfox » 2012/12/15 06:04:04

it works ,but something wrong with my notebook(it is hasee k480n i5 d1);
i do it like this:
vi /etc/bumblebee/xorg.conf.nvidia
change "DFP" to "CRT",
so ,everything goes well;

sorry my english is poor,i hope you can understand it.

Mr_X
Posts: 1
Joined: 2012/12/27 15:52:40

Re: [SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by Mr_X » 2012/12/27 15:57:13

Hi All,
tested on my ASUS N73S... now it works great!!!

Thanks 4hr1m4n.

Hellboy
Posts: 116
Joined: 2010/07/18 09:46:18

Re: [SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by Hellboy » 2013/03/16 15:02:54

I just created a new bumblebee rpm, which upgrades the version to 3.1
I fixed the name of the service.

olheiros
Posts: 1
Joined: 2013/06/12 14:01:38
Contact:

Re: [SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by olheiros » 2013/06/12 14:05:59

Hi all

i just followed your instructions. and it seems to work.
but now when run a gui installer for an application as root i get

"
No protocol specified
Error: couldn't open disply :0.0

"

should i just go for gsudo? or is an alternative?

many thanks for your posting. very helpful.


cheers
Ricardo Viana

Izidor
Posts: 2
Joined: 2014/07/21 18:31:24

Re: [SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by Izidor » 2014/07/21 18:36:24

Don't know if there is a newer source of information, but I followed those instructions and so far it works!
I use Centos 6.5 running on laptop Lenovo ThinkPad Edge (E) 540 with nvidia 740 graphic card and intel (i7 processor).

Many thanks!

p.s.
I created acc. on this forum just to say how great source of information it is.

dtopolsek
Posts: 1
Joined: 2014/08/27 21:36:50

Re: [SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by dtopolsek » 2014/08/29 07:36:51

Thank you very much.

I'm using centOS 7 on ASUS x750JB with nvidia gf 740M video card and following your instructions everything works.

Thanks again.

goGuD
Posts: 3
Joined: 2014/08/06 15:41:41

Re: [SOLVED] NVIDIA Optimus + The Bumblebee Project

Post by goGuD » 2014/12/12 14:53:11

Thank you for your usefull instructions. I did all steps as you described, however it did not worked for me :(
When I run

Code: Select all

optirun /opt/VirtualGL/bin/glxspheres64
it gives out put :

Code: Select all

Polygons in scene: 62464
Xlib:  extension "GLX" missing on display ":8".
ERROR (603): Could not obtain RGB visual with requested properties
Could you please help me to solve this issue ?

Post Reply