Is this really about Transformers?
It’s still quite hard for me to believe: I’ve got NVIDIA Optimus working on my Fedora 18 laptop!
When I bought this laptop, I had no idea it had this technology on board. To be honest, I didn’t know a thing about Optimus. When it arrived, I discovered that, not only I had no means of using the discrete NVIDIA graphic card, but I’d better find a way to turn it off, or the whole PC would be on fire in matter of minutes.
Basically, I’m talking about this:
dario@Abyss ~]$ lspci|grep -i vga 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev ff)
And Wikipedia calls it “an optimization technology”. Sure, tell me about it!!
Well, as usual, I started digging to see what I can do, and found out the Bumblebee project, which looked really promising from the beginning. Unfortunately, it turned out not to be the case, not at that time at least, as it was 2010, the project was still in its very early days, and was supported only for Ubuntu, while I was running Fedora 16 at the time. I managed in setting it up by hand, to the point where it was working, but it never became really usable.
To switch the discrete GPU off and avoid overheating, I found acpi_call, compiled it, added it to DKMS, and settled around the idea of hearing nothing more from this laptop’s NVIDIA card. Never.
But then…
I still don’t know why, about a month ago, after having updated the laptop to Fedora 18, I decided to google for something like ‘bumblebee fedora‘… And I saw the light!
First of all, we now have a really nice page in the official Fedora wiki about how to install and get Optimus running. I tried this way first, and got almost there, but couldn’t claim 100% success. In fact, my card (which, BTW, is a NVIDIA Corporation GF108 [GeForce GT 540M]) does not seem to be that well supported by Linux’s nouveau driver, or at least by Linux’s nouveau running in a “Optimus configuration”. In fact, I couldn’t get any application to really use the discrete card and, most important, I couldn’t dynamically turn on and off the discrete card, which, well, is the whole point!
The solution is to use proprietary NVIDIA drivers and a really really really nice step by step tutorial on how to set them up for a Optimus environment can be found at this link. Actually, Viger from http://forums.if-not-true-then-false.com did much more than that: he has (or has found and links to) some nice RPM packages that makes things unbelievably comfortable to set up. So, here’s what I did:
# ln -s /etc/modprobe.d/blacklist.conf /usr/lib/modprobe.d/ # echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf # dracut /boot/initramfs-$(uname -r).img $(uname -r) # yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora18/x86_64/acpi-handle-hack-0.0.2-1.fc18.x86_64.rpm # yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora18/x86_64/bbswitch-0.5.0-1.fc18.x86_64.rpm # yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora18/x86_64/bumblebee-3.0.1-2.fc18.x86_64.rpm # yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora18/x86_64/primus-0.0.12112012-8.fc18.x86_64.rpm # yum install VirtualGL # yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora18/noarch/bumblebee-nonfree-release-1.0-1.noarch.rpm # yum install Install bumblebee-nvidia # reboot
And then you are done. Finished. Everything works! The super cool thing about the bumblebee-nonfree package is that it takes care entirely of installing the NVIDIA proprietary Xorg drivers in a non standard location, as it is required by Optimus, and really painful to do by hand.
[dario@Abyss ~]$ rpm -ql bumblebee-nvidia /etc/bumblebee/bumblebee-nvidia.conf /etc/sysconfig/nvidia /etc/sysconfig/nvidia/NVIDIA-Linux-x86_64-310.32.run /etc/systemd/system/bumblebee-nvidia.service /usr/lib/nvidia-bumblebee /usr/lib/systemd/system/bumblebee-nvidia.service /usr/lib64/nvidia-bumblebee /usr/lib64/nvidia-bumblebee/xorg/modules/extensions /usr/sbin/bumblebee-nvidia /usr/share/selinux/devel/bumblebee-nvidia.te
(where the job of moving the files in the proper directories the package creates, after having extracted/compiled them, is carried out by the /usr/sbin/bumblebee-nvidia script.)
Some nice info about how to use the discrete card via optirun are available, for instance, on the ArchLinux Wiki. For making sure that the card is disabled when not in use have a look here:
[dario@Abyss ~]$ cat /proc/acpi/bbswitch 0000:01:00.0 OFF
(although, believe me, you can also hear that from the fact the fan is silent and the laptop not burning as much as hell!)
The last touch is this GNOME3 Extension: Bumblebee indicator.
And does it really work?
It sure does, but please, judge yourself.
Without Optimus (i.e., running on the integrated Intel card)
[dario@Abyss ~]$ glxspheres Polygons in scene: 62464 Visual ID of window: 0x9f Context is Direct OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Mobile 55.670883 frames/sec - 54.525288 Mpixels/sec 39.869175 frames/sec - 39.048747 Mpixels/sec 40.019250 frames/sec - 39.195734 Mpixels/sec ...
With Optimus (i.e., running on the discrete NVIDIA card)
[dario@Abyss ~]$ optirun glxspheres Polygons in scene: 62464 Visual ID of window: 0x21 Context is Direct OpenGL Renderer: GeForce GT 540M/PCIe/SSE2 99.215315 frames/sec - 97.173662 Mpixels/sec 109.804884 frames/sec - 107.545319 Mpixels/sec 109.287161 frames/sec - 107.038250 Mpixels/sec ... [dario@Abyss ~]$ optirun -c yuv glxspheres Polygons in scene: 62464 Visual ID of window: 0x21 Context is Direct OpenGL Renderer: GeForce GT 540M/PCIe/SSE2 115.854143 frames/sec - 113.470097 Mpixels/sec 118.528492 frames/sec - 116.089413 Mpixels/sec 119.482522 frames/sec - 117.023811 Mpixels/sec ... [dario@Abyss ~]$ vblank_mode=0 primusrun glxspheres Polygons in scene: 62464 ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. Visual ID of window: 0x9f ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. Context is Direct OpenGL Renderer: GeForce GT 540M/PCIe/SSE2 primus: sorry, not implemented: glXUseXFont 270.721424 frames/sec - 265.150518 Mpixels/sec 275.764986 frames/sec - 270.090294 Mpixels/sec 276.292697 frames/sec - 270.607146 Mpixels/sec ...
Impressive, eh?
Wasn’t it about overheating too?
Finally, here it is what I get on a mostly idle system:
[dario@Abyss ~]$ sudo sensors acpitz-virtual-0 Adapter: Virtual device temp1: +54.0°C (crit = +100.0°C) temp2: +54.0°C (crit = +100.0°C)coretemp-isa-0000 Adapter: ISA adapter Physical id 0: +54.0°C (high = +86.0°C, crit = +100.0°C) Core 0: +54.0°C (high = +86.0°C, crit = +100.0°C) Core 1: +53.0°C (high = +86.0°C, crit = +100.0°C) Core 2: +53.0°C (high = +86.0°C, crit = +100.0°C) Core 3: +50.0°C (high = +86.0°C, crit = +100.0°C)
And, again, believe me, this is something I did never achieve before, while not being able to turn the discrete card off properly.
UPDATE (Feb 20, 2013):Gary (see the comments below) pointed me to the Wiki page, where all this effort to package bumblebee and friends nicely and get them into Fedora lives. Check that out: it is full of much more useful and detailed information that this humble post!
Related articles
- Bumblebee (wiki.archlinux.org)
- David Airlie Announces “Reverse Optimus” Multi-GPU (phoronix.com)
- Fedora 18 Spherical Cow brings Linux fans a taste of Cinnamon, new installer (engadget.com)












Pingback: NVIDIA 310.32 on Kernel 3.7.7-201.fc18 | Dario's
Thank You very much sir.. ! It now works and i m getting a good battery life.
The only prob i had was that, my system was running kernel 3.3.4 and a command updated the kernel header 3.7 so it didnt worked. Then i updated my kernel to 3.7 and did all above things again. And this time it worked. !
Thank You once again. !
You’re welcome! Improved battery life is one of the most pleasant outcome of all this! For the kernel “issue”, you’re right, I was assuming one always run an as updated as possible system… I should have mentioned that. Glad it ended up well anyway.
Ciao Dario,
grazie per la tua guida.
Con optirun riesco ad usare firefox con youtube con un basso uso di cpu . L’unica cosa che proprio non funziona e’ il supporto vdpau per mplayer/smplayer. Mi compare questo errore:
——————————————————————————————————————-
Xlib: extension “NV-GLX” missing on display “:0″.
Xlib: extension “NV-GLX” missing on display “:0″.
[vdpau] Error when calling vdp_device_create_x11: 1
Error opening/initializing the selected video_out (-vo) device.
——————————————————————————————————————-
Al riguardo, avresti qualche info?
Grazie,
Luigi.
Ciao! In effetti non avevo ancora testato VDPAU.
Allora, far funzionare la cosa pare semplice, e c’eri quasi, basta fare cosi`:
$ DISPLAY=:8 optirun mplayer -vo vdpau video_file.avi
Non dovrebbe dare errori di librerie o altro. Il problema e` che cosi` non vedi la finestra del video, cosa alquanto fastidiosa!
Per ovviare a questo, serve `hybrid-windump’, che adesso non ho tempo di installare e provare… Appena posso ti rispondo di nuovo, o faccio un altro post. Nel frattempo, ho trovato questi:
http://www.youtube.com/watch?v=pxziIAPFIFY
http://osdir.com/ml/hybrid-graphics-linux/2011-09/msg00057.html
http://askubuntu.com/questions/102508/hybrid-dump-for-vdpau-accelerated-video-playing-on-ubuntu-11-10-with-bumblebee-3
Se li provi, sentiti pure libero di farmi sapere come va.
Ciao e grazie, Dario
Ciao Dario,
ho provato a compilare il pacchetto windump. Adesso funziona e apre la finestra come indicato in questo post:
http://osdir.com/ml/hybrid-graphics-linux/2011-09/msg00057.html
pero’ nella finestra che si apre si vede tutto nero.
Ho provato anche a compilare il pacchetto:
https://github.com/chenxiaolong/Fedora-SRPMS/tree/master/nVidia-Drivers/hybrid-screenclone
ma compila solo hybrid-screenclone mentre il pacchetto di dipendenza del driver intel non ne vuole sapere.
Ci sentiamo.
Grazie per la collaborazione.
Luigi.
Pingback: Jak zprovoznit Nvidia Optimus ve Fedoře 18 | Fedora.cz
Hello. Here is a link to my wiki page:
http://techies.ncsu.edu/wiki/bumblebee
Maybe it will help you out. I have been working on this subject on and off for about a year. (Had to take a break a while back due to surgury)
Cheers,
Hi! Nice to meet you.
That is awesome, I was not aware of the Wiki page. Thanks for the link… I’ll update the post to include it even there. I particularly appreciate your effort for getting all the packages into Fedora upstream. I know it’s tough, so, best of luck for it!
I’m not having much issues right now, and everything seems to be working. As per another comment (which is in Italian), an area where there might be some room for improvement is VDPAU support. In particular since, with a super-quick google search, I couldn’t find any packaged solution for hybrid-windump (provided hybrid-windump is a decent solution for that, which I’m not sure).
I’ll dig a bit more on that and update/make a new post… For now, thanks for letting me know about the Wiki again.
Dario
Hello. Nice to meet you. I have not tried to get VDPAU support to work. (Didn’t know about it until today actually)
but check out:
http://askubuntu.com/questions/102508/hybrid-dump-for-vdpau-accelerated-video-playing-on-ubuntu-11-10-with-bumblebee-3
Albert Vilella posted this to the hybrid graphics mailing list today. Perhaps that could be modified for a fedora install without too much trouble?
Cheers,
Yep, that link was right my answer to the other comment on this blog post, asking for help with VDPAU. As I said there, I’ll try have a look and a try to it asap, and share the results…
Reblogged this on The Linux Site.
Pingback: Dario's
Works perfectly. Thanks man!
Just followed instructions collected here and there, and put them together! Anyway, glad it worked for you!
This paragraph gives clear idea in favor of
the new viewers of blogging, that in fact how to do blogging.