Bug 16691 - Add nvidia-prime as a better alternative to Bumblebee for Hybrid Graphics
Summary: Add nvidia-prime as a better alternative to Bumblebee for Hybrid Graphics
Alias: None
Product: Mageia
Classification: Unclassified
Component: New RPM package request (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
Depends on:
Reported: 2015-09-03 06:21 CEST by Kristoffer Grundström
Modified: 2016-11-11 12:46 CET (History)
3 users (show)

See Also:
Source RPM: nvidia-prime
Status comment:


Description Kristoffer Grundström 2015-09-03 06:21:14 CEST
Description of problem: I managed to get Mageia 5 installed in my brand new laptop (a Asus N550JK with Hybrid Graphics which mean that I've got a 4th Generation Intel Graphics card along with GeForce GTX 850M) a while ago and then I experienced problems with slow/delayed kernel boot sequence, and a while ago I installed Ubuntu 15.04 to see if the problem with the graphics exist even there and YES, it does exist. As I went to #ubuntu on IRC to ask how to fix this issue (if only temporary) I was told to get rid of bumblebee as bumblebee is now deprecated (which I installed from Emergency Mode in Mageia 5 after first reboot) and to use nvidia-prime instead.

After I uninstalled Bumblebee and installed nvidia-prime I can now start X without delay and I can even login to Unity. There's NO package for any RPM-based distro AFAIK.

Version-Release number of selected component (if applicable): 0.8.1

How reproducible: All the time.

Steps to Reproduce:
1. Find a similar computer with same specs when it comes to graphics as mine.
2. Install Mageia 5 with KDE, GNOME, Cinnamon, MATE.
3. In the summary, please untick the box for ACPI in the graphics setup.
4. Reboot.
5. At the GRUB menu press the letter e and remove quiet splash from the kernel boot line. You might need to add noacpi or acpi=off as well. I had problems with step 3.
4. At the boot of the kernel press ESC to see that you've ended up in Emergency Mode.
5. Type your root password and press Enter/Return/Execute-button.
6. Install bumblebee by typing urpmi bumblebee --auto.
7. Reboot and you'll still get delayed boot.
8. Uninstall bumblebee and install nvidia-prime instead.
9. Reboot.
10. Voila! No visible delay anymore.


Steps to Reproduce:
Comment 1 Kristoffer Grundström 2015-09-03 06:21:55 CEST
Here's the code for nvidia-prime: https://launchpad.net/ubuntu/+source/nvidia-prime
Kristoffer Grundström 2015-09-03 06:22:27 CEST

CC: (none) => kristoffer.grundstrom1983
Target Milestone: --- => Mageia 6

Comment 2 Kristoffer Grundström 2015-09-03 06:37:58 CEST
Here's how to install and configure the Optimus driver in Ubuntu: http://xmodulo.com/install-configure-nvidia-optimus-driver-ubuntu.html
Comment 4 Rémi Verschelde 2015-09-03 07:34:08 CEST
AFAIK nvidia-prime is a Ubunutu-specific collection of scripts, we can't use it. I do want to check what the modern Linux world has to propose nowadays as an alternative to bumblebee for non-Ubuntu systems.

The nvidia-kmod package from RPM Fusion is just the nvidia driver to compile with changing kernels, just like our dkms-nvidia.
Comment 5 Kristoffer Grundström 2015-09-03 07:55:54 CEST
Remi: Well, did you read about the difference between kmod and akmod?
Comment 6 Rémi Verschelde 2015-09-03 08:00:31 CEST
(In reply to Kristoffer Grundström from comment #5)
> Remi: Well, did you read about the difference between kmod and akmod?

Well after reading again, akmod == dkms in our repos, while nvidia-kmod would be the precompiled nvidia-current module. Still not particularly relevant as far as optimus laptop are concerned.
Comment 7 Kristoffer Grundström 2015-09-03 08:28:34 CEST
But the standard installation with xorg-driver-video-nouveau stalls the computer after first reboot after a long delay so you have any idea on a working fix?
Comment 8 Kristoffer Grundström 2015-09-03 10:06:46 CEST
http://pastebin.com/yPCJYyAR shows everything we need to make a working test-rpm to put in Cauldron.
Comment 9 Rémi Verschelde 2015-09-03 10:14:27 CEST
Thanks, but you can trust me, making a RPM of nvidia-prime would be useless as this is only a bunch of _Ubuntu-specific_ scripts. I.e. nvidia-prime relies on dpkg and configuration stuff that only work in Ubuntu, just like the Mageia Control Center would not work as expected if run in Ubuntu.
Comment 10 Samuel Verschelde 2016-10-10 22:36:57 CEST
Closing as wontfix as per comment #9.

Resolution: (none) => WONTFIX
Target Milestone: Mageia 6 => ---

Comment 11 Rémi Verschelde 2016-10-12 13:57:47 CEST
Giuseppe investigated this a bit lately and might have a different opinion, so CC'ing him in case he wants to reopen and see it worked on e.g. for the Mageia 7 milestone.

CC: (none) => ghibomgx

Comment 12 Samuel Verschelde 2016-10-12 14:57:16 CEST
(In reply to Rémi Verschelde from comment #11)
> Giuseppe investigated this a bit lately and might have a different opinion,
> so CC'ing him in case he wants to reopen and see it worked on e.g. for the
> Mageia 7 milestone.

Then I'd advise opening a new bug report linked to this one for cleaner history.
Comment 13 Giuseppe Ghibò 2016-10-12 15:38:34 CEST
OK, I open a new bug report (sort of nvidia-prime package request) which summarize what follows.

IMHO stuff is a lot easier than it apparently seems if would be satisfied in a moderate approach about getting the nvidia card working as first and only graphics card like it was before the Optimus technology in 2010 where you could easily disable hybrid graphics from BIOS, or like it happens when you actually use an external desktop nvidia graphics card with proprietary drivers.

Don't confuse with the "conflicts" between nvidia proprietary drivers and nouveau, or other problems with nouveau itself, because that's another stuff. The nouveau kernel module is usually automatically loaded when an nvidia card is found. To avoid or get rid of this one have either to pass nouveau.modeset=0 to the booting command line (or patch the nouveau kernel module so that it's not automatically loaded but that's a lot more complicate). Blacklisting nouveau in modprobe.conf.d is usually not enough.

What the ubuntu approach seems to do, is that they have actually two
set of big scripts one is gpu-manager and the other is nvidia-prime. I
had a quick glance to them (so don't take this as written in stone), and
seems that one set is for switching the GL libraries from mesa to the
proprietary libGL, the other is to write a xorg.conf file (they
usually don't ship by default any xorg.conf file) with the proper
configuration, and that it "inactive"(S) the intel driver, and the latest
is to trigger the discrete card in a /proc switch in a loaded kernel
module called "bbswitch" (which we already had packaged as dkms since
it's already needed by bumblebee).

More or less part of this stuff is already available in mageia, in fact:

1) the switching between proprietary GL and Mesa configuration we already did in %post scripts of proprietary drivers or XFdrake just using:

update-alternatives --set gl_conf <nvidia.conf>

2) The xorg.conf is already configured with the nvidia proprietary drivers by XFdrake. What lacks is just the part:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"

to have inactive intel. And adding the proper BusID PCI:X:Y:Z for
nvidia card.

3) Adding some initrd scripts. This is needed which just read a var set in /etc/sysconfig/nvidia-prime for instance and run some trigger echo to > /proc/acpi/bbswitch.

SuSe has also a similar approach with a mini-utility called
SuSE-prime, IIRC they also play with xrandr. And appends the following
options to the nvidia device section of xorg.conf

    Option "AllowEmptyInitialConfiguration" "on"
    Option "UseDisplayDevice" "None"

I hadn't yet the time to experiment further. IMHO just backporting
nvidia-prime package "as is" is even more complicate as they use
scripts we don't need or don't have.
Comment 14 Giuseppe Ghibò 2016-10-13 01:25:21 CEST
OK, more or less the approach could be like this (the bbswitch isn't indeed needed anymore):

1) configure the nvidia card with XFdrake using proprietary drivers,
this will create a default xorg.conf and also will switch the GL libraries to the nvidia ones, using this command:

/usr/sbin/update-alternatives --set gl_conf /etc/nvidia-current/ld.so.conf
ldconfig -v

this is also what the prime-switch like utils of other distros more or less do.

2) prepare an /etc/X11/xorg.conf with minimal entries, which is like this:

------ xorg.conf -----------------
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"

Section "Device"
Identifier "intel"
Driver "modesetting"
Option "AccelMethod" "None"

Section "Screen"
Identifier "intel"
Device "intel"

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"

Section "Screen"
Identifier "nvidia"
Device "nvidia"

as stated here:


The BusID is the PCI-ID shown for the nvidia graphics card. And 

3) add the script:

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

somewhere in the X11 init scripts. Note that the AllowEmptyInitialConfiguration as well as the UseDisplayDevice soptions eems actually ignored, so we don't add them here.
Curtis Hildebrand 2016-10-14 09:01:32 CEST

CC: (none) => curtis_mageia

Comment 15 Samuel Verschelde 2016-11-11 12:46:48 CET
You said you opened a new bug report but you still comment here. Have I missed the new bug report?

Note You need to log in before you can comment on or make changes to this bug.