NVIDIA CUDA Installation Guide for Linux

Installation Guide for Linux

Release 12.0 NVIDIA

Dec 08, 2022

Contents

1 System Requirements

3

2 OS Support Policy

7

3 About This Document

9

4 Pre-installation Actions

11

4.1 Verify You Have a CUDA-Capable GPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

4.2 Verify You Have a Supported Version of Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4.3 Verify the System Has gcc Installed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4.4 Verify the System has the Correct Kernel Headers and Development Packages Installed 12

4.5 Install MLNX_OFED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.6 Choose an Installation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.7 Download the NVIDIA CUDA Toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.8 Address Custom xorg.conf, If Applicable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.9 Handle Conflicting Installation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5 Package Manager Installation

17

5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2 RHEL 7 / CentOS 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.2.1 Prepare RHEL 7 / CentOS 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.2.2 Local Repo Installation for RHEL 7 / CentOS 7 . . . . . . . . . . . . . . . . . . . . . . 18

5.2.3 Network Repo Installation for RHEL 7 / CentOS 7 . . . . . . . . . . . . . . . . . . . . 19

5.2.4 Common Installation Intructions for RHEL 7 / CentOS 7 . . . . . . . . . . . . . . . . 19

5.2.5 Installing a Previous NVIDIA Driver Branch on RHEL 7 . . . . . . . . . . . . . . . . . 20

5.3 RHEL 8 / Rocky 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.3.1 Prepare RHEL 8 / Rocky 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.3.2 Local Repo Installation for RHEL 8 / Rocky 8 . . . . . . . . . . . . . . . . . . . . . . . 21

5.3.3 Network Repo Installation for RHEL 8 / Rocky 8 . . . . . . . . . . . . . . . . . . . . . 21

5.3.4 Common Instructions for RHEL 8 / Rocky 8 . . . . . . . . . . . . . . . . . . . . . . . . 22

5.4 RHEL 9 / Rocky 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.4.1 Prepare RHEL 9 / Rocky 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.4.2 Local Repo Installation for RHEL 9 / Rocky 9 . . . . . . . . . . . . . . . . . . . . . . . 23

5.4.3 Network Repo Installation for RHEL 9 / Rocky 9 . . . . . . . . . . . . . . . . . . . . . 23

5.4.4 Common Instructions for RHEL 9 / Rocky 9 . . . . . . . . . . . . . . . . . . . . . . . . 24

5.5 KylinOS 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.5.1 Prepare KylinOS 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.5.2 Local Repo Installation for KylinOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.5.3 Network Repo Installation for KylinOS . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.5.4 Common Instructions for KylinOS 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.6 Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.6.1 Prepare Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

i

5.6.2 Local Repo Installation for Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.6.3 Network Repo Installation for Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.6.4 Common Installation Intructions for Fedora . . . . . . . . . . . . . . . . . . . . . . . 26 5.7 SLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.7.1 Prepare SLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.7.2 Local Repo Installation for SLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.7.3 Network Repo Installation for SLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.7.4 Common Installation Instructions for SLES . . . . . . . . . . . . . . . . . . . . . . . . 28 5.8 OpenSUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.8.1 Prepare OpenSUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.8.2 Local Repo Installation for OpenSUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.8.3 Network Repo Installation for OpenSUSE . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.8.4 Common Installation Instructions for OpenSUSE . . . . . . . . . . . . . . . . . . . . 30 5.9 WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.9.1 Prepare WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.9.2 Local Repo Installation for WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.9.3 Network Repo Installation for WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.9.4 Common Installation Instructions for WSL . . . . . . . . . . . . . . . . . . . . . . . . 31 5.10 Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.10.1 Prepare Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.10.2 Local Repo Installation for Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.10.3 Network Repo Installation for Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.10.4 Common Installation Instructions for Ubuntu . . . . . . . . . . . . . . . . . . . . . . 33 5.11 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.11.1 Prepare Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.11.2 Local Repo Installation for Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.11.3 Network Repo Installation for Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.11.4 Common Installation Instructions for Debian . . . . . . . . . . . . . . . . . . . . . . 35 5.12 Additional Package Manager Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.12.1 Available Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.12.2 Optional 32-bit Packages for Linux x86_64 .deb/.rpm . . . . . . . . . . . . . . . . . 36 5.12.3 Package Upgrades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.12.4 Meta Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6 Driver Installation

39

7 NVIDIA Open GPU Kernel Modules

41

7.1 CUDA Runfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

7.2 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7.3 Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7.4 KylinOS 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7.5 RHEL 9 / Rocky 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7.6 RHEL 8 / Rocky 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7.7 RHEL 7 / CentOS 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

7.8 OpenSUSE / SLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

7.9 Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

8 Precompiled Streams

45

8.1 Precompiled Streams Support Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

8.2 Modularity Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

9 Kickstart Installation

49

9.1 RHEL 8 / Rocky Linux 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

9.2 RHEL 9 / Rocky Linux 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

ii

10 Runfile Installation

51

10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

10.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

10.3 Disabling Nouveau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

10.3.1 Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

10.3.2 RHEL/Rocky and KylinOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

10.3.3 OpenSUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

10.3.4 SLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

10.3.5 WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

10.3.6 Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

10.3.7 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

10.4 Device Node Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

10.5 Advanced Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

10.6 Uninstallation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

11 Conda Installation

59

11.1 Conda Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

11.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

11.3 Uninstallation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

11.4 Installing Previous CUDA Releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

12 Pip Wheels

61

13 Tarball and Zip Archive Deliverables

63

13.1 Parsing Redistrib JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

13.2 Importing Tarballs into CMake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

13.3 Importing Tarballs into Bazel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

14 CUDA Cross-Platform Environment

67

14.1 CUDA Cross-Platform Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

14.2 CUDA Cross-Platform Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

15 Post-installation Actions

69

15.1 Mandatory Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

15.1.1 Environment Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

15.1.2 POWER9 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

15.2 Recommended Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

15.2.1 Install Persistence Daemon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

15.2.2 Install Writable Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

15.2.3 Verify the Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

Verify the Driver Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

Running the Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

15.2.4 Install Nsight Eclipse Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

15.3 Optional Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

15.3.1 Install Third-party Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

15.3.2 Install the Source Code for cuda-gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

15.3.3 Select the Active Version of CUDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

16 Advanced Setup

77

17 Frequently Asked Questions

79

17.1 How do I install the Toolkit in a different location? . . . . . . . . . . . . . . . . . . . . . . . . 79

17.2 Why do I see "nvcc: No such file or directory" when I try to build a CUDA application? . . 79

iii

17.3 Why do I see "error while loading shared libraries: : cannot open shared object file: No such file or directory" when I try to run a CUDA application that uses a CUDA library? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

17.4 Why do I see multiple "404 Not Found" errors when updating my repository meta-data on Ubuntu? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

17.5 How can I tell X to ignore a GPU for compute-only use? . . . . . . . . . . . . . . . . . . . . . 80 17.6 Why doesn't the cuda-repo package install the CUDA Toolkit and Drivers? . . . . . . . . . 81 17.7 How do I get CUDA to work on a laptop with an iGPU and a dGPU running Ubuntu14.04? 81 17.8 What do I do if the display does not load, or CUDA does not work, after performing a

system update? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 17.9 How do I install a CUDA driver with a version less than 367 using a network repo? . . . . 82 17.10How do I install an older CUDA version using a network repo? . . . . . . . . . . . . . . . . . 82 17.11Why does the installation on SUSE install the Mesa-dri-nouveau dependency? . . . . . . 82 17.12How do I handle "Errors were encountered while processing: glx-diversions"? . . . . . . . 83

18 Additional Considerations

85

19 Switching between Driver Module Flavors

87

20 Removing CUDA Toolkit and Driver

91

21 Notices

95

21.1 Notice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

21.2 OpenCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

21.3 Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

iv

Installation Guide for Linux, Release 12.0

NVIDIA CUDA Installation Guide for Linux

The installation instructions for the CUDA Toolkit on Linux. CUDA? is a parallel computing platform and programming model invented by NVIDIA?. It enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU).

CUDA was developed with several design goals in mind:

Provide a small set of extensions to standard programming languages, like C, that enable a straightforward implementation of parallel algorithms. With CUDA C/C++, programmers can focus on the task of parallelization of the algorithms rather than spending time on their implementation.

Support heterogeneous computation where applications use both the CPU and GPU. Serial portions of applications are run on the CPU, and parallel portions are offloaded to the GPU. As such, CUDA can be incrementally applied to existing applications. The CPU and GPU are treated as separate devices that have their own memory spaces. This configuration also allows simultaneous computation on the CPU and GPU without contention for memory resources.

CUDA-capable GPUs have hundreds of cores that can collectively run thousands of computing threads. These cores have shared resources including a register file and a shared memory. The on-chip shared memory allows parallel tasks running on these cores to share data without sending it over the system memory bus.

This guide will show you how to install and check the correct operation of the CUDA development tools.

Contents

1

Installation Guide for Linux, Release 12.0

2

Contents

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download