NVIDIA Driver Installation Quickstart Guide

This edition of Quickstart guide describes the installation process of NVIDIA® Drivers for supported Linux distributions.

Introduction

The purpose of this document is to provide some quick start notes for installing NVIDIA drivers on Linux distributions for servers. For more comprehensive information on installing CUDA Toolkit and drivers on various Linux distributions (for both workstation and server variants), refer to the CUDA Installation Guide for Linux.

1.1. Pre-Installation Requirements

Before installing the NVIDIA driver on Linux, some pre-installation steps are recommended to:
  1. Verify the system has a CUDA-capable GPU
  2. Verify the system is running a supported version of Linux
  3. Verify the system has build tools such as make, gcc installed
  4. Verify the system has correct Linux kernel headers

For more detailed steps on completing each of these pre-installation steps, refer to the pre-installation actions in the CUDA Installation Guide for Linux.

Note: Mixing installation methods (e.g. .run installers and .deb/.rpm packages) may result in driver conflicts and an unusable system. Refer to this section in the guide above for other pre-install actions to handle conflicting installation methods.

1.2. Installer Formats

NVIDIA drivers are available in three formats for use with Linux distributions:

2. Runfile Installers

NVIDIA drivers are available as .run installer packages for use with Linux distributions from the NVIDIA driver downloads site. Select the .run package for your GPU product.

This page also includes links to all the current and previous driver releases: https://www.nvidia.com/en-us/drivers/unix.

The .run can also be downloaded using wget or curl as shown in the example below:

$ BASE_URL=https://us.download.nvidia.com/tesla
$ DRIVER_VERSION=450.80.02
$ curl -fSsl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run

Once the .run installer has been downloaded, the NVIDIA driver can be installed:

$ sudo sh NVIDIA-Linux-x86_64-$DRIVER_VERSION.run

Follow the prompts on the screen during the installation. For more advanced options on using the .run installer, see the --help option or refer to the README.

3. Package Managers

The Package Manager installation interfaces with your system's package management system. When using RPM or Deb, the downloaded package is a repository package. Such a package only informs the package manager where to find the actual installation packages, but will not install them.

The next few sections provide steps on installing the NVIDIA Tesla driver on these supported distributions:

3.1. Ubuntu LTS

This section includes instructions for installing the NVIDIA driver on Ubuntu 16.04 LTS and Ubuntu 18.04 LTS distributions using the package manager.

  1. The NVIDIA driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 4.4.0, the 4.4.0 kernel headers and development packages must also be installed.

    The kernel headers and development packages for the currently running kernel can be installed with:
    $ sudo apt-get install linux-headers-$(uname -r)

  2. Install the CUDA repository public GPG key. This can be done via the cuda-keyring package or a manual installation of the key. The usage of apt-key is deprecated.
    $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
    $ wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-keyring_1.0-1_all.deb
    $ sudo dpkg -i cuda-keyring_1.0-1_all.deb

  3. Update the APT repository cache and install the driver using the cuda-drivers meta-package. Use the --no-install-recommends option for a lean driver install without any dependencies on X packages. This is particularly useful for headless installations on cloud instances.
    $ sudo apt-get update
    $ sudo apt-get -y install cuda-drivers

  4. Follow the post-installation steps in the CUDA Installation Guide for Linux to setup environment variables, NVIDIA persistence daemon (recommended) and to verify the successful installation of the driver.

3.2. Red Hat Enterprise Linux 8

This section includes instructions for installing the NVIDIA driver on RHEL 8 using the package manager.

  1. If not done already (for example when using RHEL on cloud instances), register the system using subscription-manager. For more information, refer to this KB article on the Red Hat Customer Portal.
    $ sudo subscription-manager register --username <insert-username> --password <insert-password> --auto-attach

  2. Satisfy the external dependency on EPEL for DKMS and enable any optional repos for RHEL 8 only.
    $ sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    $ ARCH=$( /bin/arch )
    $ sudo subscription-manager repos --enable codeready-builder-for-rhel-8-${ARCH}-rpms --enable rhel-8-for-${ARCH}-baseos-rpms --enable rhel-8-for-${ARCH}-appstream-rpms

  3. Install the CUDA repository public GPG key.
    $ distribution=$(. /etc/os-release;echo $ID`rpm -E "%{?rhel}%{?fedora}"`)

  4. Setup the CUDA network repository.
    $ sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/$distribution/${ARCH}/cuda-rhel8.repo

  5. The NVIDIA driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 4.4.0, the 4.4.0 kernel headers and development packages must also be installed.

    For RHEL 8, ensure that the system has the correct Linux kernel sources from the Red Hat repositories:
    $ sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)

  6. The choice of the driver package depends on the stream and profile to be used as shown below:
    $ sudo dnf module install nvidia-driver:<stream>/<profile>

    stream depends on the driver branch and type (e.g. precompiled). To install the latest driver, choose the latest-dkms driver stream. For more information on the supported streams, refer to the support matrix.

    profile by default is "default" and does not need to be specified. Supported profiles can be chosen based on the use-case:

    Table 1. List of driver profiles available
    Stream Profile Use-case
    Default /default Installs all the driver packages in a stream.
    Kickstart /ks Performs unattended Linux OS installation using a config file.
    NVSwitch Fabric /fm Installs all the driver packages and components required for bootstrapping an NVSwitch system.
  7. Update the repository cache and install the driver using the nvidia-driver meta-package. In this example, we use the default profile. For NVSwitch systems, use nvidia-driver:latest-dkms/fm.
    $ sudo dnf clean all
    $ sudo dnf -y module install nvidia-driver:latest-dkms

  8. Follow the post-installation steps in the CUDA Installation Guide for Linux to setup environment variables, NVIDIA persistence daemon (recommended) and to verify the successful installation of the driver.

  9. Optionally, if tearing down a cloud instance with RHEL, remove and unregister entitlements from Red Hat if the instance is no longer required.
    $ sudo subscription-manager remove --all
    $ sudo subscription-manager unregister

3.3. CentOS 8

This section includes instructions for installing the NVIDIA driver on CentOS 8 using the package manager.

  1. In some cases, you may need to install some additional dependencies that are required for installing the NVIDIA drivers.
    $ sudo dnf install -y tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-devel

  2. Enable the PowerTools repo and set up the external dependency on EPEL for DKMS.
    $ sudo dnf config-manager --set-enabled PowerTools
    $ sudo dnf install -y epel-release

  3. Install the CUDA repository public GPG key.
    $ distribution=rhel8

  4. Setup the CUDA network repository.
    $ ARCH=$( /bin/arch )
    $ sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/$distribution/${ARCH}/cuda-$distribution.repo

  5. The NVIDIA driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 4.4.0, the 4.4.0 kernel headers and development packages must also be installed.

    For CentOS 8, ensure that the system has the correct Linux kernel sources from the CentOS repositories:
    $ sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)

    Note that in some cases, you may have to update the running kernel as a pre-requisite:

    $ sudo dnf install -y kernel kernel-core kernel-modules

  6. The choice of the driver package depends on the stream and profile to be used as shown below:
    $ sudo dnf module install nvidia-driver:<stream>/<profile>

    stream depends on the driver branch and type (e.g. precompiled). To install the latest driver, choose the latest-dkms driver stream. For more information on the supported streams, refer to the support matrix.

    profile by default is "default" and does not need to be specified. Supported profiles can be chosen based on the use-case:

    Table 2. List of driver profiles available
    Stream Profile Use-case
    Default /default Installs all the driver packages in a stream.
    Kickstart /ks Performs unattended Linux OS installation using a config file.
    NVSwitch Fabric /fm Installs all the driver packages and components required for bootstrapping an NVSwitch system.
  7. Update the repository cache and install the driver using the nvidia-driver meta-package. In this example, we use the default profile. For NVSwitch systems, use nvidia-driver:latest-dkms/fm.
    $ sudo dnf clean all
    $ sudo dnf -y module install nvidia-driver:latest-dkms

  8. Follow the post-installation steps in the CUDA Installation Guide for Linux to setup environment variables, NVIDIA persistence daemon (recommended) and to verify the successful installation of the driver.

3.4. Red Hat Enterprise Linux 7

This section includes instructions for installing the NVIDIA driver on RHEL 7 using the package manager.

  1. If not done already (for example when using RHEL on cloud instances), register the system using subscription-manager. For more information, refer to this KB article on the Red Hat Customer Portal.
    $ sudo subscription-manager register --username <insert-username> --password <insert-password> --auto-attach

  2. Satisfy the external dependency on EPEL for DKMS and enable any optional repos for RHEL 7.
    $ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    $ sudo subscription-manager repos --enable="rhel-*-optional-rpms" --enable="rhel-*-extras-rpms"  --enable="rhel-ha-for-rhel-*-server-rpms"

  3. Install the CUDA repository public GPG key.
    $ distribution=$(. /etc/os-release;echo $ID`rpm -E "%{?rhel}%{?fedora}"`)

  4. Setup the CUDA network repository.
    $ ARCH=$( /bin/arch )
    $ sudo yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/$distribution/${ARCH}/cuda-$distribution.repo

  5. The NVIDIA driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 4.4.0, the 4.4.0 kernel headers and development packages must also be installed.

    For RHEL 7, ensure that the system has the correct Linux kernel sources from the Red Hat repositories:
    $ sudo yum install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)

  6. Update the repository cache and install the driver using the nvidia-driver-latest-dkms meta-package.
    $ sudo yum clean expire-cache
    $ sudo yum install -y nvidia-driver-latest-dkms

  7. Follow the post-installation steps in the CUDA Installation Guide for Linux to setup environment variables, NVIDIA persistence daemon (recommended) and to verify the successful installation of the driver.

  8. Optionally, if tearing down a cloud instance with RHEL, remove and unregister entitlements from Red Hat if the instance is no longer required.
    $ sudo subscription-manager remove --all
    $ sudo subscription-manager unregister

3.5. CentOS 7

This section includes instructions for installing the NVIDIA driver on CentOS 7 using the package manager.

  1. In some cases, you may need to install some additional dependencies that are required for installing the NVIDIA drivers.
    $ sudo dnf install -y tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-devel iptables firewalld vim bind-utils wget

  2. Satisfy the external dependency on EPEL for DKMS.
    $ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

  3. Install the CUDA repository public GPG key.
    $ distribution=rhel7

  4. Setup the CUDA network repository.
    $ ARCH=$( /bin/arch )
    $ sudo yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/$distribution/${ARCH}/cuda-$distribution.repo

  5. The NVIDIA driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 4.4.0, the 4.4.0 kernel headers and development packages must also be installed.

    For CentOS 7, ensure that the system has the correct Linux kernel sources from the CentOS repositories:
    $ sudo yum install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)

  6. Update the repository cache and install the driver using the nvidia-driver-latest-dkms meta-package.
    $ sudo yum clean expire-cache
    $ sudo yum install -y nvidia-driver-latest-dkms

  7. Follow the post-installation steps in the CUDA Installation Guide for Linux to setup environment variables, NVIDIA persistence daemon (recommended) and to verify the successful installation of the driver.

3.6. SUSE Linux Enterprise Server 15

This section includes instructions for installing the NVIDIA driver on SLES 15 using the package manager.

  1. Install the CUDA repository public GPG key.
    $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.[0-9]//')

  2. Setup the CUDA network repository.
    $ sudo zypper ar http://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-$distribution.repo

  3. If not already done, activate the SUSE Package Hub with SUSEConnect. On OpenSUSE systems, this step can be skipped.
    $ sudo SUSEConnect  -p PackageHub/15.1/x86_64

  4. Update the repository cache.
    $ sudo zypper refresh

  5. The NVIDIA driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 4.4.0, the 4.4.0 kernel headers and development packages must also be installed.

    For SUSE, ensure that the system has the correct Linux kernel sources from the SUSE repositories.

    Use the output of the uname command to determine the running kernel's version and variant:

    $ uname -r 
    4.12.14-lp151.27-default
    In this example, the version is 4.12.14-lp151.27 and the variant is default. The kernel headers and development packages can then be installed with the following command, replacing <variant> and <version> with the variant and version discovered from the previous uname command:
    $ sudo zypper install -y kernel-<variant>-devel=<version>

  6. Proceed to install the driver using the cuda-drivers meta-package.
    $ sudo zypper install -y cuda-drivers

  7. On SUSE systems, add the user to the video group.
    $ sudo usermod -a -G video <username>

  8. A reboot of the system may be required to verify that the NVIDIA driver modules are loaded and the devices visible under /dev.
    $ sudo reboot

  9. Follow the post-installation steps in the CUDA Installation Guide for Linux to setup environment variables, NVIDIA persistence daemon (recommended) and to verify the successful installation of the driver.

Notices

Notice

This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality.

NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice.

Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.

NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document.

NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk.

NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.

No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.

Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices.

THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.

Trademarks

NVIDIA and the NVIDIA logo are trademarks and/or registered trademarks of NVIDIA Corporation in the Unites States and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.