The cuda--translation of the Deep learning CUDA installation Guide for Linux (1) __linux

Source: Internet
Author: User
Tags cuda toolkit
NVIDIA CUDA installation Guide for Linux the Nvidia CUDA installation Guide under Linux systems 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).

Cuda® was invented by Nvidia as a parallel computing platform and programming model. It can significantly improve computational performance by leveraging the capabilities of the Graphics processing Unit (GPU).

CUDA is developed with several design goals in mind:
Cuda developed with several design objectives in mind:
Provide a small set of extensions to standard programming languages, like C, which enable a straightforward implementation of parallel algorithms. With CUDA/C + +, programmers can focus on the task of parallelization of the algorithms rather than spending time on the IR 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 to the GPU. As such, CUDA can be incrementally applied to existing applications. The CPU and the GPU are treated as separate devices that have their own memory. This configuration also allows simultaneous computation to the CPU and GPU without contention for memory.
Provides a small set of extensions for standard programming languages (such as C) that enable parallel algorithms to be implemented directly. Using Cuda/C + +, programmers can focus on the parallel tasks of algorithms rather than spend time on their implementations.
Supports heterogeneous computing, where applications use CPUs and GPU. The serial portion of the application runs on the CPU, and the parallel portion is unloaded to the GPU. Therefore, CUDA can be applied incrementally to existing applications. The CPU and the GPU are considered separate devices with their own storage space. This configuration also allows for simultaneous computation on both the CPU and the GPU, without contention for storage resources.
Cuda-capable GPUs have hundreds of cores that can collectively run thousands of computing threads. These cores have shared including a register file and a memory. The On-chip shared memory allows parallel tasks running on this cores to share data without sending it over the system me Mory Bus.
This guide'll show you and check the correct operation the CUDA development tools.
The Cuda-enabled GPU has hundreds of cores that can run thousands of compute threads together. These cores have shared resources, including register files and shared memory. On-Chip shared memory allows parallel tasks running on these cores to share data without sending data through the system memory bus.
This guide will show you how to install and check the correct operation of the Cuda development tool.1.1. System Requirements Systems Requirements

To use CUDA on your system, you'll need the following installed:
1. Cuda-capable GPU
2, a supported version of Linux with A gcc compiler and Toolchain
3. NVIDIA CUDA Toolkit (available at http://developer.nvidia.com/cuda-downloads)
To use Cuda on your system, you need to install the following software:
1, supporting the CUDA GPU
2, supported Linux version, with the GCC compiler and tool chain
3. NVIDIA CUDA Toolkit

The CUDA development environment relies on tight integration with the host development environment, including the host COM Piler and C runtime libraries, and is therefore only supported on distribution versions that have been to this CUDA Toolkit release.
The Cuda development environment relies on tight integration with the host development environment, including the host compiler and the C Run-time Library, so only the release versions that have been obtained for this CUDA Toolkit version are supported.

In Cuda table 1 native Linux distributions support 8.0

System Core GCC GLIBC
x86_64
Ubuntu 16.04 4.4.0 5.3.1 2.23
Ubuntu 14.04 3.13 4.8.2 2.19
(Only the Ubuntu system is listed, the rest is omitted) 1.2. about this Document

This document is intended to readers familiar with the Linux environment and the compilation of C programs nd line. You don't need previous experience with CUDA or experience with parallel computation. Note:this Guide covers installation only in systems with X Windows installed.
This document is intended to familiarize readers with the Linux environment and compile C programs from the command line. You do not need to have CUDA experience or parallel computing experience in advance. Note: This guide only describes installation on systems that have X windows installed.
Note:many commands in this document might require Superuser privileges. On most distributions of Linux, this'll require you to log in as root. For systems this have enabled the sudo package, use the sudo prefix for all necessary commands.
Note: Many of the commands in this article may require superuser privileges. On most Linux distributions, this will require you to log in as root. Use the sudo prefix for all necessary commands for a system that has the sudo pack enabled. 2.pre-installation Actions Pre-installation operation

Some actions must be taken before the CUDA Toolkit and Driver can is installed on Linux:
To use Cuda on your system, you need to install the following software:

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 GCC installed.
4. Verify the system has the correct kernel headers and development packages.
5, Download the NVIDIA CUDA Toolkit.
6, Handle conflicting installation methods.

1, verify that the system has support CUDA GPU.
2. Verify that the system is running a supported Linux version
3, verify that the system has been installed GCC
4, verify that the system installed the correct kernel head and development package
5. Download NVIDIA CUDA Toolkit
6, handling the conflict installation method
Note:you can override the Install-time prerequisite checks by running the installer with The-override. Remember that the prerequisites would still be required to use the NVIDIA CUDA Toolkit.
Note: You can override the installation time prerequisite check by running Setup using the-override flag. Keep in mind that prerequisites are still required to use the NVIDIA CUDA Toolkit. 2.1. Verify you Have a cuda-capable GPU Verify that you have a GPU that supports CUDA

To verify that your GPU are cuda-capable, go to your distribution ' s equivalent of System Properties, or, from the command l INE, enter:
To verify that your GPU supports CUDA, go to the equivalent system properties of your distribution, or enter from the command line:
$ LSPCI | Grep-i nvidia

If you don't have a 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 you do not see any settings, please update-pciids (commonly seen/sbin) at the command line and re-run the previous LSPCI command by entering the update Linux maintenance PCI hardware database.
If your graphics card are from NVIDIA and it are listed in Http://developer.nvidia.com/cuda-gpus, your The GPU is cuda-capable.
The release Notes for the CUDA Toolkit also contain a-list of supported products.
If your video card is from Nvidia, it's listed in Http://developer.nvidia.com/cuda-gpus, your GPU is supported by Cuda.
The version description of the CUDA toolkit also contains a list of supported products. 2.2. Verify you Have A supported version of Linux Verify that you have a supported Linux build

The CUDA Development Tools are only supported on some specific distributions of Linux. These are listed in the CUDA Toolkit release notes.
The Cuda development tool only supports specific Linux distributions. These are listed in the CUDA Toolkit version notes.
To determine which distribution and release number for your ' re running, type the following at the command line:
To determine the allocation and distribution number that you are running, type the following on the command line:

$ uname-m && cat/etc/* Release

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

x86_64 Red Hat Enterprise Linux Workstation Release 6.0 (Santiago)
The x86_64 line indicates your are running on a 64-bit system. The remainder gives information about your distribution.
X86_64 indicates that you are running on a 64-bit operating system. The remaining sections provide information about distribution. 2.3. Verify The system has GCC installed verify that GCC is installed

The GCC compiler is required for development using the CUDA Toolkit. It isn't 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 support Ed version of Linux would work correctly.
The GCC compiler is required for development using CUDA Toolkit. It is not required to run the Cuda application. It is usually installed as part of a Linux installation, and in most cases the version of GCC installed with the supported version of Linux will work correctly.

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

To verify the version of GCC that is installed on your system, type the following command at the command line:
$ gcc–version

If An error message displays, your need to install the development tools from your Linux distribution or obtain a version O F GCC and its accompanying toolchain from the Web.
If an error message is displayed, you will need to install the development tools from the Linux distribution or get version gcc and its accompanying tool chain from the web. 2.4. Verify The system has the correct Kernel Headers and Development Packages installed verify that the correct kernel headers and development packs are installed

The CUDA Driver requires that kernel headers and development to packages for the running version of the kernel to be inst Alled at the time of the driver installation, as a-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 M UST also be installed. The
Cuda driver requires that the kernel header files and development packs of the running version kernel be installed when the driver is installed and when the driver is rebuilt. For example, if your system is running a kernel version of 3.17.4-301, you must also install the 3.17.4-301 kernel header file and the development package.

While the Runfile installation performs no package validation, the RPM and Deb installations of the driver Attempt to install the kernel header and development packages if no version of this is packages currently. However, it would install the latest version of this packages, which may or would not match the version of the kernel your s Ystem is using. Therefore, it is best to manually ensure correct version of the kernel headers and development packages are Prior to installing the CUDA Drivers, as as the whenever version of the kernel.
Although the Runfile installation does not perform package validation, if the version of these packages is not currently installed, the driver's RPM and Deb installation will attempt to install the kernel header files and development packages. However, it will install the latest version of these packages, which may not match the kernel version used by your system. Therefore, it is a good idea to manually ensure that the correct version of the kernel header files and development packs are installed before installing the Cuda driver, and whenever you change the kernel version.
The version of the kernel your system is running can are found by running the following command:
$ uname-r

This is the version of the "Kernel headers and development packages that must are installed prior to installing the CUDA Dri Vers. This command would be used multiple the "below to specify" version of the packages to install. Note This below are the Common-case scenarios for kernel usage. More advanced cases, such as custom kernel branches, should ensure that their kernel, headers and sources match the kernel Build they are running.
This is the kernel header file and the version of the development package that must be installed before the Cuda driver is installed. This command is used several times below to specify the version of the package to install. Note that the following are common scenarios used by the kernel. More advanced situations, such as customizing kernel branches, should ensure that their kernel headers and sources match the build of the kernel they are running.

Rhel/centos system, Fedora system, opensuse/sles system

Ubuntu
The kernel headers and development packages for the currently running kernel can is installed with:
The kernel header files and development packs for the currently running kernel can be installed:

$ sudo apt-get install linux-headers  -  $ (uname-r)
Choose A installation Method Select installation Methods

The CUDA Toolkit can be installed using either of two different installation mechanisms:distribution-specific packages, O R a distribution-independent package. 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 system.
The CUDA Toolkit can be installed using two different installation mechanisms: A release-specific package or a package unrelated to the release. The distribution-independent package has the benefit of spanning a broader Linux distribution, but does not update the distributed local package management system. A distribution-specific package and a distributed local package management system interface. It is recommended that distribution-specific packages be used where possible.

Note: Standalone installers are not provided for architectures other than the x86_64 version. For native and cross development, you must use the distribution-specific setup installer to install the toolkit. For more detailed information, see the Cuda installation section. Download the nvidia CUDA Toolkit download nvidia CUDA Toolkit

The NVIDIA Cuda Toolkit is located in Http://developer.nvidia.com/cuda-downloads

Select 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 as a Librarie s, header files, CUDA samples source code, and other resources.
The CUDA Toolkit contains the CUDA drivers and tools needed to create, build, and run CUDA applications, as well as library, header files, Cuda sample source code, and other resources.

Download verification
The download can is verified by comparing the MD5 checksum posted at http://developer.nvidia.com/cuda-downloads/checksums With the downloaded file.
Download can verify http://developer.nvidia.com/cuda-downloads/checksums and download files by comparing the published MD5 checksum. If any checksum is different, the downloaded file is corrupted and needs to be downloaded again.

To calculate the MD5 checksum for the download file, run the following command:

$ md5sum <file>
the method of Handle Conflicting installation Methods dealing with conflicts

Before installing CUDA, any previously installations that could conflict is should. This is not affect systems which have is not had CUDA installed-previously, or systems where the installation method has is En preserved (rpm/deb vs. Runfile). The following charts for specifics.
Before installing Cuda, you should uninstall any installations that may have previously clashed. This does not affect systems that have not previously installed Cuda, or the system that retains the installation method (Rpm/deb vs. Runfile). For more information, see the chart below.

Uninstall the Toolkit Runfile installation using the following command:

$ sudo/usr/local/cuda-xy/bin/uninstall_cuda_x.y.pl

Uninstall the driver Runfile installation using the following command:

$ sudo/usr/bin/nvidia-uninstall

Uninstall the Rpm/deb installation using the following command:

$ sudo apt-get--purge remove <package_name>#for Ubuntu
3. Package Manager installation Package Manager installation 3.1Overview 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 would not but install.
Package Manager installation and system software package management system interface. When using RPM or Deb, the downloaded package is a repository package. Such packages only tell the package manager where to find the actual installation package, but they are not installed.
If Those packages are available in a online repository, they would be automatically downloaded in a later step. Otherwise, the repository package also installs a local repository containing the installation to on the system. Whether the repository is available online or installed locally, the installation procedure is identical and made of sever Al steps.
If these packages are available in the online repository, they will be automatically downloaded in subsequent steps. Otherwise, the repository package also installs the local repository containing the installation package on the system. Whether the repository is available online or installed locally, the installation process is the same, consisting of several steps.

Distribution-specific instructions detail to install CUDA:
Distribute specific instructions detailing how to install Cuda:

Rhel/centos system, Fedora system, opensuse/sles system

Some useful installation Package Manager features are noted at the end. 3.6 Ubuntu

1. Perform pre-installation operation
2. Install repository metadata (Install repository meta-data)
Note:when using a proxy server with aptitude, ensure this wget is set up to use the same proxy settings before installing The Cuda-repo package.

$ sudo dpkg-i cuda-repo-<distro> _ <version> _ <architecture> Deb

3, update apt repository cache
(Update the APT repository cache)

$ sudo apt-get update

4. Installation Cuda

$ sudo apt-get install Cuda

5, perform after installation operation (described below) 3.7 Additional Package Manager capabilities Add-on Package Manager features

The following are some additional features of the package manager. 3.7.1 Available Installation packages

The recommended installation package is the CUDA package. This package would install the full set of CUDA packages required for native development and should cover most SCENAR Ios.
The recommended installation package is the CUDA package. This package will install all the other Cuda packages required for native development and should cover most cases.
The Cuda package installs all of the available packages for native developments. That includes the compiler, the debugger, the profiler, the Math libraries,... For x86_64 Patforms, this also include Nsight Eclipse Edition and the Visual Profiler It also includes the NVIDIA driver P Ackage.
CUDA package installs all available local development packs. This includes compilers, debuggers, parsers, math libraries, for the x86_64 platform, which also includes the Nsight Eclipse version and the Visual Analyzer, which also includes the Nvidia driver package
On supported platforms, the CUDA-CROSS-ARMHF, Cuda-cross-aarch64,and cuda-cross-ppc64el packages all install Required for Cross-platform development to ARMV7, ARMV8, and POWER8, respectively. The libraries and header files of the target architecture ' s display driver package are also installed to enable the cross Compilation of driver applications. The arch packages does not install the native display driver.
On the supported platforms, the CUDA-CROSS-ARMHF, cuda-cross-aarch64, and Cuda-cross-ppc64el packages install all the packages needed for cross-platform development to ARMV7,ARMV8 and POWER8 respectively. The library and header files for the display driver package for the target architecture are also installed to enable cross compilation of the driver application. The arch package does not install the native display driver.

The packages installed by the packages above can also to installed individually by specifying their names.
Packages installed by the above packages can also be installed separately by explicitly specifying their names. A list of available packages can be obtained:

$ cat/var/lib/apt/lists/* Cuda * Packages | grep "Package:" #ubuntu
3.7.2 Package Upgrades

The Cuda package points to a stable version of the latest Cuda toolkit. When a new version is available, use the following command to upgrade the toolkit and drivers:
$ sudo apt-get install Cuda

The Cuda-drivers package points to the latest driver version provided in the Cuda repository. When a new version is available, use the following command to upgrade the driver:

$ sudo apt-get install cuda-drivers

To avoid any automatic upgrades and lock the Toolbox installation to the XY version, install CUDA-XY or CUDA-CROSS--X-Y package.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.