May 17, 2012, 06:15:59 PMLatest Member: Mahesh

Author Topic: Fedora 16 for NVIDIA Optimus users  (Read 12832 times)

0 Members and 2 Guests are viewing this topic.

Offline Viger

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
  • OS: Fedora 16
Fedora 16 for NVIDIA Optimus users
« on: December 12, 2011, 06:21:14 PM »
If in your notebook is it impossible to turn Intel Graphics / Optimus off in the BIOS then try this procedure for install nvidia driver:

1) First uninstall nvidia driver if installed in fedora 16 from rpmfusion (akmod-nvidia, kmod-nvidia,kmod-nvidia-PAE...) or manual installation  (bumblebee install new nvidia driver)

2) Download old version bumblebee from

          https://nodeload.github.com/MrMEEE/bumblebee-Old-and-abbandoned/zipball/master

3)  install VirtualGl 2.2.90 rpm from:

          http://www.virtualgl.org/Downloads/VirtualGL

4)  blacklist nouveau in /etc/blacklist.conf

5)   move old initramfs

     
Code: Bash
  1. mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img

6) recreate initramfs without nouveau

   
Code: Bash
  1. dracut /boot/initramfs-$(uname -r).img $(uname -r)

7) restart pc

8) install bumblebee
 
Now optimus is ok

9) control nvidia driver if ok

                  intel driver
           $ glxgears
              301 frames in 5.0 seconds = 60.058 FPS

                nvidia driver
          $ optirun64 glxgears
             4152 frames in 5.0 seconds = 830.178 FPS

10) suspend/hibernate with bumblebee

in Fedora 16 a quick workaround to this issue I used to do, is to add a pm-utils file that kills the daemon at suspend/hibernate and reenables it at wakeup with nvidia module:

For example /etc/pm/sleep.d/10_bumblebee
Code: Bash
  1. #!/bin/sh
  2. case "$1" in
  3.   hibernate|suspend)
  4.     systemctl stop bumblebee.service
  5.     rmmod nvidia
  6.     ;;
  7.   thaw|resume)
  8.     modprobe nvidia
  9.     systemctl start bumblebee.service
  10.     ;;
  11.   *) exit
  12.      ;;
  13. esac
  14.  

And don’t forget to give execution permission to that file.

11) kernel upgrade with bumblebee

Install new kernel rpm and download from Nvidia website, nvidia driver for manual installation (same version installed by bumblebee).
Compile and install new nvidia module for new kernel. For example:

Code: [Select]
# sh ./NVIDIA-Linux-x86_64-290.10.run -K --kernel-name=3.1.6-1.fc16.x86_64
Reboot with new kernel.
With this procedure is not necessary reinstall bumblebee for kernel upgrade.
« Last Edit: March 22, 2012, 07:23:08 PM by Viger »

Offline JR

  • Administrator
  • *****
  • Posts: 120
  • Karma: 3
    • View Profile
    • If Not True Then False
  • OS: Fedora 16 "Verne"
Re: Fedora 16 for NVIDIA Optimus users
« Reply #1 on: December 12, 2011, 09:36:42 PM »
Thanks again Viger! :)

I added just few
Code: [Select]
[code=bash]sections to your guide. :)

Offline Chelmite

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #2 on: December 15, 2011, 08:45:29 AM »
It wasn't clear how to get bumblebee. Could you give some more info on where to get it, and which version?

Thanks,
Chelmite

Offline JR

  • Administrator
  • *****
  • Posts: 120
  • Karma: 3
    • View Profile
    • If Not True Then False
  • OS: Fedora 16 "Verne"
Re: Fedora 16 for NVIDIA Optimus users
« Reply #3 on: December 15, 2011, 09:48:14 AM »
It wasn't clear how to get bumblebee. Could you give some more info on where to get it, and which version?

Hi Chelmite,

So when you go to Bubmlebee old version page. Just click "Downloads" tab and download as zip or tar.gz. Here is also direct link to Bubmlebee old version downloads page.
« Last Edit: December 15, 2011, 10:04:54 AM by JR »

Offline Chelmite

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #4 on: December 20, 2011, 09:17:28 AM »
Thanks.  It was the "Sorry, there aren't any downloads for this repository." message that convinced me I was in the wrong place. (Similar to the "Beware of the leopards!" sign in the basement...)

I did as instructed, and still cannot get the display to come up. There are a few futile flashes, and I am left with only the message:
Started SYSV: Late init script for the live image..

  • Why the old version of bumblebee?
  • I'm running Fedora 16 (kernel 3.1.5-6) on a Lenovo W520 (which didn't show up as an option when running bumblebee). I had removed nouveau, downloaded the latest driver from nVidia, and installed it manually. I had installed akmod-nvidia also.
  • When I run "lspci | grep -i vga", I get:
    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 [Quadro 1000M] (rev a1)

  • I checked, and the 1000M is on the "supported" list for version 290.10 of the nVidia drivers for Linux x64 (AMD64/EM64T) Display Driver.
  • I enabled Optimus in the BIOS. Should I disable it? I have the choices:
    Graphics Device [NVIDIA Optimus/Integrated Graphics/Discrete Graphics]
    OS Detection for NVIDIA Optimus (if enabled, the BIOS automatically switches Graphics device setting to NVIDIA Optimus mode if the OS supports the feature, and to Discrete Graphics if the OS does not support it.)
  • I tried disabling OS Detection, and setting the graphics device to "Integrated Graphics", but no change. When I set it to "NVIDIA Optimus/OS Detection disabled", and run "init 5", I get the Fedora logo flash, then I get a black screen with a flashing cursor, and cannot access the Linux consoles, but ctrl-alt-del shuts down gracefully.
  • When I set it to "Integrated Graphics", and then try to run the nVidia installer for 290.10, it complains "You do not appear to have an NVIDIA GPU supported by the 290.10 NVIDIA Linux graphics driver installed in this system."
  • When I set it to "Discrete Graphics" and reboot, I get a white rectangle (perhaps part of the Fedora progress bar), but then no progress is made in booting!

Offline JR

  • Administrator
  • *****
  • Posts: 120
  • Karma: 3
    • View Profile
    • If Not True Then False
  • OS: Fedora 16 "Verne"
Re: Fedora 16 for NVIDIA Optimus users
« Reply #5 on: December 20, 2011, 09:45:29 AM »
First as Viger guide says "If in your notebook is it impossible to turn Intel Graphics / Optimus off in the BIOS then try this procedure for install nvidia driver".

So I recommend that the you disable NVIDIA Optimus and just use your NVIDIA Graphics. It looks like you should select Discrete Graphics, because I think that Integrated Graphics refer to Intel Graphics, and your errors tell the same thing. :)

When you boot your Linux change another virtual console with ALT+F2, ALT+F3, etc. command and run:
Code: [Select]
lspci | grep -i vga

And when you see just one row, which is:
Code: [Select]
01:00.0 VGA compatible controller: nVidia Corporation GF108 [Quadro 1000M] (rev a1)
Then you select right options from BIOS... :)

Btw. I suggest that you install nVidia drivers using following guide:
Install nVidia Drivers on Fedora 16

And normally nVidia's own installer is not recommend method, if you have some better option, because with nVidia's installer you have to build your drivers again on every kernel update.

Offline benko

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
  • Wheeee!
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #6 on: December 20, 2011, 11:59:19 PM »
The thing with ThinkPad W520 is (and I'd be extremely glad if I had a chance during this lifetime, to congratulate the smarty pants that thought this up) that unfortunately, the Intel Sandybridge GPU IS NOT WIRED (?!?) to any of the external ports and vice-versa, the nVidia Quadro, whichever model, can only send directly to LCD if in discrete mode (which is almost kind of logical, if you conform to the brainfart that "Intel owns the LCD channel").

So... no cigar. I was so pissed off when I realised it. Especially since it was forced upon me to realise it one day before a course I was supposed to deliver (on overhead projector, of course) had started. Which is good, in a way, because anger can be a good motivator.

So, basically, until I (or someone else) find(s) something out, this goes for Lenovo ThinkPad W520:

1. INTERNAL-ONLY MODE
No external port will ever work. VGA1 output appears in xrandr (the others don't), but it can't be turned on. Intel i965 DRM works quite decently for every day work (although there is a trick with GLX cut-off, so don't trust glxgears). The bummer is the fact you can completely forget any kind of external display devices except perhaps streaming your LCD flicks somewhere with a digital camera attached to a network switch.

2. DISCRETE-ONLY MODE
You will get everything you're used to with a "normal" graphics card (that Quadro is), but no Intel. IF it works, it means higher performance and power consumption, but who cares - for me at least, it's function and performance first with this beast, only then autonomy. If, as I might have forgotten to point out, it boots, nvidia-settings performs exactly how one would expect it to, detects monitors properly, TwinView works, in short, you get the lot, although mode switches are a bit sluggish to my taste.
If.
Various users reported various degrees of success, ranging from once out of three down to straight never, for me though it was one successful boot in about 25 attempts, which is great if I had a boss. Because then, whenever that boss would have been giving me a hard time in the morning, I could simply demonstrate to them that my laptop won't boot, so they should bugger off until I fixed it.
Still looking into what exactly causes it, because even when booting without KMS, the damn thing will freeze immediately after, f.e. plymouth had been started on Fedora 16. With KMS, it will have *always* frozen immediately after the nvidia.ko module has been loaded.

3. OPTIMUS
This is currently my best (and only) bet, actually.
You get best of both worlds - a neutered on-chip Intel GPU for best battery consumption and a crippled Quadro GPU that can't touch your LCD for whenever you want to do high-performance graphics. This is exactly the reason why Chelmite could not see anything with nvidia drivers in Optimus - they were displaying on the external port. And, no - even if you start up nvidia-settings from the external display, you *still* can't touch your LCD. Looking forward to whatever Bumblebee and Ironhide have to offer. This is going to be one hell of a night.


P.S.: For random readers' amusement's sake...
On the first day of the course, I "solved" the overhead problem by running Intel in Optimus, tried a bit of hand waving and then attached the main display of a workstation nobody was using to the projector, ssh-tunnelled port 5900 from the workstation to my laptop's loopback. I then started up a read-only vncviewer on the workstation in order to display what was going on in the virtual machine I had set up for the course.
Today, I rebooted about ninety-five times, developed a couple of grey hairs and then started up with nvidia in Optimus, on the external port only, of course. I proceeded to creating a new user account to prevent my desktop from being slaughtered by the micro resolution of the overhead, attached the projector to the external VGA port and was luckily able to mirror that over back to my table where an LCD was situated - because the projector has a VGA OUT port.
*sigh*
Today's laptop designers really must be bored to the point of committing suicide by sucking up five bottles of orange juice up their rectae and waiting for it to eat its way through, thereby causing their guts to fall out of their arse. They then rather opt for upping their spirits by collecting snapshots of facial expressions of customers when they realise what a crappy product they have bought. I have no other reasonable explanation for a design like this.

P.P.S: Oh, I almost forgot adding this one horrendously impractical, but functional workaround which I came across for my most acute case, the course - in Optimus, you can start your primary display on Intel, for example, create a *separate* xorg.conf for nVidia (and, obviously, without any pointing devices as you can't realistically expect to be able to look in a different direction with each of the eyes, just to be able to constantly check you're not wreaking havoc on the other display with your clicking and typing) and then start up on external display like this:
 $ X -sharevts -novtswitch -config hw/nvidia-force1152.conf :1
After it started up, you can simply start the read-only vncviewer over there like so:
 $ env DISPLAY=:1 vncviewer -FullScreen=1 -ViewOnly=1 -UseLocalCursor=1 localhost:0
Of course, this only akin to "works" for presentations inside a virtual machine accessible using VNC or mirroring your own display that you previously configured to allow remote access.
« Last Edit: December 21, 2011, 12:38:09 AM by benko »
A black cat crossing the street signifies that the animal is going somewhere.

Offline JR

  • Administrator
  • *****
  • Posts: 120
  • Karma: 3
    • View Profile
    • If Not True Then False
  • OS: Fedora 16 "Verne"
Re: Fedora 16 for NVIDIA Optimus users
« Reply #7 on: December 21, 2011, 09:58:48 AM »
Thank you very much benko! I really appreciate, your post is unique! ;D I like very much your style!  :D

This explains it all and much much more. Very enjoyable read and a great description of how badly the Lenovo ThinkPad W520 works with Linux. :)

It seems that NVIDIA Optimus Technology is now comparable to the old days continuous ATI problems ... :)
« Last Edit: December 21, 2011, 11:39:03 AM by JR »

Offline Vanitas

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #8 on: December 23, 2011, 04:15:10 PM »
Hi. Tutorial is very useful but I've got one problem:
Code: [Select]
Installing Bumblebee Configuration and files


32-bit system detected

Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Examining install-files/VirtualGL.i386.rpm: VirtualGL-2.2.2-20110421.i386
install-files/VirtualGL.i386.rpm: does not update installed package.
Error: Nothing to do

Package manager failed to install VirtualGL...
I installed VirtualGL earier following tutorial, also tried to replace VirtualGL rpm file in /MrMEEE-bumblebee-6629f3a/install-files/ and still the same error...
Is it possible that nouveau is not disabled? I've created blacklist.conf but never know...

Offline Viger

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #9 on: December 23, 2011, 05:11:17 PM »
Hi. Tutorial is very useful but I've got one problem:
Code: [Select]
Installing Bumblebee Configuration and files


32-bit system detected

Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Examining install-files/VirtualGL.i386.rpm: VirtualGL-2.2.2-20110421.i386
install-files/VirtualGL.i386.rpm: does not update installed package.
Error: Nothing to do

Package manager failed to install VirtualGL...
I installed VirtualGL earier following tutorial, also tried to replace VirtualGL rpm file in /MrMEEE-bumblebee-6629f3a/install-files/ and still the same error...
Is it possible that nouveau is not disabled? I've created blacklist.conf but never know...

Hi Vanitas, perhaps the problem is the new VirtualGL rpm. Also remove VirtualGL 2.2.90 rpm and use old version of bumblebee (with his old version of VirtualGL.i386.rpm) for installation.
« Last Edit: December 23, 2011, 05:22:43 PM by Viger »

Offline Vanitas

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #10 on: December 23, 2011, 06:02:02 PM »
Hi Vanitas, perhaps the problem is the new VirtualGL rpm. Also remove VirtualGL 2.2.90 rpm and use old version of bumblebee (with his old version of VirtualGL.i386.rpm) for installation.
I used 1.7.10 version of bumblebee:
Code: [Select]
Welcome to the bumblebee installation v.1.7.10I've just removed latest version of VirtualGL and installation is finished now.
Optirun command seems to work fine. Thanks for help!

@EDIT
One more question. Is it possible to run gnome in optirun? Pragrams searching / starting should be faster, right?

@EDIT 2
Possible to run VLC?
Code: [Select]
$ optirun vlc
VLC media player 1.1.12 The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
[0x913f8fc] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[VGL] ERROR: Could not open display :1.
« Last Edit: December 23, 2011, 08:57:22 PM by Vanitas »

Offline Viger

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #11 on: December 23, 2011, 10:15:58 PM »

@EDIT
One more question. Is it possible to run gnome in optirun? Pragrams searching / starting should be faster, right?

Here there is a script for gnome 2, perhaps you can use for gnome 3:
http://www.martin-juhl.dk/2011/05/optimus-on-linux-problem-solved

@EDIT 2
Possible to run VLC?
Code: [Select]
$ optirun vlc
VLC media player 1.1.12 The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
[0x913f8fc] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[VGL] ERROR: Could not open display :1.

Means the second X server is not running or failed to start. Also first reboot pc
and try run vlc with:
Code: [Select]
$ optirun32 vlc
If there is a VGL error ([VGL] ERROR: Could not open display :1) then
here are some things you can try and check:

1) Check the kernel module loaded for the nvidia card with "lspci -k"
2) Check the file /etc/X11/xorg.conf.nvidia and make sure the option "BusID" points to the correct PCI port (see "lspci -k").
3) Change in the file /etc/X11/xorg.conf.nvidia the "ConnectedMonitor" option to "DFP-0" or "CRT-0"
4) Control /var/log/Xorg.1.log for nvidia errors
« Last Edit: December 23, 2011, 10:18:26 PM by Viger »

Offline Vanitas

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #12 on: December 24, 2011, 01:33:52 PM »
Here there is a script for gnome 2, perhaps you can use for gnome 3:
http://www.martin-juhl.dk/2011/05/optimus-on-linux-problem-solved
I will try it. Gnome works quite fast at the momment so it's not very urgent  ;)

Means the second X server is not running or failed to start. Also first reboot pc
and try run vlc with:
Code: [Select]
$ optirun32 vlc
Code: [Select]
$ optirun32 vlc
bash: optirun32: command not found...
1) Check the kernel module loaded for the nvidia card with "lspci -k"
Here is full output. And here AFAIK is GeForce module:
Code: [Select]
04:00.0 VGA compatible controller: nVidia Corporation Device 0a76 (rev a2)
Subsystem: ASUSTeK Computer Inc. Device 8446
Kernel modules: nouveau, nvidiafb
2) Check the file /etc/X11/xorg.conf.nvidia and make sure the option "BusID" points to the correct PCI port (see "lspci -k").
It points to the one I've written above.
3) Change in the file /etc/X11/xorg.conf.nvidia the "ConnectedMonitor" option to "DFP-0" or "CRT-0"
No differences between CRT-0 / DFP-0.
4) Control /var/log/Xorg.1.log for nvidia errors
I've cleaned Xorg.1.log then rebotted my netbook and here's what I've found in this file. Here is Xorg.0.log if it's needed.
From lspci -k I can see that nouveau module is running (?) - should it be removed completely?
« Last Edit: December 24, 2011, 01:48:57 PM by Vanitas »

Offline Viger

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #13 on: December 24, 2011, 08:44:45 PM »
Code: [Select]
$ optirun32 vlc
bash: optirun32: command not found...
Ok, your version of bumblebee use optirun command not optirun32 command

Code: [Select]
04:00.0 VGA compatible controller: nVidia Corporation Device 0a76 (rev a2)
Subsystem: ASUSTeK Computer Inc. Device 8446
Kernel modules: nouveau, nvidiafb

Ok, fedora 16 not load nvidia driver. Try:
Code: [Select]
# modprobe nvidia

For my pc   lspci -k for nvidia device is:
Code: [Select]
01:00.0 VGA compatible controller: nVidia Corporation GF106 [GeForce GT 555M SDDR3] (rev a1)
Subsystem: ASUSTeK Computer Inc. Device 1642
Kernel driver in use: nvidia
Kernel modules: nvidia, nouveau, nvidiafb

control status of bumblebee service
Code: [Select]
# systemctl status bumblebee.service

If inactive, start and enable bumblebee service
Code: [Select]
# systemctl start bumblebee.service
# systemctl enable bumblebee.service

If you have problems try:
1) update to VirtualGl 2.2.90 rpm and reboot
2) remove VirtualGl, uninstall and reinstall bumblebee
3) install another version of bumblebee
« Last Edit: December 24, 2011, 08:54:59 PM by Viger »

Offline benko

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
  • Wheeee!
    • View Profile
  • OS: Fedora 16
Re: Fedora 16 for NVIDIA Optimus users
« Reply #14 on: December 27, 2011, 06:53:41 AM »
Code: [Select]
04:00.0 VGA compatible controller: nVidia Corporation Device 0a76 (rev a2)
Subsystem: ASUSTeK Computer Inc. Device 8446
Kernel modules: nouveau, nvidiafb
...
Code: [Select]
Kernel driver in use: nvidia
Kernel modules: nvidia, nouveau, nvidiafb

Just some pedantry - not only is Fedora not loading the driver; it can not find it at all. You should make sure the nVidia binary driver is installed in the first place, Vanitas. ;-)

As you can see from the difference in his and your output, Viger, the list of available modules is different.

Quote from: JR
Very enjoyable read and a great description of how badly the Lenovo ThinkPad W520 works with Linux. :)

Thanks, JR. Glad you found it of value. ;) I prefer to think of it as the way things look to me at the moment, though. It could well be I was wrong in some details as there is a pile of reasons why I could not check everything as meticulously as I probably should.

I agree that the way they do look to me though, is that unfortunately, even the most capable of laptops today are designed in a way that makes you wonder... Would Rome have been built at all if it was for such... "marvellous" engineering back then? Even if it somehow miraculously was, who would have been the first person to have had the damn building collapse on their sorry selves? I seriously doubt it would have taken centuries of barbars.
A black cat crossing the street signifies that the animal is going somewhere.