Nvidia driver improvements for Fedora 25+

The Nvidia repository now contains all the remaining bits for the work done by Hans De Goede.

Making an Optimus laptop work as expected with the Nvidia drivers should be much less painful than it was a few years ago and most of the things should work out of the box on Fedora 25+.

Just enable the repository on a pristine Fedora installation, and after a while you should be able to search for Nvidia, CUDA, GeForce to Quadro to make the driver, control panel and other programs appear in your Gnome Software search:

Optimus laptops

The driver should install and operate cleanly whether you are installing it on a system which has one or more discrete Nvidia cards or an Optimus laptop with an Intel and a Nvidia card. Nothing to do to enable or configure Optimus.

This is up to the point that when the drivers are installed, you can even turn off Optimus on or off in your system Bios (if your laptop allows that) and the only difference you should see is that there’s an additional VGA card enabled in your system (check with lspci) and that the Nvidia control panel switches between a PRIME Display, like in this picture:

And a normal RandR managed one, like in this one:

Everything else should not be different from your normal experience.

Limitations

Nvidia driver

The limitations are the same as provided by the Nvidia driver, this means that if you are running it on an Optimus laptop, the Intel card can never power off. Which means higher power consumption, unfortunately. If you have an Optimus laptop and absolutely need the proprietary drivers, my suggestion is still to disable Optimus in the Bios.

OSS stack

On the contrary, if you use the OSS stack (nouveau/intel) the second card can be powered off if there’s no application running on it or display directly connected to one of the card’s outputs. That’s the best reason to use the OSS drivers at all if you you’re not doing serious gaming or 3D work:

$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynOff:0000:01:00.0

You also got the nifty selection menu about running your game on the discrete card on Gnome, which is really cool:

It will power up the video card just before launching the process. Launching a program through that menu entry is like starting it from the command line with the DRI_PRIME variable declared. For example, the same as above would be:

$ DRI_PRIME=1 quake3 &
$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynPwr:0000:01:00.0

As you can see, the discrete video card is turned on. For Steam, you still need to edit each of your game to run on the Nvidia card:

SLI systems

SLI is now enabled by default with the Auto profile, there’s nothing to do if you have a SLI system. If you need any different SLI option (AA, SFR, etc.), just override it in X.org configuration files.

Nouveau fallback

With the new expanded OutputClass support for X, as carried out by Hans, it’s now super easy to switch to the OSS stack if the proprietary Nvidia driver somehow does not work. No user space component is touched, as soon as the Nvidia kernel module is not loaded (check on /sys/module/nvidia), the desktop starts with the normal OSS components you get with a normal installation. Thanks to all the work done on libglvnd, the libraries loaded are the correct one for the driver you are running.

This means that the performance of the Nvidia card would be abysmal, but still you would get a nice desktop and browser to Google around for answers on how to fix it :).

Upgrade path from Nvidia CUDA, ELRepo and RPMFusion repositories

The current packages should allow you to upgrade if you have any Nvidia component installed on your system from one of the mentioned repositories. All upgrade paths, obsolency and packaging rename should be taken into account.

This has been cool for a few years, and actually helped me a lot in migrating some installed CUDA clusters to the packages hosted here. As part of ongoing discussions with a few parties (mostly Red Hat), this is going to disappear to allow later an opposite upgrade path to one of the other repositories (RPMFusion/Nvidia).

As of the 15th of May, all Nvidia packages will be marked with Conflicts instead of Obsoletes/Provides for all the other repositories out there. I will update the installation and repository page accordingly. If you have anything installed from the RPMFusion, ELRepo or CUDA repository from Nvidia and want to switch to the packages here after the 15th of May, you must “wildcard remove” all Nvidia and CUDA packages on your system prior to proceeding with the installation.

I’m not planning to remove any other feature in terms of capability or packaging option.

Compatibility GCC 5.3.1 package for Fedora

As some might have noticed, since a few days there’s a new compat-gcc-53 package in the Fedora repositories. This is only intended for compiling CUDA programs on Fedora where the latest update to Clang 3.9 actually broke the last compiler compatible with CUDA 8.

$ rpm -ql compat-gcc-53 compat-gcc-53-c++ | grep /bin/
/usr/bin/gcc53
/usr/bin/gcov53
/usr/bin/g++53

If you need to build a package using it, you can check for examples in the Blender and CCMiner packages as in the multimedia repository:

https://github.com/negativo17/blender/blob/master/blender.spec#L57-L61
https://github.com/negativo17/blender/blob/master/blender-2.78a-cuda.patch#L19-L23
https://github.com/negativo17/ccminer/blob/master/ccminer.spec#L75-L82

This way, I was able to provide the Blender package with CUDA support also on Fedora 26 even after the Clang update from 3.8 to 3.9.

The package is also available as a COPR repository if you prefer to use official Nvidia CUDA packages instead of the ones provided here.

To do list

Figure out what to do with the PRIME Synchronization configuration:

https://github.com/negativo17/nvidia-driver/issues/13
https://github.com/negativo17/nvidia-driver/blob/master/nvidia.conf#L2-L5

All reports have been mixed so far. On my systems (including a SLI one) works fine.

27 thoughts to “Nvidia driver improvements for Fedora 25+”

  1. ust installed fedora 26, It crashes at the login window on wayland. I can login ok with classic and xorg, any ideas? All updated after login to xorg.
    this is a copy paste of my system:
    [theport@localhost ~]$ /sbin/lspci | grep e VGA
    01:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1)
    [theport@localhost ~]$ uname -r
    4.11.8-300.fc26.x86_64
    [root@localhost theport]# dnf update
    Last metadata expiration check: 0:26:25 ago on Tue 11 Jul 2017 04:43:22 PM PDT.
    Dependencies resolved.
    Nothing to do.
    Complete!
    [root@localhost theport]#

    [theport@localhost ~]$ inxi
    CPU~Octa core AMD FX-8370 Eight-Core (-MCP) speed~4013 MHz (max) Kernel~4.11.8-300.fc26.x86_64 x86_64 Up~5 min Mem~1698.9/32135.8MB HDD~3240.7GB(0.2% used) Procs~332 Client~Shell inxi~2.3.21
    [theport@localhost ~]$

  2. How exactly do you enable/install the intel + nouveau option from this repo? Installing nvidia-settings from the repo tries to pull in nvidia-driver and other things that I suspect is the proprietary driver.

    I want the simple oss solution that lets me run off the intel card for nearly everything.

    The, assuming I had that setup, how exactly do you use /sys/kernel/debug/vgaswitcheroo/switch to power on/off the nvidia card?

    1. Ah, I forgot to mention 1) I am using the Fedora 26 beta and 2) I definitely have an optimus supported hybrid laptop (Dell XPS 15 9560)

    2. How exactly do you enable/install the intel + nouveau option from this repo? Installing nvidia-settings from the repo tries to pull in nvidia-driver and other things that I suspect is the proprietary driver.

      You don’t need to do anything. Intel + Nouveau is the Fedora default, all is already installed and configured.

      Scroll down here to OSS stack: https://negativo17.org/nvidia-driver-improvements-for-fedora-25/

  3. Hi Negativo17,

    Its a great job that you and Hans De Goede have done. I just have one query, is it possible to switch on/off Nvidia card with bbswitch using the nvidia driver packaged (or anywhere). I am not sure how it works or if it is even possible, but just a thought

    1. Bumblebee is just a hack, and is not supported everywhere. Also, shutting down the card would mean reconfiguring X to use the other card every time, which is not what Nvidia’s Optimus implementation is about.

      1. Sure, I am not aiming to achieve Nividia Optimus functionality. I just want to turn on Nvidia card when playing games, while keep it off rest of the time (to save battery). I don’t mind rebooting the system, if it comes to that. Also I don’t want to use bumblebee because it doesn’t exactly give the best performance. I only intend to use bbswitch to turn the card on/off.

  4. Is it possible to disable NVIDIA card at runtime? Or, is it possible to start with intel and on only enable NVIDIA when needed?

    1. As written in the post and in the previous comment, that’s a current limitation. If it would be possible, it wouldn’t be a limitation 🙂

      1. Thanks for the reply!
        How can I disable the NVIDIA card at boot? I can’t figure out which option I can write in grub so I don’t run with NVIDIA

  5. Looks like there are a lot of i686 packages in the x86_64 RHEL7/Centos7 repository (doesn’t look right).
    I suspect it is causing me problems with a libssh upgrade.

    1. I’m providing also 32 bit builds for libraries, that’s normal. If you look at what’s included, you will see that those are the 32 bit rebuilds of what is in EPEL/CentOS extras.
      If you want to run Steam on CentOS 7 with hardware encoding for In-Home streaming, you can with the 32 bit side of the Nvidia libraries:

      yum install nvidia-driver-libs.i686 nvidia-driver-cuda-libs.i686

      1. Hi! Let me just double check. Can the NVIDIA card power off? In the post you state that the Intel one can’t but does that implicitly mean that the NVIDIA can?

        By the way, awesome work!

        1. Please read “Limitations”. intel + nouveau, dynamic power on/off of the discrete card is perfect. intel + nvidia the discrete card is always on as it does all the rendering.

  6. Hi Simone,

    Just installed F26 alpha and updated it, enabled your repo (multimedia has 381.09 btw) and SDDM doesn’t show up, just a black screen.

    Manual session start (startx) works OK it seems.

    (Acer optimus with Intel Skylake 530HD and NVIDIA GTX950m).

    Also tried downgrading to kernel 4.10 and tried with lightdm also.

    1. The driver should install and operate cleanly whether you are installing it on a system which has one or more discrete Nvidia cards or an Optimus laptop with an Intel and a Nvidia card. Nothing to do to enable or configure Optimus.

      Regarding the last phrase and my comment above, I had to add the lines:
      xrandr –setprovideroutputsource modesetting NVIDIA-0
      xrandr –auto

      to /etc/sddm/Xsetup in order for SDDM to work and not show a black screen.

Leave a Reply