Меню Рубрики

Установка cuda на centos

Установка cuda на centos

The installation instructions for the CUDA Toolkit on Linux.

1. Introduction

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).

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

1.1. System Requirements

The CUDA development environment relies on tight integration with the host development environment, including the host compiler and C runtime libraries, and is therefore only supported on distribution versions that have been qualified for this CUDA Toolkit release.

Table 1. Native Linux Distribution Support in CUDA 10.2

Distribution Kernel* GCC GLIBC ICC PGI XLC CLANG
x86_64
RHEL 8.1 4.18 8.2.1 2.28
RHEL 7.7 3.10 4.8.5 2.17 19.0 18.x, 19.x NO 8.0.0
RHEL 6.10 2.6.32 4.4.7 2.12
CentOS 7.7 3.10 4.8.5 2.17
CentOS 6.10 2.6.32 4.4.7 2.12
Fedora 29 4.16 8.0.1 2.27
OpenSUSE Leap 15.1 4.15.0 7.3.1 2.26
SLES 15.1 4.12.14 7.2.1 2.26
SLES 12.4 4.12.14 4.8.5 2.22
Ubuntu 18.04.3 (**) 4.15.0 7.3.0 2.27
Ubuntu 16.04.6 (**) 4.4 5.4.0 2.23
POWER8(***)
RHEL 7.6 3.10 4.8.5 2.17 NO 18.x, 19.x 13.1.x, 16.1.x 8.0.0
Ubuntu 18.04.1 4.15.0 7.3.0 2.27 NO 18.x, 19.x 13.1.x, 16.1.x 8.0.0
POWER9(****)
Ubuntu 18.04.1 4.15.0 7.3.0 2.27 NO 18.x, 19.x 13.1.x, 16.1.x 8.0.0
RHEL 7.6 IBM Power LE 4.14.0 4.8.5 2.17 NO 18.x, 19.x 13.1.x, 16.1.x 8.0.0

(*) For specific kernel versions supported on Red Hat Enterprise Linux, visit https://access.redhat.com/articles/3078. For a list of kernel versions including the release dates for SUSE Linux Enterprise Server is available at https://wiki.microfocus.com/index.php/SUSE/SLES/Kernel_versions.

(**) For Ubuntu LTS on x86-64, both the HWE kernel (e.g. 4.13.x for 16.04.4) and the server LTS kernel (e.g. 4.4.x for 16.04) are supported in CUDA 10.2 . Visit https://wiki.ubuntu.com/Kernel/Support for more information.

(***) Only the Tesla GP100 GPU is supported for CUDA 10.2 on POWER8.

(****) Only the Tesla GV100 GPU is supported for CUDA 10.2 on POWER9.

1.2. About This Document

This document is intended for readers familiar with the Linux environment and the compilation of C programs from the command line. You do not need previous experience with CUDA or experience with parallel computation. Note: This guide covers installation only on systems with X Windows installed.

2. Pre-installation Actions

2.1. Verify You Have a CUDA-Capable GPU

To verify that your GPU is CUDA-capable, go to your distribution’s equivalent of System Properties, or, from the command line, enter:

If you do not see any settings, update the PCI hardware database that Linux maintains by entering update-pciids (generally found in /sbin ) at the command line and rerun the previous lspci command.

If your graphics card is from NVIDIA and it is listed in http://developer.nvidia.com/cuda-gpus, your GPU is CUDA-capable.

The Release Notes for the CUDA Toolkit also contain a list of supported products.

2.2. Verify You Have a Supported Version of Linux

The CUDA Development Tools are only supported on some specific distributions of Linux. These are listed in the CUDA Toolkit release notes.

To determine which distribution and release number you’re running, type the following at the command line:

You should see output similar to the following, modified for your particular system:

The x86_64 line indicates you are running on a 64-bit system. The remainder gives information about your distribution.

2.3. Verify the System Has gcc Installed

The gcc compiler is required for development using the CUDA Toolkit. It is not required for running CUDA applications. It is generally installed as part of the Linux installation, and in most cases the version of gcc installed with a supported version of Linux will work correctly.

To verify the version of gcc installed on your system, type the following on the command line:

If an error message displays, you need to install the from your Linux distribution or obtain a version of gcc and its accompanying toolchain from the Web.

2.4. Verify the System has the Correct Kernel Headers and Development Packages Installed

The CUDA 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 3.17.4-301, the 3.17.4-301 kernel headers and development packages must also be installed.

While the Runfile installation performs no package val >Therefore, it is best to manually ensure the correct version of the kernel headers and development packages are installed prior to installing the CUDA Drivers, as well as whenever you change the kernel version.

RHEL/CentOS

Fedora

OpenSUSE/SLES

Ubuntu

2.5. Choose an Installation Method

The CUDA Toolkit can be installed using either of two different installation mechanisms: distribution-specific packages (RPM and Deb packages), or a distribution-independent package (runfile packages). The distribution-independent package has the advantage of working across a wider set of Linux distributions, but does not update the distribution’s native package management system. The distribution-specific packages interface with the distribution’s native package management system. It is recommended to use the distribution-specific packages, where possible.

2.6. Download the NV >

Choose the platform you are using and download the NVIDIA CUDA Toolkit

The CUDA Toolkit contains the CUDA driver and tools needed to create, build and run a CUDA application as well as libraries, header files, CUDA samples source code, and other resources.

Download Verification

The download can be verified by comparing the MD5 checksum posted at http://developer.nvidia.com/cuda-downloads/checksums with that of the downloaded file. If either of the checksums differ, the downloaded file is corrupt and needs to be downloaded again.

2.7. Handle Conflicting Installation Methods

Before installing CUDA, any previously installations that could conflict should be uninstalled. This will not affect systems which have not had CUDA installed previously, or systems where the installation method has been preserved (RPM/Deb vs. Runfile). See the following charts for specifics.

Table 2. CUDA Toolkit Installation Compatibility Matrix

Installed Toolkit Version == X.Y Installed Toolkit Version != X.Y
RPM/Deb run RPM/Deb run
Installing Toolkit Version X.Y RPM/Deb No Action Uninstall Run No Action No Action
run Uninstall RPM/Deb Uninstall Run No Action No Action
Table 3. NVIDIA Driver Installation Compatibility Matrix

Installed Driver Version == X.Y Installed Driver Version != X.Y
RPM/Deb run RPM/Deb run
Installing Driver Version X.Y RPM/Deb No Action Uninstall Run No Action Uninstall Run
run Uninstall RPM/Deb No Action Uninstall RPM/Deb No Action

3. Package Manager Installation

Basic instructions can be found in the Quick Start Guide. Read on for more detailed instructions.

3.1. Overview

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.

If those packages are available in an online repository, they will be automatically downloaded in a later step. Otherwise, the repository package also installs a local repository containing the installation packages on the system. Whether the repository is available online or installed locally, the installation procedure is identical and made of several steps.

Finally, some helpful package manager capabilities are detailed.

These instructions are for native development only. For cross-platform development, see the CUDA Cross-Platform Environment section.

3.2. Redhat/CentOS

    Satisfy DKMS dependency: The NV >libvdpau . Those packages are only available on third-party repositories, such as EPEL. Any such third-party repositories must be added to the package manager repository database before installing the NV >Enable optional repos:

On RHEL 7 Linux only, execute the following steps to enable optional repositories.

The driver relies on an automatically generated xorg.conf file at /etc/X11/xorg.conf. If a custom-built xorg.conf file is present, this functionality will be disabled and the driver may not work. You can try removing the existing xorg.conf file, or adding the contents of /etc/X11/xorg.conf.d/00-nvidia.conf to the xorg.conf file. The xorg.conf file will most likely need manual tweaking for systems with a non-trivial GPU configuration.

Install repository meta-data

The libcuda.so library is installed in the /usr/lib<,64>/nvidia directory. For pre-existing projects which use libcuda.so, it may be useful to add a symbolic link from libcuda.so in the /usr/lib <,64>directory.

3.3. Fedora

The driver relies on an automatically generated xorg.conf file at /etc/X11/xorg.conf. If a custom-built xorg.conf file is present, this functionality will be disabled and the driver may not work. You can try removing the existing xorg.conf file, or adding the contents of /etc/X11/xorg.conf.d/00-nvidia.conf to the xorg.conf file. The xorg.conf file will most likely need manual tweaking for systems with a non-trivial GPU configuration.

Satisfy Akmods dependency

The NVIDIA driver RPM packages depend on the Akmods framework which is provided by the RPMFusion free repository. The RPMFusion free repository must be added to the package manager repository database before installing the NVIDIA driver RPM packages, or missing dependencies will prevent the installation from proceeding.

Install repository meta-data

The libcuda.so library is installed in the /usr/lib<,64>/nvidia directory. For pre-existing projects which use libcuda.so, it may be useful to add a symbolic link from libcuda.so in the /usr/lib <,64>directory.

3.4. SLES

  1. Perform the pre-installation actions.
  2. On SLES12 SP4, install the Mesa-libgl-devel Linux packages before proceeding. See Mesa-libGL-devel.
  3. Install repository meta-data

The CUDA Samples package on SLES does not include dependencies on GL and X11 libraries as these are provided in the SLES SDK. These packages must be installed separately, depending on which samples you want to use.

3.5. OpenSUSE

3.6. Ubuntu

When installing using the local repo:

When installing using network repo on Ubuntu 18.04/18.10:

When installing using network repo on Ubuntu 16.04:

3.7. Additional Package Manager Capabilities

Below are some additional capabilities of the package manager that users can take advantage of.

3.7.1. Available Packages

The recommended installation package is the cuda package. This package will install the full set of other CUDA packages required for native development and will cover most scenarios.

The packages installed by the cross-platform development packages above can also be installed individually by specifying their names explicitly. The list of available packages be can obtained with:

3.7.2. Package Upgrades

The cuda package points to the latest stable release of the CUDA Toolkit. When a new version is available, use the following commands to upgrade the toolkit and driver:

The cuda-drivers package points to the latest driver release available in the CUDA repository. When a new version is available, use the following commands to upgrade the driver:

Some desktop environments, such as GNOME or KDE, will display an notification alert when new packages are available.

To avo >cuda-X-Y or cuda-cross—X-Y package.

S >cuda-X.Y and cuda-X.Y+1 packages.

3.7.3. Meta Packages

Meta packages are RPM/Deb packages which contain no (or few) files but have multiple dependencies. They are used to install many CUDA packages when you may not know the details of the packages you want. Below is the list of meta packages.

Table 4. Meta Packages Available for CUDA 10.2

Meta Package Purpose
cuda Installs all CUDA Toolkit and Driver packages. Handles upgrading to the next version of the cuda package when it’s released.
cuda- 10 — 2 Installs all CUDA Toolkit and Driver packages. Remains at version 10.2 until an additional version of CUDA is installed.
cuda-toolkit- 10 — 2 Installs all CUDA Toolkit packages required to develop CUDA applications. Does not include the driver.
cuda-tools- 10 — 2 Installs all CUDA command line and visual tools.
cuda-runtime- 10 — 2 Installs all CUDA Toolkit packages required to run CUDA applications, as well as the Driver packages.
cuda-compiler- 10 — 2 Installs all CUDA compiler packages.
cuda-libraries- 10 — 2 Installs all runtime CUDA Library packages.
cuda-libraries-dev- 10 — 2 Installs all development CUDA Library packages.
cuda-drivers Installs all Driver packages. Handles upgrading to the next version of the Driver packages when they’re released.

4. Runfile Installation

Basic instructions can be found in the Quick Start Guide. Read on for more detailed instructions.

This section describes the installation and configuration of CUDA when using the standalone installer. The standalone installer is a «.run» file and is completely self-contained.

4.1. Overview

The Runfile installation installs the NVIDIA Driver, the CUDA Toolkit, and CUDA Samples, via an interactive ncurses-based interface.

The installation steps are listed below. Distribution-specific instructions for disabling the Nouveau drivers, and the steps for verifying device node creation, are also provided.

Finally, the advanced options for the installer and the uninstallation steps are detailed below.

The Runfile installation does not include support for cross-platform development. For cross-platform development, see the CUDA Cross-Platform Environment section.

4.2. Installation

Reboot into text mode (runlevel 3).

This can usually be accomplished by adding the number «3» to the end of the system’s kernel boot parameters.

Since the NVIDIA drivers are not yet installed, the text terminals may not display correctly. Temporarily adding «nomodeset» to the system’s kernel boot parameters may fix this issue.

Consult your system’s bootloader documentation for information on how to make the above boot parameter changes.

The reboot is required to completely unload the Nouveau drivers and prevent the graphical interface from loading. The CUDA driver cannot be installed while the Nouveau drivers are loaded or while the graphical interface is active.

Verify that the Nouveau drivers are not loaded. If the Nouveau drivers are still loaded, consult your distribution’s documentation to see if further steps are needed to disable Nouveau.

See Installer UI for navigating the ncurses-based installer UI.

As of CUDA 10.1 some libraries will be installed in the system standard locations rather than in the Toolkit installation directory. Depending on your distribution these installed locations can be either: /usr/lib/x84_64-linux-gnu , or /usr/lib64 , or /usr/lib . See the Advanced Options for how to change this location.

Component Default Installation Directory
CUDA Toolkit /usr/local/cuda- 10.2
CUDA Samples $(HOME)/NV >10.2 _Samples

The /usr/local/cuda symbolic link points to the location where the CUDA Toolkit was installed. This link allows projects to use the latest CUDA Toolkit without any configuration file update.

Running the installer with sudo, as shown above, will give permission to install to directories that require root permissions. Directories and files created while running the installer with sudo will have root ownership.

If installing the driver, the installer will also ask if the openGL libraries should be installed. If the GPU used for display is not an NV >—no-opengl-libs option should be used to prevent the openGL libraries from being installed. See the Advanced Options section for more details.

If the GPU used for display is an NV >/etc/X11/xorg.conf , may need to be modified. In some cases, nvidia-xconfig can be used to automatically generate a xorg.conf file that works for the system. For non-standard systems, such as those with more than one GPU, it is recommended to manually edit the xorg.conf file. Consult the xorg.conf documentation for more information.

Reboot the system to reload the graphical interface.

Verify the device nodes are created properly.

4.3. Installer UI

The installer UI has three main states:

  1. EULA Acceptance.
    1. Scroll through the EULA using the arrow keys, the page up/down keys, or a scroll wheel.
  2. Component Selection.
    1. Navigate the menu using the arrow keys. The left/right keys will expand/collapse sub-elements.
    2. Select or deselect items to install by pressing the spacebar or enter key with the cursor on that item.
    3. With the cursor over an item with advanced options available, press ‘A’ to see that options menu. This is currently available for CUDA Toolkit and CUDA Samples items only.
  3. Advanced Options.
    1. Options such as setting the install path for a specific component are available here.

4.4. Disabling Nouveau

To install the Display Driver, the Nouveau drivers must first be disabled. Each distribution of Linux has a different method for disabling Nouveau.

4.4.1. Fedora

  1. Create a file at /usr/lib/modprobe.d/blacklist-nouveau.conf with the following contents:
  2. Regenerate the kernel initramfs:
  3. Run the below command:
  4. Reboot the system.

4.4.2. RHEL/CentOS

  1. Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
  2. Regenerate the kernel initramfs:

4.4.3. OpenSUSE

  1. Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
  2. Regenerate the kernel initrd:

4.4.4. SLES

No actions to disable Nouveau are required as Nouveau is not installed on SLES.

4.4.5. Ubuntu

  1. Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
  2. Regenerate the kernel initramfs:

4.5. Device Node Verification

Check that the device files /dev/nvidia* exist and have the correct (0666) file permissions. These files are used by the CUDA Driver to communicate with the kernel-mode portion of the NV >nvidia-modprobe tool that is bundled with the NVIDIA Driver. However, some systems disallow setuid binaries, so if these files do not exist, you can create them manually by using a startup script such as the one below:

4.6. Advanced Options

Action Options Used Explanation
Silent Installation —silent Required for any silent installation. Performs an installation with no further user-input and minimal command-line output based on the options provided below. Silent installations are useful for scripting the installation of CUDA. Using this option implies acceptance of the EULA. The following flags can be used to customize the actions taken during installation. At least one of —driver, —uninstall, —toolkit, and —samples must be passed if running with non-root permissions.
—driver Install the CUDA Driver.
—toolkit Install the CUDA Toolkit.
—toolkitpath=

Install the CUDA Toolkit to the

directory. If not prov >/usr/local/cuda- 10.2 is used. —samples Install the CUDA Samples. —samplespath=

Install the CUDA Samples to the

directory. If not prov >$(HOME)/NV >10.2 _Samples is used. —defaultroot=

is not prov >This only applies to the libraries installed outside of the CUDA Toolkit path. Extraction —extract=

the following: the driver runfile, the raw files of the toolkit and samples to

This is especially useful when one wants to install the driver using one or more of the command-line options provided by the driver installer which are not exposed in this installer.

источник

Читайте также:  Установка автосигнализации на hyundai tucson

Добавить комментарий

Adblock
detector