nvidia driver installation quickstart guide€¦ · nvidia driver installation quickstart guide...

10
NVIDIA DRIVER INSTALLATION QUICKSTART GUIDE RN-08625-v1.0 _v01 | February 2020 Installation Guide

Upload: others

Post on 15-Jun-2020

40 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

NVIDIA DRIVER INSTALLATIONQUICKSTART GUIDE

RN-08625-v1.0 _v01 | February 2020

Installation Guide

Page 2: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | ii

TABLE OF CONTENTS

Chapter 1.  Introduction.........................................................................................11.1. Pre-Installation Requirements.......................................................................... 1

Chapter 2. Package Managers..................................................................................22.1. Ubuntu LTS.................................................................................................22.2. Red Hat Enterprise Linux 8............................................................................. 32.3. Red Hat Enterprise Linux 7............................................................................. 42.4. SUSE Linux Enterprise Server 15....................................................................... 5

Page 3: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 1

Chapter 1.INTRODUCTION

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

1.1. Pre-Installation RequirementsBefore installing the NVIDIA driver on Linux, some pre-installation steps arerecommended 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 thepre-installation actions in the CUDA Installation Guide for Linux.

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

Page 4: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2

Chapter 2.PACKAGE MANAGERS

The Package Manager installation interfaces with your system's package managementsystem. 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 installationpackages, but will not install them.

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

‣ Ubuntu LTS‣ Red Hat Enterprise Linux 8‣ Red Hat Enterprise Linux 7‣ SUSE Linux Enterprise Server 15

2.1. Ubuntu LTSThis section includes instructions for installing the NVIDIA driver on Ubuntu 16.04 LTSand Ubuntu 18.04 LTS distributions using the package manager.

1. The NVIDIA driver requires that the kernel headers and development packages forthe 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 kernelversion 4.4.0, the 4.4.0 kernel headers and development packages must also beinstalled.

The kernel headers and development packages for the currently running kernel canbe installed with:

$ sudo apt-get install linux-headers-$(uname -r)

2. Ensure packages on the CUDA network repository have priority over the Canonicalrepository.

$ 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-$distribution.pin

Page 5: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

Package Managers

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 3

$ sudo mv cuda-$distribution.pin /etc/apt/preferences.d/cuda-repository-pin-600

3. Install the CUDA repository public GPG key. Note that on Ubuntu 16.04, replacehttps with http in the command below.

$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/7fa2af80.pub

4. Setup the CUDA network repository.

$ echo "deb http://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list

5. Update the APT repository cache and install the driver using the cuda-driversmeta-package. Use the --no-install-recommends option for a lean driver installwithout any dependencies on X packages. This is particularly useful for headlessinstallations on cloud instances.

$ sudo apt-get update

$ sudo apt-get -y install cuda-drivers

6. Follow the post-installation steps in the CUDA Installation Guide for Linux to setupenvironment variables, NVIDIA persistence daemon (recommended) and to verifythe successful installation of the driver.

2.2. Red Hat Enterprise Linux 8This section includes instructions for installing the NVIDIA driver on RHEL 8 using thepackage manager.

1. If not done already (for example when using RHEL on cloud instances), registerthe system using subscription-manager. For more information, refer to this KBarticle 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 reposfor 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.

Page 6: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

Package Managers

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 4

$ 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 forthe 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 kernelversion 4.4.0, the 4.4.0 kernel headers and development packages must also beinstalled.

For RHEL 8, ensure that the system has the correct Linux kernel sources from theRed Hat repositories:

$ sudo dnf 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 dnf clean all

$ sudo dnf -y module install nvidia-driver:latest-dkms

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

8. Optionally, if tearing down a cloud instance with RHEL, remove and unregisterentitlements from Red Hat if the instance is no longer required.

$ sudo subscription-manager remove --all

$ sudo subscription-manager unregister

2.3. Red Hat Enterprise Linux 7This section includes instructions for installing the NVIDIA driver on RHEL 7 using thepackage manager.

1. If not done already (for example when using RHEL on cloud instances), registerthe system using subscription-manager. For more information, refer to this KBarticle 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 reposfor RHEL 7.

Page 7: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

Package Managers

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 5

$ 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 forthe 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 kernelversion 4.4.0, the 4.4.0 kernel headers and development packages must also beinstalled.

For RHEL 7, ensure that the system has the correct Linux kernel sources from theRed 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 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 setupenvironment variables, NVIDIA persistence daemon (recommended) and to verifythe successful installation of the driver.

8. Optionally, if tearing down a cloud instance with RHEL, remove and unregisterentitlements from Red Hat if the instance is no longer required.

$ sudo subscription-manager remove --all

$ sudo subscription-manager unregister

2.4. SUSE Linux Enterprise Server 15This section includes instructions for installing the NVIDIA driver on SLES 15 using thepackage manager.

Page 8: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

Package Managers

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 6

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. OnOpenSUSE 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 forthe 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 kernelversion 4.4.0, the 4.4.0 kernel headers and development packages must also beinstalled.

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

Use the output of the uname command to determine the running kernel's versionand 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. Thekernel headers and development packages can then be installed with the followingcommand, replacing <variant> and <version> with the variant and versiondiscovered 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 modulesare loaded and the devices visible under /dev.

$ sudo reboot

Page 9: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

Package Managers

www.nvidia.comNVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 7

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

Page 10: NVIDIA Driver Installation Quickstart Guide€¦ · NVIDIA Driver Installation Quickstart Guide RN-08625-v1.0 _v01 | 2 Chapter 2. PACKAGE MANAGERS The Package Manager installation

Notice

THE INFORMATION IN THIS GUIDE AND ALL OTHER INFORMATION CONTAINED IN NVIDIA DOCUMENTATION

REFERENCED IN THIS GUIDE IS PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED,

STATUTORY, OR OTHERWISE WITH RESPECT TO THE INFORMATION FOR THE PRODUCT, AND EXPRESSLY

DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A

PARTICULAR PURPOSE. Notwithstanding any damages that customer might incur for any reason whatsoever,

NVIDIA’s aggregate and cumulative liability towards customer for the product described in this guide shall

be limited in accordance with the NVIDIA terms and conditions of sale for the product.

THE NVIDIA PRODUCT DESCRIBED IN THIS GUIDE IS NOT FAULT TOLERANT AND IS NOT DESIGNED,

MANUFACTURED OR INTENDED FOR USE IN CONNECTION WITH THE DESIGN, CONSTRUCTION, MAINTENANCE,

AND/OR OPERATION OF ANY SYSTEM WHERE THE USE OR A FAILURE OF SUCH SYSTEM COULD RESULT IN A

SITUATION THAT THREATENS THE SAFETY OF HUMAN LIFE OR SEVERE PHYSICAL HARM OR PROPERTY DAMAGE

(INCLUDING, FOR EXAMPLE, USE IN CONNECTION WITH ANY NUCLEAR, AVIONICS, LIFE SUPPORT OR OTHER

LIFE CRITICAL APPLICATION). NVIDIA EXPRESSLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS

FOR SUCH HIGH RISK USES. NVIDIA SHALL NOT BE LIABLE TO CUSTOMER OR ANY THIRD PARTY, IN WHOLE OR

IN PART, FOR ANY CLAIMS OR DAMAGES ARISING FROM SUCH HIGH RISK USES.

NVIDIA makes no representation or warranty that the product described in this guide will be suitable for

any specified use without further testing or modification. Testing of all parameters of each product is not

necessarily performed by NVIDIA. It is customer’s sole responsibility to ensure the product is suitable and

fit for the application planned by customer and to do 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 guide. NVIDIA does not accept any 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 guide, or (ii) customer product designs.

Other than the right for customer to use the information in this guide with the product, no other license,

either expressed or implied, is hereby granted by NVIDIA under this guide. Reproduction of information

in this guide is permissible only if reproduction is approved by NVIDIA in writing, is reproduced without

alteration, and is accompanied by all associated conditions, limitations, and notices.

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.

Copyright

© 2020 NVIDIA Corporation. All rights reserved.

www.nvidia.com