Nvidia driver, CUDA tools and libraries

nvidia-logo-1

Oh no, another Nvidia driver repository? Why? This repository reflects my personal view for the way the driver should be packaged for Fedora and CentOS/RHEL. It’s somewhat different from ELRepo repositories for RHEL/CentOS and from RPMFusion packages for Fedora.

Repository installation

To install the repository on a supported Fedora distribution, run as root the following command:

dnf config-manager --add-repo=https://negativo17.org/repos/fedora-nvidia.repo

To install the repository on CentOS/RHEL:

yum-config-manager --add-repo=https://negativo17.org/repos/epel-nvidia.repo

The Nvidia software packages are available for installation by default also in Gnome Software.

Please note that the driver will show up only if your system matches one of the PCI ID supported by the driver. Otherwise, only the other Nvidia programs (mostly for CUDA development) will show up in the software center.

What’s different?

First of all the packaging is a lot simplified; more stuff is compiled from source, smaller packages and more options. This packages try to comply as maximum to the Fedora Packaging Guidelines; which means they have debuginfo packages, default Fedora’s GCC compile time options (where possible) and standard locations for binaries, data and docs.

What follows below, is a detailed explanation of all the “differences” from the various Nvidia driver packages that I was able to spot on the web and a detailed description on how to install components, etc.

Nvidia drivers

Packaging

  • nvidia-settings, nvidia-persistenced, nvidia-xconfig and nvidia-modprobe are compiled from source.
  • All RPM filters except for GL and OpenCL libraries have been removed, so there is no weird dependency option in the SPEC file. RPM pulls in all correct requirements on its own. This is to avoid pulling in the Nvidia drivers instead of the Mesa libraries or in place of the new open source OpenCL support that’s in Fedora.
  • Simplified packaging with much simpler and readable SPEC file.
  • Dependency on libva-vdpau-driver. So in Totem, or any other libVA supported application you can benefit from VDPAU acceleration.
  • Sources are generated with a script and inserted individually in the various packages; so it can be easily reproduced just by changing the version and rerunning the script.
  • nvidia-xconfig is not required on anything that uses the modular X.org directives, as it writes too much in the configuration file (keyboards, monitors, etc.) and the required entries should be written in separate configuration files under /etc/X11/xorg.conf.d. The package is still available as it’s required to speed up some configuration like multi-monitor setups with SLI Mosaic enabled from the command line, but not installed by default.
  • The NVIDIA OpenGL-based Framebuffer Capture (NvFBCOpenGL) libraries (NvFBC and NvIFR) are private APIs that are only available to NVIDIA approved partners for use in remote graphics scenarios (i.e. Steam In-Home Streaming hardware encoding); so they are packaged in another small package called nvidia-driver-NvFBCOpenGL.
  • The nvidia-settings package now builds the external libXNVCtrl.so library that can be used to control the graphic cards through the NV-CONTROL extension. This library updates the old and obsolete one in Fedora.
  • The nvidia-settings binary is compiled with GTK3 instead of GTK2 on Fedora and RHEL/CentOS 7+.
  • The driver can be installed separately from the nvidia-settings utility, so if you simply want a working driver and do not care about details, your experience should be as close as possible to the one with open source drivers.

Versioning

  • ELRepo ships 32 bit compatibility libraries in a separate package with x86_64 as the architecture and “32bit” in the name. 32 bit libraries should be like in RPMFusion, with an i686 package installable in parallel with the x86_64 one. There are no other packages in the distribution that are built for x86_64, with “32bit” in their name that contain i686 binaries (!), so Nvidia drivers should not be an exception. So no separate “32bit.x86_64” package for 32 bit libraries also on CentOS/RHEL; just install nvidia-driver-libs.i686.
  • Versions are not hidden; all packages have the same driver version.
  • No alternatives system, only the latest version which integrates CUDA support is available. For older releases nouveau works great; and anything below a GeForce 8xxx it’s in my opinion too low end to play anything modern. And Quake 3 and Doom 3 work greatly with nouveau, so that’s not a case!
  • The CentOS/RHEL repository contains the “Long Lived Branch version” where less changes occur; while Fedora repositories contains the “Short Lived Branch version”. Beta CentOS/RHEL and Fedora’s rawhide repositories will contain the “Beta Branch version”

CUDA support

  • CUDA libraries/tools for the driver are split into subpackages. There’s no need to install all the CUDA libraries and tools on a system that has only one adapter and is used for occasional gaming or for simple office use. This can save ~120 MB worth of installed libraries. nvidia-persistenced falls in this category as it’s not needed on a normal laptop or gaming system.
  • Complete packaged CUDA stack has been added for all supported distributions, all the packages provide/require/obsolete the relevant packages in the Nvidia CUDA repository; so you can enable this repository along with the official Nvidia CUDA one (x86_64 systems only).

Kernel modules

  • Multiple choice of kernel module packages; akmod (RPMFusion) for Fedora and binary kmod (Kernel ABI whitelists) for CentOS/RHEL. In addition to this, on both distributions dkms packages are available. This way all cases and personal preferences are covered for both distributions.
  • The Nvidia udev rules leverage nvidia-modprobe command in the system to create devices and set permissions even when the userspace libraries have not been loaded yet, covering the case of Wayland only sessions and compute only system without display userspace components installed.
  • The nvidia-uvm module has a soft dependency on the nvidia module, making sure that these modules are not included in the initrd (thing that would happen by using systemd’s configuration (module-s-load.d). UDev rules make sure the module has proper permissions.
  • Choice of proprietary or open source license kernel modules.

Default configuration

  • Dracut options are depending on the distribution; so no more “vga=normal is an obsolete option” at boot. Each distribution gets its own specific GRUB options for booting.
  • 96 DPI is written in the default xorg.conf config file. Why? Gnome 3 by defaults hard-codes a 96×96 DPI resolution, most of the free drivers do (intel, nouveau, etc.) as the EDID is almost never reliable (please see the excellent Adam’s Jackson post where he explains this). As an example, if you install the Nvidia drivers on a RHEL/CentOS 6 laptop where you used to have nouveau installed (96 DPI hardcoded), the fonts gets 90% of the time supersize and ugly as Gnome 2 and the Nvidia driver do not hard-code 96 DPI like Gnome 3.
  • Make X.org NVIDIA Files section to be loaded latest in case there are other packages providing a custom Files section.
  • Use new OutputClass directive on X.org server 1.16 (and later) to load the driver and do not rely on an edited /etc/X11/xorg.conf file. This also removes editing of the xorg.conf file from the package scriptlets. This does not hardcode the 96 DPI resolution.
  • Add the IgnoreABI directive by default on Fedora rawhide builds.

Kernel modesetting and Wayland support

Kernel mode setting on the nvidia-drm module is enabled by default along with the console frame buffer driver.

Distribution and Nvidia driver version support

Here is a rundown of Nvidia supported drivers and options split by distribution. Basically, CentOS/RHEL will always get a Long Lived branch release if possible, Fedora always a Short Lived branch release, and unreleased distributions will always get a Beta driver.

Operating systemCentOS / RHELFedorarawhide
Driver branchLong LivedShort Lived
Long Lived
Short Lived
Long Lived
Beta
Video Codec SDKYesYesYes
Architectures:

x86_64
YesYesYes
Basic nvidia driver:

nvidia-driver
nvidia-driver-libs
nvidia-libXNVCtrl
nvidia-kmod-common
YesYesYes
CUDA libraries and tools:

nvidia-driver-cuda
nvidia-driver-cuda-libs
nvidia-driver-NVML
nvidia-persistenced
YesYesYes
OpenGL Framebuffer Capture:

nvidia-driver-NvFBCOpenGL
YesYesYes
Nvidia tools:

nvidia-modprobe
nvidia-settings
nvidia-xconfig

YesYesYes
Binary kernel
modules (kABI):

kmod-nvidia
YesNoNo
DKMS kernel
modules:

dkms-nvidia
YesYesYes
aKMOD kernel
modules:

akmod-nvidia
NoYesYes
32 bit compatibility on x86_64:

nvidia-libXNVCtrl
nvidia-driver-libs
nvidia-driver-cuda-libs
nvidia-driver-NVML
YesYesYes
Development

nvidia-driver-devel
nvenc
nvenc-samples
YesYesYes
GLVND librariesYesYesYes
VDPAU librariesYesYesYes
EGLStream-based Wayland external platformYesYesYes
GBM EGL external platform libraryYesYesYes

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 with the 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.

Limitations with the 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 :).

Sample installation

Here is an example. Let’s assume you have a freshly installed CentOS system with a recent Nvidia GPU and you want to:

  • Install the driver for gaming
  • Play Vulkan enabled games
  • Want to be comfortable with the Nvidia control panel
  • Play 32 bit games (Vulkan included) on a 64 bit system
  • Play 32 bit Vulkan games on a 64 bit system
# yum install nvidia-driver nvidia-driver-libs.i686
Last metadata expiration check: 0:05:30 ago on Tue 05 Feb 2019 06:52:50 AM CET.
Dependencies resolved.
================================================================================
 Package                   Arch     Version           Repository           Size
================================================================================
Installing:
 nvidia-driver             x86_64   3:415.27-4.fc29   fedora-multimedia   2.4 M
 nvidia-driver-libs        i686     3:415.27-4.fc29   fedora-multimedia    18 M
Installing dependencies:
 akmod-nvidia              x86_64   3:415.27-1.fc29   fedora-multimedia    10 M
 nvidia-driver-cuda-libs   x86_64   3:415.27-4.fc29   fedora-multimedia    25 M
 nvidia-driver-libs        x86_64   3:415.27-4.fc29   fedora-multimedia    34 M
 nvidia-kmod-common        noarch   3:415.27-1.fc29   fedora-multimedia    10 k
 akmods                    noarch   0.5.6-17.fc29     updates              22 k
 egl-wayland               x86_64   1.1.1-3.fc29      updates              29 k
 kernel-devel              x86_64   4.20.6-200.fc29   updates              13 M
 mesa-libEGL               i686     18.2.8-1.fc29     updates             112 k
 mesa-libgbm               i686     18.2.8-1.fc29     updates              39 k
 libglvnd-egl              i686     1:1.1.0-2.fc29    fedora               45 k
 libglvnd-gles             i686     1:1.1.0-2.fc29    fedora               32 k
 libglvnd-opengl           i686     1:1.1.0-2.fc29    fedora               37 k
 libglvnd-opengl           x86_64   1:1.1.0-2.fc29    fedora               39 k
 libva-vdpau-driver        x86_64   0.7.4-22.fc29     fedora               60 k
 libwayland-server         i686     1.16.0-1.fc29     fedora               38 k

Transaction Summary
================================================================================
Install  17 Packages

Total download size: 103 M
Installed size: 385 M
Is this ok [y/N]:

As you can see, this system has akmod enabled kernel modules and libraries for running 32 bit applications. The amount of data to download for the drivers is really small compared to packages that contain CUDA libraries and tools.

Package installation

If you are booting the system in UEFI mode; as a prerequisite to installing any external module (not built into the kernel package), you have to disable UEFI Secure Boot in the system configuration. All modules contained in the kernel package are signed with keys that are generated during build and deleted when packaging. If you want to preserve Secure Boot, you need to sign the modules yourself and import the keys into your hardware module. Doing so is out of scope here; if you need a decent guide just follow Red Hat’s guide for signing kernel modules.

First of all remove all the Nvidia drivers you might have on your system due to RPMFusion, ELRepo, or the Nvidia CUDA repository. This is usually accomplished with the following root command:

yum -y remove *nvidia*

Then, to install the Nvidia driver and its control panel utility in CentOS/RHEL with the binary kABI (Kernel ABI whitelist) module (this is the default on CentOS/RHEL), perform the following command:

yum -y install nvidia-driver nvidia-settings

To do the same in Fedora, using akmod modules, perform the following command:

dnf -y install nvidia-driver nvidia-settings

Specific driver installations

For both Fedora and CentOS/RHEL distributions it’s possible to install additional packages and / or variant of the basic kernel modules. This paragraph contains some examples. Make sure you have the EPEL repository enabled if you plan to use DKMS modules on CentOS/RHEL.

akmod kernel module variant (Fedora):

dnf -y install nvidia-driver akmod-nvidia

DKMS kernel module variant (Fedora/CentOS/RHEL):

yum/dnf -y install nvidia-driver dkms-nvidia

To add 32 bit libraries on a 64 bit system (for games or applications like Steam):

yum/dnf -y install nvidia-driver-libs.i686

Proprietary and open source kernel modules

Since almost a year, the Nvidia driver ships with two different implementations of the kernel modules, one proprietary and one open source. The open source one as of drivers 545.x is now considered beta quality also for the workstations, so it seems a good moment to start shipping it.

The open source one is supposed to be the only one that will be kept in the future, but at the moment both are available and both differ in terms of functionality. You can read about the main differences in terms of functionality and what chips they support in the official documentation.

I did not want to introduce another variation of the kernel modules beside akmods, kABI and DKMS, this would have created even more confusion and lots of dependencies in the SPEC files for the variations. The new akmod and DKMS packages ship both sources (MIT/GPL and proprietary kernel modules) and allow you to switch between one or the other through a configuration file.

Considering that in the long run only the open source variant will remain, I wanted to make this as transparent as possible for the users. Basically, if you don’t care and just want something that works, nothing has changed for you.

The two sources get referenced as they are referenced inside the Nvidia run file, namely “kernel” for the original proprietary kernel modules and “kernel-open” for the new open source variation.

The following instructions show you how to switch between one implementation or the other.

DKMS

Check which version you have installed:

# modinfo -l nvidia
NVIDIA

Change the type of modules you want to use and trigger a rebuild and a reinstall:

# sed -i -e 's/kernel$/kernel-open/g' /etc/nvidia/kernel.conf
# dkms build -m nvidia/545.29.02 --force
# dkms install -m nvidia/545.29.02 --force

Now check again the license and you should see that it has changed to MIT/GPL:

# modinfo -l nvidia
Dual MIT/GPL
# reboot

To switch back, change the configuration again and then trigger the same process for rebuilding installing:

# sed -i -e 's/kernel-open$/kernel/g' /etc/nvidia/kernel.conf
# dkms build -m nvidia/545.29.02 --force
# dkms install -m nvidia/545.29.02 --force
# reboot

akmods

Check which version you have installed:

# modinfo -l nvidia
NVIDIA

Change the type of modules you want to use and trigger a rebuild and a reinstall:

# sed -i -e 's/kernel$/kernel-open/g' /etc/nvidia/kernel.conf
# akmods --rebuild

Now check again the license and you should see that it has changed to MIT/GPL:

# modinfo -l nvidia
Dual MIT/GPL
# reboot

To switch back, change the configuration again and then trigger the same process for rebuilding installing:

# sed -i -e 's/kernel-open$/kernel/g' /etc/nvidia/kernel.conf
# akmods --rebuild
# reboot

Additional driver configuration to your system

To add additional configuration to your system, just create the /etc/X11/xorg.conf file. For example:

Section "Device"
Identifier "Device0"
Driver "nvidia"
Option "NoLogo" "true"
Option "DPI" "96 x 96"
Option "SLI" "Auto"
Option "nvidiaXineramaInfoOrder" "DFP-0"
Option "metamodes" "GPU-a493fbbb-7d76-86a2-8764-d76d487a75a7.DVI-I-1: nvidia-auto-select +0+0, GPU-c02960a4-be28-d5ce-8b02-be04b5e2550b.DVI-I-1: nvidia-auto-select +1680+0"
Option "BaseMosaic" "on"
EndSection

In this example we have 2 video cards with one monitor each, so we enabled SLI, Base Mosaic to have multi monitor support on SLI and make a layout with the second GPU monitor on the right of the first one. Also, we fix the DPI to 96×96, which is the hardcoded default in Gnome and in Open Source drivers.

Configuration for CUDA only systems

Your system might only be used for CUDA development and not require the X server to be running the DDX driver at all, so you might want to tweak the configuration a bit to make the system load (for example) the Intel driver as the main display and just the Nvidia driver for GPU workloads. In this case you have two options.

Option with only CUDA components installed

To install just the CUDA components of the driver and not the OpenGL libraries and all files required by the DDX part of the driver, proceed to install as follows:

# yum install nvidia-driver-cuda
Last metadata expiration check: 0:22:51 ago on Tue 05 Feb 2019 06:52:50 AM CET.
Dependencies resolved.
================================================================================
 Package                   Arch     Version           Repository           Size
================================================================================
Installing:
 nvidia-driver-cuda        x86_64   3:415.27-4.fc29   fedora-multimedia   308 k
Installing dependencies:
 akmod-nvidia              x86_64   3:415.27-1.fc29   fedora-multimedia    10 M
 nvidia-driver-NVML        x86_64   3:415.27-4.fc29   fedora-multimedia   457 k
 nvidia-driver-cuda-libs   x86_64   3:415.27-4.fc29   fedora-multimedia    25 M
 nvidia-kmod-common        noarch   3:415.27-1.fc29   fedora-multimedia    10 k
 nvidia-persistenced       x86_64   3:415.27-2.fc29   fedora-multimedia    40 k
 akmods                    noarch   0.5.6-17.fc29     updates              22 k
 kernel-devel              x86_64   4.20.6-200.fc29   updates              13 M

Transaction Summary
================================================================================
Install  8 Packages

Total download size: 49 M
Installed size: 168 M
Is this ok [y/N]:

As you can see, there are no components providing OpenGL or DDX drivers installed on the system. This will not use any X (or Wayland) configuration compared to what has been installed by default on your system.

On top of this, you can still select what kind of kernel modules you want ot have installed (kABI, akmods and dkms).

The device files are created by the udev rules that call the nvidia-modprobe command, it contains a SUID binary that creates the device files and set the appropriate permissions. The same binary is called directly by Nvidia libraries when accessing a user space component that would require device files access:

$ for i in $(rpm -ql nvidia-driver-libs.x86_64 nvidia-driver-cuda-libs.x86_64 | grep \.so); do
  strings $i | grep nvidia-modprobe > /dev/null && echo $i
done
/usr/lib64/gbm/nvidia-drm_gbm.so
/usr/lib64/libnvidia-allocator.so.1
/usr/lib64/libnvidia-allocator.so.545.29.02
/usr/lib64/libnvidia-api.so.1
/usr/lib64/libnvidia-cfg.so.1
/usr/lib64/libnvidia-cfg.so.545.29.02
/usr/lib64/libnvidia-eglcore.so.545.29.02
/usr/lib64/libnvidia-glcore.so.545.29.02
/usr/lib64/libnvidia-glsi.so.545.29.02
/usr/lib64/vdpau/libvdpau_nvidia.so.1
/usr/lib64/vdpau/libvdpau_nvidia.so.545.29.02
/usr/lib64/libcuda.so
/usr/lib64/libcuda.so.1
/usr/lib64/libcuda.so.545.29.02
/usr/lib64/libnvcuvid.so
/usr/lib64/libnvcuvid.so.1
/usr/lib64/libnvcuvid.so.545.29.02
/usr/lib64/libnvidia-opencl.so.1
/usr/lib64/libnvidia-opencl.so.545.29.02

This requires some testing and adjustments with specifics to your setup, but is definitely possible to use the integrated Intel card and or rely on a system without X installed to run the CUDA components.

CUDA

Packaging

  • Previously in the repository was included the GPU Deployment kit. This was constructed with NVML (NVIDIA Management Library) headers, docs and samples from a separate tarball. The separate tarball was using a different version number than the drivers and was packaged in the nvidia-driver-NVML and nvidia-driver-NVML-devel packages. Starting from CUDA version 8, the NVML header is provided by a CUDA subpackage (cuda-nvml-devel) and no longer provided as part of the GPU Deployment kit.
  • Included is also the Video Codec SDK (Decoder/Encoder) headers, docs and code samples. Again, this uses a different version than the drivers.
  • All the libraries are split into subpackages, much like in the original Nvidia CUDA repository. This allows you to install and build software relying on specific components without the need to install all the CUDA toolkit just to satisfy a library dependency. Also, for the same reason, static libraries have been included in each respective static subpackage.
  • In addition to the libraries bundled in the CUDA toolkit, also the cuDNN library for distributed neural networks is included in the repository. See the table below for details.

Distribution and CUDA version support

All the currently supported Red Hat Enterprise Linux versions (including rebuilds and similar forks – CentOS Stream, AlmaLinux, RockyLinux, EuroLinux, etc.) and Fedora versions are available.

In case of yet unsupported compilers in recent distributions, a compatibility cuda-gcc package is available that brings the distribution to a working level with nvcc.

By installing the cuda-gcc package, a variable is loaded automatically that adds the appropriate NVCC options to override the default system GCC when compiling:

$ cat /etc/profile.d/cuda-gcc.sh 
export NVCC_PREPEND_FLAGS='-ccbin /usr/bin/cuda'

CUDA installations

To install just a runtime CUDA support (required for running CUDA enabled programs), without DDX drivers:

yum -y install cuda nvidia-driver-cuda

To just install packages required for enabling CUDA development:

yum -y install cuda-devel

Or if you just want to enable everything:

dnf/yum -y install nvidia-driver nvidia-driver-cuda cuda-devel

A couple of examples. Just the basic tools:

# yum install cuda
Last metadata expiration check: 0:30:55 ago on Tue 05 Feb 2019 06:52:50 AM CET.
Dependencies resolved.
================================================================================
 Package                  Arch    Version              Repository          Size
================================================================================ Installing: cuda x86_64 1:10.0.130-1.fc29 fedora-multimedia 17 M Installing dependencies: cuda-libs x86_64 1:10.0.130-1.fc29 fedora-multimedia 8.6 M nvidia-driver-cuda-libs x86_64 3:415.27-4.fc29 fedora-multimedia 25 M Transaction Summary ================================================================================ Install 3 Packages Total download size: 51 M Installed size: 178 M Is this ok [y/N]:

The basic tools along with all the libraries (note that the NVML headers are included):

# yum install cuda-devel
Last metadata expiration check: 0:35:09 ago on Tue 05 Feb 2019 06:52:50 AM CET.
Dependencies resolved.
================================================================================
 Package                  Arch    Version              Repository          Size
================================================================================
Installing:
 cuda-devel               x86_64  1:10.0.130-1.fc29    fedora-multimedia  1.6 M
Installing dependencies:
 cuda                     x86_64  1:10.0.130-1.fc29    fedora-multimedia   17 M
 cuda-cublas              x86_64  1:10.0.130-1.fc29    fedora-multimedia   31 M
 cuda-cublas-devel        x86_64  1:10.0.130-1.fc29    fedora-multimedia   32 M
 cuda-cudart              x86_64  1:10.0.130-1.fc29    fedora-multimedia  135 k
 cuda-cudart-devel        x86_64  1:10.0.130-1.fc29    fedora-multimedia  533 k
 cuda-cufft               x86_64  1:10.0.130-1.fc29    fedora-multimedia   64 M
 cuda-cufft-devel         x86_64  1:10.0.130-1.fc29    fedora-multimedia  127 M
 cuda-cupti               x86_64  1:10.0.130-1.fc29    fedora-multimedia  1.4 M
 cuda-cupti-devel         x86_64  1:10.0.130-1.fc29    fedora-multimedia  226 k
 cuda-curand              x86_64  1:10.0.130-1.fc29    fedora-multimedia   38 M
 cuda-curand-devel        x86_64  1:10.0.130-1.fc29    fedora-multimedia   61 M
 cuda-cusolver            x86_64  1:10.0.130-1.fc29    fedora-multimedia   40 M
 cuda-cusolver-devel      x86_64  1:10.0.130-1.fc29    fedora-multimedia   15 M
 cuda-cusparse            x86_64  1:10.0.130-1.fc29    fedora-multimedia   27 M
 cuda-cusparse-devel      x86_64  1:10.0.130-1.fc29    fedora-multimedia   28 M
 cuda-libs                x86_64  1:10.0.130-1.fc29    fedora-multimedia  8.6 M
 cuda-npp-devel           x86_64  1:10.0.130-1.fc29    fedora-multimedia   58 M
 cuda-nvgraph             x86_64  1:10.0.130-1.fc29    fedora-multimedia   68 M
 cuda-nvgraph-devel       x86_64  1:10.0.130-1.fc29    fedora-multimedia   13 k
 cuda-nvjpeg              x86_64  1:10.0.130-1.fc29    fedora-multimedia  372 k
 cuda-nvjpeg-devel        x86_64  1:10.0.130-1.fc29    fedora-multimedia   14 k
 cuda-nvml-devel          x86_64  1:10.0.130-1.fc29    fedora-multimedia   53 k
 cuda-nvrtc               x86_64  1:10.0.130-1.fc29    fedora-multimedia  6.3 M
 cuda-nvrtc-devel         x86_64  1:10.0.130-1.fc29    fedora-multimedia   15 k
 cuda-nvtx                x86_64  1:10.0.130-1.fc29    fedora-multimedia   33 k
 cuda-nvtx-devel          x86_64  1:10.0.130-1.fc29    fedora-multimedia   41 k
 nvidia-driver-NVML       x86_64  3:415.27-4.fc29      fedora-multimedia  457 k
 nvidia-driver-cuda-libs  x86_64  3:415.27-4.fc29      fedora-multimedia   25 M

Transaction Summary
================================================================================
Install  29 Packages

Total download size: 650 M
Installed size: 1.6 G
Is this ok [y/N]:

An example where your CUDA application just uses the CUDA Runtime API and not the kernel runtime:

$ sudo dnf install cuda-cudart
Last metadata expiration check: 0:13:10 ago on Sun Oct 23 13:11:01 2016.
Dependencies resolved.
================================================================================
 Package           Arch         Version               Repository           Size
================================================================================
Installing:
 cuda-cudart       x86_64       1:8.0.44-4.fc24       fedora-nvidia       131 k

Transaction Summary
================================================================================
Install  1 Package

Total size: 131 k
Installed size: 536 k
Is this ok [y/N]:

This will avoid you pulling in all the libraries as before just because you need a single library. This is useful for example for programs that leverage just some part of the CUDA toolkit, like the Nvidia Performance Primitives for image and signal processing in FFmpeg, and similar things.

Bugs

Just open an issue to the specific package on GitHub.

1,258 thoughts to “Nvidia driver, CUDA tools and libraries”

  1. Thanks so much for the ease your packaging provides.

    As of F20 (running F21 now) the proprietary driver stopped responding to adjustments to backlight brightness and remains stuck at, I’m guessing, around 90%.

    I’m running a GT218M [NVS 3100M] (from your fedora-nvidia-340 repo).

    I’m curious if you have any thoughts on this.

    Thanks.

  2. Usually in my Korora I can log-in as user xy and then switch to a log-in for a second user (or more) simultaneously without logging out user xy. I can have two or more users logged-in the same time and jumping from one user to another without logging out a user.

    This is not possible with my Korora 21 (Fedora 21) with recent nvidia drivers installed out of repo http://negativo17.org/repos/fedora-nvidia.repo

    As soon as trying to log-in a second user I get a “OOPS something went wrong” (from Gnome) on console 2 (Ctrl-Alt-F2) and the already logged-in user on console 1 is logged-out automatically.

    May be this due to problems with graphic drivers and/or Xorg.

    Here is what happens.

    What is wrong?

    Rgds
    AW

    1. If you look at the log, you can see that there are numerous errors (EE). Are you sure you have only the bundled /etc/X11/xorg.conf.d/*nvidia* files?

      1. ls -all /etc/X11/xorg.conf.d
        insgesamt 20
        drwxr-xr-x. 2 root root 4096 13. Mär 09:44 .
        drwxr-xr-x. 6 root root 4096 30. Jan 08:42 ..
        -rw-r–r–. 1 root root 232 22. Jan 11:30 00-keyboard.conf
        -rw-r–r–. 1 root root 106 5. Aug 2014 99-nvidia-driver.conf
        -rw-r–r–. 1 root root 227 25. Feb 15:10 99-nvidia-modules.conf

        Look also at this http://fpaste.org/205473/14278221/raw/

        Nothing else found.

        I have now

        uname –all
        Linux xyz 3.19.1-201.fc21.x86_64 #1 SMP Wed Mar 18 04:29:24 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

        But also with older kernels these problems were existing.

        Rgds
        AW

          1. It is not, on Fedora 22+ the driver is loaded through the drm class (file /etc/X11/xorg.conf.d/99-nvidia-driver.conf). I don’t ship the file you’re mentioning in my packages, so don’t know where you got it.

  3. Thanks! I install 340 drivers from your repository, and a few days everything was fine, but then (possibly after Yum partial update, but without kernel!) was again loaded driver novieau and disappeared 3-D effects… How to disable novieau and check the installation?..

  4. Hi!
    Thanks for the repos. Everything is working great! However, I have a questions. I’m sorry if it’s very “newbie” for all of you, but I figure that other might have the same question.

    All I did to install the driver was:
    – Install repo
    – Remove othe nvidia drivers
    – And: yum -y install nvidia-driver cuda

    I thought that I would need the akmod module to make sure that the driver do not breatk after kernel update. But I did not install it, did 2 kernel update after that and everything is working great still.

    So, my question: On a standard Fedora installation,
    – Why would I install akmod modules?
    – Why would I install dkms driver?

    Thank you!

    1. If you have installed nvidia-driver and did not specify akmod or dkms, you will get akmod by default on Fedora. Do you need cuda?

      1. ok, got it. Thanks for the reply.
        You are right. I probably don’t have any programs using cuda… Handbrake maybe? Probably not. I installed it, I figured that it would not do much harm to have it installed…

  5. Hi! Whether it is possible install driver version 340xx? My graphics card – NVidia 200, so never version of the driver does not work …

  6. Hey– Thanks for this project. I LOVE your repos!

    I discovered that after installing or upgrading (kernel along with new nvidia driver) a line in Grub2 is still loading nouveau or, at least, passing arguments to it. Right after that statement is a blacklisting of nouveau. I always boot into the “Ooops! Something went wrong.” every time I boot. When I removed the nouveau line from Grub and ran grub2-mkconfig and rebooted, the log-in screen came right up along with by secondary monitor. I’d thought I’d share that here. BTW, I’m always running the latest stable Fedora (21 at the moment).

    Thanks again!
    Matt Hutchinson

    1. Fedora 21 running on a Lenovo W540 installed in a docking station.

      I am running into the same “Oh no! Something has gone wrong!” issue after installing the nvidia driver and akmod packages given here. The only way I was able to recover was to switch to a tty console, and uninstall all of the nvidia code.

      I will try again and remove the nvidia switches (except the blacklist one) from the boot line.

      1. Just tried again, this time removing nouveau.modeset=0 from /boot/grub2/grub.cfg, but it didn’t make any difference. I still get “Oh no! …”

        1. I also have to ctl-alt F2, log in as root and run the nv modprobe command (can’t remember it off the top of my head).

  7. Hello,

    I have tried to install your nvidia drivers today – unfortunately, it was a bit a bumpy ride and is not working fully.

    First of all I’ve removed RPMFusion packaged, then I have installed nvidia-driver and dkms-nvida via yum from your repository.

    1. After boot nvidia module is not enabled and system boots into 1024×768 resolution. Installing nvidia-xconfig and running it fixes the resolution issue, but…
    2. compiz does not work – how do I enable compiz?

    Many thanks,
    Marek

    1. You need to be more specific, this is totally vague.

      Which distribution are you running? Fedora 21? Have you then removed akmod after switching to dkms? What do the Xorg, dkms log say when you have a 1024×768 resolution? Does the kernel module compile and load cleanly? Have you removed/reset your xorg configuration (there should be no /etc/X11/xorg.conf file if you are running Fedora 21+).

      Which desktop environment are you running? Compiz can’t run everywhere. Have you checked that you can run it?

      1. Hi!
        Thanks for reply!

        Yes, I am running Fedora 21 with MATE-Desktop.
        Yes, I’ve used compiz with MATE-Desktop with no issues with akmod drivers 🙂
        Yes, I did remove akmods before installing dkms drivers.
        Yes, there was no default xorg.conf file – akmods seemed to work without it with no issues.
        Yes, modules did compile cleanly though dkms was complaining about missing dkms.conf.

        To fix the low resolution had to install nvidia-xconfig module from your repository and run it – it created an xorg.conf with bunch of settings. Only:
        Section “Device”
        Identifier “Videocard0”
        Driver “nvidia”
        EndSection
        seemed to be required for nvidia driver to load.
        To enable compiz/OpenGL had to add the following lines in order to get OpenGL load correctly:
        Section “Files”
        ModulePath “/usr/lib64/nvidia/xorg”
        ModulePath “/usr/lib64/xorg/modules”
        EndSection

        Sadly, after making everything work, totem would not play videos at all – I would only see the white screen. The reason I wanted to use your drivers was to get the native video rendering on my 2560×1440 screen… so had to revert back to akmods. After revert vidoes still don’t play in Totem, though VLC works fine.
        Will have time to play more with your drivers at weekend.

        Many thanks for your reply and comments!

        1. All the settings you have added to /etc/X11/xorg.conf are already inside the packages in the following files:

          /etc/X11/xorg.conf.d/99-nvidia-modules.conf
          /etc/X11/xorg.conf.d/99-nvidia-driver.conf

          1. I don’t recall seeing 99-nvidia-*.conf files there after installing your drivers… as I said – I’ll give it another go on the weekend. Thanks!

  8. Hey thanks for the repositories mate! Would you have any idea when the driver will be available for fc22/kernel 4.0*?

  9. Hi,
    many thanks for your great work. Yuor procedure it’s the only one that makes me able to install nvidia driver on my laptop. Anyway after all the installations yuo’ve suggested i’m unable to set my video resolution properly. it’s blocked and setted in a bad value. how could i change it please?
    Thank you so much.

    1. Maybe you have a broken EDID. Try to read X.org man pages (man xorg.conf) and Nvidia documentation (in /usr/share/doc/nvidia-driver) on how to override it.

  10. Well, slaanesh, I could be no less than thankful to you for posting about nvidia x fedora issues, so common to so many users. But unfortunately your instructions did not solve my problem, which was simply to install the latest nvidia driver. I have tried many of the available solutions without success. My laptop worked with the bumblebee, as per installation instructions in fedora site, but, as you say, bumblebee is a hack. So I returned to the noveau driver, despite all shortcomings. At least I can have my laptop working! Running fedora 21, however, I am still stuck with the bug of two displays and video instabilities already described elsewhere. I have to turn off display 2 every time I log in. Better this than nothing.

  11. Hi there! I want to play CS:GO in my CentOS 7 with NVIDIA Drivers and I can’t install nvidia-driver-libs.i686 because of a missing dependency ( libvdpau(x86-32) ). I have been seeking for a solution but I didnt find it!

    Any idea? Thanks!

  12. Don’t know if this is important but wanted to report it all the same:

    mplayer: /lib64/nvidia/libOpenCL.so.1: no version information available (required by /lib64/libavutil.so.54)
    MPlayer SVN-r37363-4.9.2 (C) 2000-2015 MPlayer Team
    
    yum provides /lib64/nvidia/libOpenCL.so.1
    2:nvidia-driver-cuda-libs-346.35-3.fc21.x86_64 : Libraries for nvidia-driver-cuda
    Repo        : @negativo17-nvidia
    Matched from:
    Filename    : /lib64/nvidia/libOpenCL.so.1
    1. Thanks, will look into it. ffmpeg is compiled with OpenCL support in the RPMFusion packages.
      Are you using OpenCL for encoding?

  13. I’m using Fedora 21 x86_64 with kernel 3.18.3-201 and nvidia 346.35 in my notebook. To be able to use external monitor using HDMI, I followed the standard xorg.conf available in the Internet. But I could only use the external monitor, the notebook monitor is undetected.

    xorg.conf

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

    Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "01:00:0"
    Option "ConstrainCursor" "no"
    EndSection

    Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
    EndSection

    Section "Device"
    Identifier "intel"
    Driver "modesetting"
    EndSection

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

    Output of xrandr:

    Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
    HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1600mm x 900mm
    800x600 60.32 +
    1920x1080 (0x27f) 148.500MHz
    h: width 1920 start 2448 end 2492 total 2640 skew 0 clock 56.25KHz
    v: height 1080 start 1084 end 1089 total 1125 clock 50.00Hz

    Is there a way to enable the notebook screen? Previously before 346, I have LVDS-1 shown and was able to use both the internal and external monitors.

    1. Hmm now that you say that, I think that was packaged i installed originally. While working on the conky script, I let Fedora 21 run some updates. One of them was a new kernel, I believe it moved to 3.18. something. I wonder if that’s what cause all my issues instead of me installing the nvidia-driver-cuda. Thank you so much slaanesh and will keep you posted once I get home from work tonight and let you know what I discover. I really do appreciate everything you do for the Fedora Community.

  14. Oh oh now I did it. I was working on my conky background layout. I wanted to show the actual clock speed of my 780 Ghz Edition on it. I needed nvidia-smi to show that information. Fedora reported your missing this package, please install (I believe it was) nvidia-cuda. I did and my conky script worked awesome until I rebooted. Fedora 21 would just stop when the blue bars where moving. I went ahead and switch to terminal 2. I removed /*nvidia/* and reinstalled the driver from start again. Now it loads and it crashes at the Gnome start up with a grey screen.

    Can anyone give me some guidance and what I can do to repair and what should I have installed to get the nvidia-smi tool?

    Thanks for any help. Did not sleep very well last night thinking how to fix this today.

    1. Assuming you are using Fedora 21 (you have not specified) you can start by deleting /etc/X11/xorg.conf and rebooting. This should start X with the default settings and load the appropriate driver depending on the new DRM class (see above comments).

      Then, if it does not start anyway look in the logs, module status, etc.

      1. Thanks I am using Fedora 21. I will try that. Can you tell me what package I needed to install in order nvidia-smi.

  15. Hi

    Thank you very much for your great work. Really very helpful.

    I have a fresh Korora 21 Beta 64Bit (remix from Fedora kororaproject.org) installed on UEFI.

    I installed “yum install nvidia-driver akmod-nvidia kernel-devel”.

    Bootings with secure boot enabled produce always a “oh no something went wrong – log out” on GDM. No log-in possible. Access only by console with Ctrl-Alt-F2.

    Disabling secure boot in UEFI for bootings does the trick. Now GDM allows log-in and driver Nvidia 346.35 runs fine.

    Behaviour is reproducible constantly.

    So no secure boot on UEFI possible.

    Please investigate.

    Greetings from cantone San Gallo to Lugano.

    Rgds
    AW

    1. Hello,

      yes, drivers do not work with Secure Boot enabled. There are two ways to resolve this:

      – Rebuild the kernel modules always with the same key, and enroll the key in your system’s key database. I can’t do this for you, as I would need to send you the private key and thus rendering Secure Boot useless.

      – I could ship you a prebuilt binary and the public key only to enroll it, but you could not regenerate the rpm and would require me to sync binary updates along with the official kernel packages; which is almost impossible.

      Unfortunately there is no easy way for this, so my suggestion is not to use the binary drivers if you need Secure Boot enabled. Please see this link with instructions from Redhat:

      https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7-Beta/html/System_Administrators_Guide/sect-signing-kernel-modules-for-secure-boot.html

      And this article that also covers UEFI Secure Boot:

      http://negativo17.org/complex-setup-with-nvidia-optimus-nouveau-prime-on-fedora-20/

  16. Hi.

    Some applications in Fedora segfaults with libGL implementation of latest nVidia driver (from this repository). Please see [1] for details. The problem is something I don’t really understand much.

    Do you experience same issue with nVidia driver from this repository?

    Do you experience same issue with nVidia driver from RPMFusion?

    Try to install and run nomacs. It should segfault.

    Thank you.

    [1] https://bugzilla.redhat.com/show_bug.cgi?id=1181085

    1. Sorry but so far I’ve not experienced this. Driver wise, these packages and RPMFusion ones should exhibit the same problems. The driver are shipped in binary format, the difference is only on packaging and on the accompanying tools (nvidia-{settings,xconfig,modprobe,persistenced}.

  17. Thanks very much for the hard work. Got my legacy card working with the 340 driver and akmods –force. Finally understand the differences in the different Nvidia drivers.

  18. Hi!

    Can not go forward with nVidia drivers installation. Can you prepare step by step installation instruction?
    I still get the “Oh no! Something has gone wrong.” information.
    There is a lot of information from people who successfully installed nVidia drivers but there is no complete how-to.
    Following steps described here-in or even somwhere else still leads to problem with driver installation.
    I believe that step by step instruction will help people like me to enjoy full features of nVidia drivers under Linux.
    I have installed:
    nvidia-driver-cuda-libs-346.22-2.fc21.x86_64
    nvidia-driver-cuda-libs-346.22-2.fc21.i686
    opencl-filesystem-1.0-2.fc21.noarch
    nvidia-libXNVCtlr-346.22-1.fc21.x86_64
    nvidia-settings-346.22-1.fc21.x86_64
    nvidia-driver-libs-346.22-2.fc21.x84_64
    nvidia-driver-libs-346.22-2.fc21.i686
    dkms-nvidia-346.22-1.fc21.x86_64
    nvidia-driver-346.22-2.fc21.x86_64
    nvidia-driver-cuda-346.22-2.fc21.x86_64
    nvidia-persistenced-346.22-1.fc21.x86_64
    nvidia-xonfig-346.22-1.fc21.x86_64

    I run nvidia-xconfig and as an output I got warning that the X configuration file cannot be locate/open and the xorg-server was not found in the pkg-config search path, however xorg.conf file was created.
    No sucess after reboot.

    1. Hi,

      Don’t know if it will help but, in my case, installation on F21 always went wrong, but simply rebooting after the GNOME error message “fixed” the problem.

      HTH,

      André

    2. The detailed instructions are printed above, there’s not much to add. Just check that your module is built and loaded.

      You can remove all of these:

      nvidia-driver-cuda-libs-346.22-2.fc21.x86_64
      nvidia-driver-cuda-libs-346.22-2.fc21.i686
      opencl-filesystem-1.0-2.fc21.noarch
      nvidia-driver-cuda-346.22-2.fc21.x86_64
      nvidia-persistenced-346.22-1.fc21.x86_64

      You will not need them if you don’t need to run CUDA enabled programs.

      1. I run dkms install -k 3.17.8-300.fc21.x86_64 -m nvidia -v 346.22 –verbose. Drives has been compiled successfully, but after reboot I am still in the same place.
        What I am missing to sucessfully enable nvidia drives?

        1. I have founf in the Xorg.0.log file that the glx module is loaded but it generates errors.
          Module glx )libglx.so) is loaded from /usr/lib64/xorg/modules/extensions folder instead of /usr/lib64/nvidia/xorg folder.
          Probably this is the root cause of my problem. Can you help me to solve this problem? Is it a simple way to fix it?

          1. Hi!

            Found the problem – xorg.conf created in /etc/X11 folder after run nvida-xconfig command made X server impossible to start. After xorg.conf removal and following reboot I can enjoy X server running on nvidia derivers.

            On the other hand. Do I need to reinstall (dkms install etc. …) drivers either if new driver version will appear (now I have 346.22, and new one 346.35 is available) and new kernel version will appear?
            Another question is about snippets in xorg.conf.d folder. Can you post some examples for monitor video card, mouse, keyboard etc. configurations?
            What about snippets order (question in terms of labeling Identifiers) – is it relevant or not?

          2. If you are running Fedora 21, there should be no /etc/X11/xorg.conf, so please delete it and start from scratch if you want to override the default configuration. Remember that unless you are doing something specific, you don’t need to edit xorg.conf directly. Keyboard and mouse sections are particularly useless.

            When updating, the packages will take care of everything, you don’t need to perform any action.

  19. Hello..
    First of all thanks for the tutorial and for maintaining the repo..
    Maybe you can help me because I’ve been searching for days for a solution. I have a GTX 650 and since I installed the nvidia driver I simply cannot get graphical boot. I have managed to get grub to the resolution of 2560×1080 bott as soon as fedora starts to boot I get back to an ugly resolution with no graphical boot..
    when I boot the live media I have graphical boot but I guess that’s because it is using the nouveau driver.
    here is my /etc/default/grub:

    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora_hal-terminal/root rd.lvm.lv=fedora_hal-terminal/swap rhgb quiet rdblacklist=nouveau nomodeset"
    GRUB_DISABLE_RECOVERY="true"
    GRUB_THEME=/boot/grub2/themes/DarkFedora/theme.txt
    GRUB_GFXPAYLOAD_LINUX="keep"
    GRUB_VIDEO_BACKEND="vbe"
    GRUB_FONT_PATH="/boot/grub2/themes/DarkFedora/Droid-Sans.pf2"
    GRUB_GFXMODE="2560x1080x32"
    GRUB_BACKGROUND="/boot/grub2/background.png"

    1. Hello,

      you cannot have graphical boot with the nvidia driver enabled and the PC in bios mode. The nvidia driver expects only vga to be present on the console, otherwise it will throw an error. It can work with vesa on the console, but it’s not supported and you will still get the notice.

      What is supported, is UEFI graphical boot. The system will use efifb for the console and the nvidia driver for the DDX.

      See the table at the end of this article:

      http://negativo17.org/complex-setup-with-nvidia-optimus-nouveau-prime-on-fedora-20/

    1. Hello, yes, there is a mistake. The package is only available for Fedora and internal RHEL builds. I’m updating all driver releases/builds with the fix. Please give a few hours for the upload. Thanks for spotting!

  20. how to install 340 ??

    I installed repo “nvidia-repo”
    this command “yum -y install nvidia-driver” install by me driver 346 and this vs dont work.

    please what is theyum command to install 340 vs
    thx

  21. Fedora 340 repo is great, works fantastic and it saved me from trouble when I upgraded F20 to F21. You should add a note on blog post that it exists so people would find it easily.

    Thanks for all of this 🙂

  22. Hi there!

    Since I updated with fedup from F20 to F21 my nvidia drivers were missed somewhere in the universe (GeForce 9400M card, so 340xx).

    I followed your guide and I have propietary drivers again. Really you finished one of my worst headaches since long.

    Keep the good work!

  23. Hi!

    Just installed:
    dkms-nvidia-346.22.1.fc21.x86_64.rpm
    nvidia-driver-346.22.1.fc21.x86_64.rpm
    nvidia-driver-libs-346.22.1.fc21.x86_64.rpm
    nvidia-libXNVCtrl-346.22.1.fc21.x86_64.rpm
    nvidia-settings-346.22.1.fc21.x86_64.rpm
    nvidia-xconfig-346.22.1.fc21.x86_64.rpm
    from your repository.

    How to configure Fedora to use nvidia driver, since after installation I do not see xorg.conf configuration file in the /etc/X11 folder?

    1. Since Fedora 21 (and CentOS/RHEL 6.6 with newer Xorg) there is no need for an Xorg.conf file. The configuration is using the new “OutputClass” directive (/etc/X11/xorg.conf.d/99-nvidia-driver.conf). Please look at the driver page as I’ve described it there.

  24. Hi there. Thanks for your great work with the 340xx series driver. It made my laptop usable on Fedora 21, after I’d bashed my head against RPMFusion’s version for hours.

    I was wondering if you’d be willing to apply this patch to the 340xx driver series, or if it was even possible to do given Fedora’s kernel. I have the same issue laid out in the bug where resume-from-suspend causes graphical corruption every time. It’s not too annoying, since I can just “Alt+F2 -> r” and reload GNOME but it’s still undesired behaviour.

    https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-331/+bug/1210077

    Or, if you know any way of getting rid of this corruption through a grub/driver setting, that’d be great too!

    Thanks a bunch.

    1. I will rebuild and update when I come back on the 8th of January, I’m currently travelling through Indochina without connectivity. Thanks for letting me know.

    2. Nice! I’ve been suffering with graphical corruption after suspend as well, I thought it could be related to the fact that 346.22 is marked as beta on Nvidia site, but I tried 343.36 from RPMFusion and the problem was still there. Hopefully this patch will fix this problem 😉

    3. Hello, the patch you are pointing to is already included since the 331.67 release. Probably the problem you are experiencing is related to something else.

  25. Hi,

    is there any specific reason for the F21 drivers to be beta (346.xx) and not the stable ones (340.xx or 343.xx)?

  26. Thanks for the great repo!

    I’ve recently switched from Ubuntu to Fedora 21 and I did not want to install RPMFusion just for the Nvidia drivers for my 660ti, so I was surely happy when I found this alternative – I like the clean documentation and you seem to know what you are doing.

    Keep the good work up!

  27. Dude!
    Thanks so much for your comprehensive and clearly worded instructions, and indeed your repos themselves. New Fedora 21 installation this weekend, beating my head against a wall with Nvidia drivers, no 340xx series drivers available in Fusion, 304xx broken and uninstallable. Your 340 repo really came to the rescue.

    Keep up the good work!

  28. Hi,

    I just installed F21, and for some reason nvidia driver is not working, gnome just shows that vague error page saying that “something wrong happened”. I have a GTX 750 Ti that was working just fine on F20. Any tips on how to understand what’s wrong?
    I followed the instructions to the letter, the only thing I had to workaround was the installation of kmodtool, I had to disable gpg checking because for some reason rpmfusion is providing the F20 package instead of F21.

    To make matters worse, nouveau is not working, and either I fix this or I’ll have to go back to F20…

    1. Nevermind… I just rebooted today and it just worked 🙂 One of my last attempts to fix the problem probably did it, I guess I was just one reboot away from success 😉

  29. Hello negativo17. First of all I wanna say thank you for your work. I came here to ask you – how about nvidia driver installation key? I use Fedora 21 with enabled Ultra Fast and Secure Boot UEFI options and I need import key which should be in /usr/share/nvidia/ folder by mokutil. The problem is i cant find him in /usr/share/nvidia after installation driver from your repository. I have to manually download nvidia driver from nvidia’s website, then manually install it and in the installation process choose option to generate key. After that i have to import that key with sudo mokutil --import /usr/share/nvidia/nvidianvidia-modsign*.der then restart computer and add key using Shim UEFI Keys Manager. Where nvidia driver from your repository put the key? Or maybe driver from you repositories doesn’t generate key during the installation process? Please reply me on my email or in the comment below. I’ve marked option “Notify me the new posts”.

    1. Hello, thanks for the information.

      No I haven’t tried doing what you describe. Usually I disable UEFI Secure Boot if using the Nvidia Drivers. I will include required files and instructions on the page.
      How do you “add key using Shim UEFI Keys Manager”? Can you provide the commands?

  30. Hello, I have a problem with the new Fedora 21. With the 340 driver, I got stuck on gnome-shell start, just after GDM login.
    Gnome shell hangs with 90+ CPU load and I can’t go beyond a grey screen.

    1. Ok, I fixed it. For anyone having same problem, just remove the ‘gnome-shell-extension-background-logo’ package
      sudo yum remove gnome-shell-extension-background-logo

  31. hello..
    want to try this primarilly in order to use gpu rendering in cycles, cuda being a prerequisit..
    a question pops, excuse my ignorance.. new to .rpm/ yum..
    taken that rpmfusion needs to be added/ enabled, for akmod to work, how do i point to the wanted drivers?? as in, not the rpmfusion ones??
    thanks..

  32. Hi, nice packaging.

    Any chance you could also provide ‘legacy’ drivers? Just noticed my card is no longer supported by the latest drivers, only by the 340.xx series…

  33. I could not build the kernel module for Fedora 21. It says missing auto.conf and autoconf.h somewhere in the middle of the akmod log. My kernel is 3.17.3-300.fc21.x86_64

    Is there a way to fix that or is it possible for you to provide the rpm for the kernel module?

    1. You’re missing the kernel-devel package that matches your system. Follow the instructions on the page and rebuild the modules (akmods --force) or reboot.

      1. I do have the matching kernel-devel
        kernel-devel-3.17.3-300.fc21.x86_64

        I have been using akmods –force successfully with the packages from rpmfusion before. Suddenly it stops working. Not sure if it is the nvidia part or the fedora part that breaks.

          1. I still could not get it compiled with akmods. It turns out not missing those files, but something else that I could not figure out. If you could kindly help, the log is available at

            Click here to see the log

            At the start of the error , it says

            In file included from /tmp/akmodsbuild.w3LHxRAw/BUILD/nvidia-kmod-346.16-x86_64/_kmod_build_3.17.4-300.fc21.x86_64/nv-linux.h:107:0,
            from /tmp/akmodsbuild.w3LHxRAw/BUILD/nvidia-kmod-346.16-x86_64/_kmod_build_3.17.4-300.fc21.x86_64/nvlink-linux.h:14,
            from /tmp/akmodsbuild.w3LHxRAw/BUILD/nvidia-kmod-346.16-x86_64/_kmod_build_3.17.4-300.fc21.x86_64/nvlink.c:13:
            /tmp/akmodsbuild.w3LHxRAw/BUILD/nvidia-kmod-346.16-x86_64/_kmod_build_3.17.4-300.fc21.x86_64/nvlink.c: In function 'nvlink_init':
            include/linux/pci.h:1122:45: error: 'KBUILD_MODNAME' undeclared (first use in this function)
            __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)

  34. Hi,

    Great that you’ve built the 346 beta drivers for fc21, but the 343 packages seem to be gone. Example :-

    yum list *nvidia*
    
    Loaded plugins: langpacks
    Available Packages
    akmod-nvidia.x86_64                                           2:343.22-2.fc21                        fedora-nvidia

    But the install says :-

    No Presto metadata available for fedora-nvidia
    akmod-nvidia-343.22-2.fc21.x86 FAILED                                          
    http://negativo17.org/repos/nvidia/fedora-21/x86_64/akmod-nvidia-343.22-2.fc21.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found

    I’ll try installing the 346 rpm manually for now

    1. You simply had the old metadata on your computer and I had already uploaded the new packages and metadata on the site. Next time, just delete your yum cache; there’s no need to do anything manual:

      yum clean all
      yum update
  35. Hi,
    first of all thanks for packaging the new nvidia driver for fedora!
    Runs fine here on a F20 installation but there is one thing i miss…

    Kernel-RT support.
    The RPM-Fusion driver worked well with akmods enabled to build for the ccrma-kernel but this here is different. Don’t know if nvidia changed something or maybe its the packaging?
    Trying to –force the build give me this errror:
    *** Failed PREEMPT_RT sanity check. Bailing out! ***
    Any Ideas? Things i can try?

    Thanks!

    1. Hello, the kernel module is compiled with IGNORE_PREEMPT_RT_PRESENCE=1. Which driver version are you using? Can you check that this is passed during the build in the logs?

      Also, where is the RT enabled kernel on planetccma? I can’t find it.

        1. Hi,
          i changed the spec file and rebuild the akmod with success. yay!
          Don’t know where you added the option but this way it worked for me:

          for kernel_version in %{?kernel_versions}; do
          %if !0%{?_nv_build_module_instances}
              pushd _kmod_build_${kernel_version%%___*}/
                  make %{?_smp_mflags} \
                      IGNORE_XEN_PRESENCE=1 \
                       IGNORE_PREEMPT_RT_PRESENCE=1 \
                      SYSSRC="${kernel_version##*___}" \
                      module
              popd
              pushd _kmod_build_${kernel_version%%___*}/uvm
                  make %{?_smp_mflags} \
                      IGNORE_XEN_PRESENCE=1 \
                       IGNORE_PREEMPT_RT_PRESENCE=1 \
                      SYSSRC="${kernel_version##*___}" \
                      module
              popd
          %else
              pushd _kmod_build_${kernel_version%%___*}/
                  make \
                      IGNORE_XEN_PRESENCE=1 \
                       IGNORE_PREEMPT_RT_PRESENCE=1 \
                      SYSSRC="${kernel_version##*___}" \
                      NV_BUILD_MODULE_INSTANCES=%{?_nv_build_module_instances} \
                      module
              popd
          %endif

          best regards

  36. I couldn’t compile ccminer without nvcc so I didn’t try (and it is the only cuda application I use), but sure I can help test when I get some time. Without nvidia-modprobe, ccminer would not run saying that it could not query the number of CUDA devices; I looked up the error and saw calls to nvidia-modprobe so I tried installing it and then it worked. Do you have my email, or IRC?

    1. I have your email, thanks. Will send you the link with the packages (hopefully tomorrow) after reviewing them.

      Many thanks!

      1. I found that nvidia-modprobe is essential for getting libgpuarray installed (which is used for the computation package Theano, for instance) – so there’s some functionality in there that people are relying on…

        1. Can you provide some info/link? On the drivers, it is needed only if the character devices are not available when the driver is initializing.

  37. For anyone who runs into the same problems I did, trying to run ccminer using this driver package: make sure to install nvidia-driver-devel/nvidia-driver-cuda-libs and nvidia-modprobe, these are not normally brought along with the driver installation. I’m using a cuda toolkit 6.5 installation separate from RPMs as I’m not sure how to compile ccminer with the packaged nvidia-driver-cuda. (I also installed nvidia-driver-cuda for the nvidia-smi binary.) But I am just glad to have an up to date packaging of the driver.

    1. Actually to get all headers required for compiling software against the Nvidia driver libraries you should just install the nvidia-driver-devel package; this will pull in almost all of the original Nvidia tarball:

      $ rpm -q --requires nvidia-driver-devel | grep ^nvidia
      nvidia-driver-NVML(x86-32) = 2:343.22-1.fc21
      nvidia-driver-NvFBCOpenGL(x86-32) = 2:343.22-1.fc21
      nvidia-driver-cuda-libs(x86-32) = 2:343.22-1.fc21
      nvidia-driver-libs(x86-32) = 2:343.22-1.fc21

      The package nvidia-modprobe should not actually be needed anymore (I’m offering it for compatibility reasons) as the main driver gets loaded automatically and the UVM extra module is loaded through an UDEV rule:

      $ rpm -ql nvidia-driver-cuda  | grep uvm
      /usr/lib/udev/rules.d/60-nvidia-uvm.rules

      What is exactly that your setup was missing that needed you to install the nvidia-modprobe package?

      Thanks.

  38. There is a bug in the nvidia-persistenced package. It tries to start /usr/bin/nvidia-persistenced, but the daemon is installed to /usr/sbin/nvidia-persistenced.

    Another question, do you have the “nvcc” program packaged? It normally comes with the cuda installation from nvidia, but I cannot find it with a yum provides search.

    1. Thanks for spotting the mistake, I’m updating all nvidia-persistenced packages now.

      Regarding CUDA binaries; I have packaged the latest CUDA libraries and binaries (6.5.19) and I’m looking for someone to test them before publishing them along with the rest of the Nvidia packages. Are you interested to test them and give some feedback?

  39. Any chance to an

    akmod-nvidia-173xx
    akmod-nvidia-304xx
    akmod-nvidia-340xx **

    type setup like the other legacy drivers?

  40. So… updated and now I’m getting:

    NVRM: The NVIDIA GeForce 210 GPU installed in this system is
    NVRM: supported through the NVIDIA 340.xx Legacy drivers. Please
    NVRM: visit http://www.nvidia.com/object/unix.html for more
    NVRM: information. The 343.22 NVIDIA driver will ignore
    NVRM: this GPU. Continuing probe…

    Any way to downgrade?

  41. Thks for the info, and for providing support for legacy cards. I will probably upgrade my graphics card in the near future but, in the meantime, being able to use NVidia drivers would be great. I am currently running Nouveau as a workaround, and overall it indeed works fine, but aside from the worse performance, it also has some issues (sometimes it freezes after login on GNOME, Google Sheets doesn’t redraw sometimes on Google Chrome etc.).

  42. I just installed driver 343.22 on F20 and system fails to boot on graphic mode. I have a 9800 GT, and driver 343.22 release notes state that “removed support for G8x, G9x […] Ongoing support for new Linux kernels and X servers, as well as fixes for critical bugs, will be included in 340.* legacy releases through the end of 2019.”
    Probably a dumb question, but does the G9x above includes the 9800GT? If so, which driver should I download? It seems that there’s no 340-legacy packages yet.

    1. Replying to myself: yep, 9800 GT has been officially labeled legacy with the release of 343.x driver series (full list of cards here). So, I guess I’ll just have to revert back to nouveau until 340xx legacy drivers are available… :-/

      Any ETA?

      1. I’m creating a separate repository for the 340 branch as yours it’s not the first request I receive. Will post it on the blog once it’s ready.

        Please note that today’s games do not run well on old hardware such as the 9800GT, and if you don’t play games and don’t need full hardware acceleration the nouveau driver is more than fine.

        1. The repository has been created. Just grab the appropriate *340.repo file and put it in place in /etc/yum.repos.d.
          To sync you can use the yum distro-sync command.

          Example for Fedora when using aKMOD packages:

          yum-config-manager --disable fedora-nvidia
          yum-config-manager --add-repo=http://negativo17.org/repos/fedora-nvidia-340.repo
          yum remove kmod-nvidia\*
          yum distro-sync \*nvidia\*
          reboot
          1. Wow, that was fast! =) I just installed, and it is working flawlessly. I’m back in the game 😉

            Thank you so much for such awesome support =))

  43. So where’s the libcudart.so.5.5 for 64-bit.

    I keep getting:
    error while loading shared libraries: libcudart.so.5.5: wrong ELF class: ELFCLASS32

    1. That’s part of CUDA 5.5, which I’m not packaging. It seems you’re loading the 32 bit libcudart.so.5.5 in your 64 bit environment.

      1. Thought it was a negativo17 repo problem because it happened when I did yum update…

        But something about this started to sound familiar so I went back through my notes. Managed to find that I had this problem before and found my fix: (so I’m good now)

        sudo ln -sf libcuda.so.340.24 /usr/lib64/nvidia/libcuda.so
        sudo ln -sf libcuda.so.340.24 /usr/lib/nvidia/libcuda.so
        
        sudo rsync -arv /usr/local/cuda-5.5/lib64/* /usr/lib64/nvidia/
        sudo rsync -arv /usr/local/cuda-5.5/lib/* /usr/lib/nvidia/
        
        sudo ldconfig
        1. First of all, this has nothing to do with libcudart libraries error you were referring to. Second, this is all wrong as you’re duplicating libraries all over, including linking x86_64 in i686 folders.

          To find the library you are requiring type the following command:

          # yum provides \*libcuda.so

          This will tell you that it’s in the nvidia-driver-devel package; so assuming you are on an x86_64 system, the only thing you need to do to have the library on the system is to do the following:

          # yum install nvidia-driver-devel nvidia-driver-devel.i686

          Second step is to make sure your system can find the CUDA libraries. Copying the libraries you require somewhere else is totally wrong. You actually need to make your system find the CUDA ones instead.

          Copy the two /etc/ld.so.conf.d/nvidia-lib*.conf files as /etc/ld.so.conf.d/cuda-lib*.conf and replace the contents with your cuda paths.

          Afterwards, rerun ldconfig to rebuild the library cache. Running ldconfig -p | grep library.so will tell you where the system is getting its libraries.

  44. i’m using an old quadro nvs card to drive four displays via xinerama (no twinview at all). i’m using the rpmfusion driver setup. lately i’ve run into a bizarre problem where the display locks (while displaying vibrating patterns) and then often triggers a crash/reboot. the logs are devoid of anything interesting or useful. i’m interested in trying your setup. is it safe and easy to switch back & forth between rpmfusion and your setup? will my xorg.conf file get clobbered/rewritten?

    1. Hello, it’s easy to switch back and forth using akmod, just backup your xorg.conf file:

      cp /etc/X11/xorg.conf /etc/X11/xorg.conf.working
      yum -y remove \*nvidia\*
      yum -y install nvidia-driver
      cp -f /etc/X11/xorg.conf.working /etc/X11/xorg.conf

      But if your problem is due to the binary driver; unless you change the driver itself there will probably be no benefit. If the versions I’m hosting are the same as RPMFusion ones, then you will have the same problems for sure.

  45. I have this weird situation (that I’ll admit I haven’t fully debugged yet) With the nvidia package from nvidia.com everything works.

    After installing your drivers (and reinstall xorg and various other things) I can log in if I init 3, startx. But the gdm menu either doesn’t come up or when it does logging in as a user gets a bunch of white boxes or full white screen. Any ideas where to start looking?

    1. We ran into the same problem at work–
      sudo vim /etc/gdm/custom.conf
      and uncomment the #WaylandEnable=false line
      This was part of the fix for us.

      1. Actually on Fedora 22, the login screen/session work like follows:

        – If using the OSS drivers, GDM is launched on wayland
        – After login, the Xwayland servers for compatibility are launched as user processes

        If disabling Wayland:

        – If using the OSS drivers, GDM is launched as user “gdm” and not “root”
        – Desktop session is run on another X process start as the user who logged in and not “root”

        If using binary drivers:

        – The system detects it and both GDM and user sessions have X running as “root”

        So actually it should not be needed to explicitly disabling wayland in GDM.

  46. I’m probably missing something obvious but will this support Optimus cards and allow switching / powering off and using external monitors?

    1. It’s written in the page, if you use the OpenSource (intel and nouveau) drivers and kernel 3.12+, dynamic power on/off of the cards works out of the box. The card of course will not power off if you’re using the external monitor.

  47. akmod needs kernel-devel package which has to be installed seperately. please include this also in above instructions..

    1. akmods already requires the latest kernel-devel package; there’s nothing to be installed separately. You can check by running rpm -q --requires akmods.

    1. I personally think Bumblebee is a hack. I support the official Nvidia implementation (i.e. X.org configuration) or the fully open Prime solution.

Leave a Reply