CS代写 DU-05347-301_v11.6 | March 2022

CUDA Quick Start Guide
DU-05347-301_v11.6 | March 2022

Table of Contents

Copyright By PowCoder代写 加微信 powcoder

Chapter 1. Introduction………………………………………………………………………………………….. 1
Chapter 2. Windows………………………………………………………………………………………………..2
2.1. Network Installer………………………………………………………………………………………………………. 2 2.2. Local Installer…………………………………………………………………………………………………………… 4 2.3. Pip Wheels – Windows………………………………………………………………………………………………..5 2.4. Conda………………………………………………………………………………………………………………………..7
Chapter 3. Linux……………………………………………………………………………………………………. 8
3.1. Linux x86_64………………………………………………………………………………………………………………8 3.1.1. Redhat / CentOS…………………………………………………………………………………………………..8 3.1.1.1. RPM Installer………………………………………………………………………………………………… 8 3.1.1.2. Runfile Installer…………………………………………………………………………………………….. 9 3.1.2. Fedora………………………………………………………………………………………………………………. 10 3.1.2.1. RPM Installer………………………………………………………………………………………………. 10 3.1.2.2. Runfile Installer…………………………………………………………………………………………… 11 3.1.3. SUSE Linux Enterprise Server……………………………………………………………………………..11 3.1.3.1. RPM Installer………………………………………………………………………………………………. 12 3.1.3.2. Runfile Installer…………………………………………………………………………………………… 12 3.1.4. OpenSUSE…………………………………………………………………………………………………………. 13 3.1.4.1. RPM Installer………………………………………………………………………………………………. 13 3.1.4.2. Runfile Installer…………………………………………………………………………………………… 14 3.1.5. Pip Wheels – Linux……………………………………………………………………………………………..14 3.1.6. Conda……………………………………………………………………………………………………………….. 16 3.1.7. WSL………………………………………………………………………………………………………………….. 16 3.1.8. Ubuntu……………………………………………………………………………………………………………….17 3.1.8.1. Debian Installer…………………………………………………………………………………………….17 3.1.8.2. Runfile Installer…………………………………………………………………………………………… 18 3.1.9. Debian………………………………………………………………………………………………………………. 19 3.1.9.1. Debian Installer…………………………………………………………………………………………….19 3.1.9.2. Runfile Installer…………………………………………………………………………………………… 19 3.2. Linux POWER8………………………………………………………………………………………………………….20 3.2.1. Ubuntu……………………………………………………………………………………………………………….20 3.2.1.1. Debian Installer…………………………………………………………………………………………….21 3.2.2. Redhat / CentOS…………………………………………………………………………………………………21 3.2.2.1. RPM Installer………………………………………………………………………………………………. 21 3.2.3. Conda……………………………………………………………………………………………………………….. 22
CUDA Quick Start Guide DU-05347-301_v11.6 | ii

Chapter 1. Introduction
This guide covers the basic instructions needed to install CUDA and verify that a CUDA application can run on each supported platform.
These instructions are intended to be used on a clean installation of a supported platform. For questions which are not answered in this document, please refer to the Windows Installation Guide and Linux Installation Guide.
The CUDA installation packages can be found on the CUDA Downloads Page.
CUDA Quick Start Guide DU-05347-301_v11.6 | 1

Chapter 2. Windows
When installing CUDA on Windows, you can choose between the Network Installer and the Local Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. For more details, refer to the Windows Installation Guide.
2.1. Network Installer
Perform the following steps to install CUDA and verify the installation.
1. Launch the downloaded installer package.
2. Read and accept the EULA.
3. Select “next” to download and install all components.
4. Once the download completes, the installation will begin automatically.
5. Once the installation completes, click “next” to acknowledge the Nsight Visual Studio Edition installation summary.
6. Click “close” to close the installer.
7. Navigate to the Samples’ nbody directory in https://github.com/nvidia/cuda-samples.
8. Open the nbody Visual Studio solution file for the version of Visual Studio you have installed, for example, nbody_vs2019.sln.
CUDA Quick Start Guide DU-05347-301_v11.6 | 2

9. Open the “Build” menu within Visual Studio and click “Build Solution”.
10.Navigate to the CUDA Samples’ build directory and run the nbody sample.
Note: Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
CUDA Quick Start Guide DU-05347-301_v11.6 | 3

2.2. Local Installer
Perform the following steps to install CUDA and verify the installation.
1. Launch the downloaded installer package.
2. Read and accept the EULA.
3. Select “next” to install all components.
4. Once the installation completes, click “next” to acknowledge the Nsight Visual Studio Edition installation summary.
5. Click “close” to close the installer.
6. Navigate to the Samples’ nbody directory in https://github.com/nvidia/cuda-samples.
7. Open the nbody Visual Studio solution file for the version of Visual Studio you have installed.
8. Open the “Build” menu within Visual Studio and click “Build Solution”.
CUDA Quick Start Guide DU-05347-301_v11.6 | 4

9. Navigate to the CUDA Samples’ build directory and run the nbody sample.
2.3. Pip Wheels – Windows
NVIDIA provides Python Wheels for installing CUDA through pip, primarily for using CUDA with Python. These packages are intended for runtime use and do not currently include developer tools (these can be installed separately).
Please note that with this installation method, CUDA installation environment is managed via pip and additional care must be taken to set up your host environment to use CUDA outside the pip environment.
Prerequisites
To install Wheels, you must first install the nvidia-pyindex package, which is required in order to set up your pip installation to fetch additional Python modules from the NVIDIA NGC PyPI repo. If your pip and setuptools Python modules are not up-to-date, then use the following command to upgrade these Python modules. If these Python modules are out-of- date then the commands which follow later in this section may fail.
py -m pip install –upgrade setuptools pip wheel
You should now be able to install the nvidia-pyindex module. py -m pip install nvidia-pyindex
Note: Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
CUDA Quick Start Guide DU-05347-301_v11.6 | 5

If your project is using a requirements.txt file, then you can add the following line to your requirements.txt file as an alternative to installing the nvidia-pyindex package:
–extra-index-url https://pypi.ngc.nvidia.com
Install the CUDA runtime package:
py -m pip install nvidia-cuda-runtime-cu11
Optionally, install additional packages as listed below using the following command:
py -m pip install nvidia- Metapackages
The following metapackages will install the latest version of the named component on Windows for the indicated CUDA version. “cu11” should be read as “cuda11”.
‣ nvidia-cuda-runtime-cu11 ‣ nvidia-cuda-cupti-cu11 ‣ nvidia-cuda-nvcc-cu11
‣ nvidia-nvml-dev-cu11
‣ nvidia-cuda-nvrtc-cu11
‣ nvidia-nvtx-cu11
‣ nvidia-cuda-sanitizer-api-cu11
‣ nvidia-cublas-cu11
‣ nvidia-cufft-cu11
‣ nvidia-curand-cu11
‣ nvidia-cusolver-cu11
‣ nvidia-cusparse-cu11
‣ nvidia-npp-cu11
‣ nvidia-nvjpeg-cu11
These metapackages install the following packages: ‣ nvidia-nvml-dev-cu114
‣ nvidia-cuda-nvcc-cu114
‣ nvidia-cuda-runtime-cu114 ‣ nvidia-cuda-cupti-cu114
CUDA Quick Start Guide
DU-05347-301_v11.6

‣ nvidia-cublas-cu114
‣ nvidia-cuda-sanitizer-api-cu114 ‣ nvidia-nvtx-cu114
‣ nvidia-cuda-nvrtc-cu114
‣ nvidia-npp-cu114
‣ nvidia-cusparse-cu114
‣ nvidia-cusolver-cu114
‣ nvidia-curand-cu114
‣ nvidia-cufft-cu114
‣ nvidia-nvjpeg-cu114
2.4. Conda packages are available at https://anaconda.org/nvidia.
Installation
To perform a basic install of all CUDA Toolkit components using Conda, run the following command:
$ conda install cuda -c nvidia
Uninstallation
To uninstall the CUDA Toolkit using Conda, run the following command:
$ conda remove cuda
CUDA Quick Start Guide
DU-05347-301_v11.6

Chapter 3. Linux
CUDA on Linux can be installed using an RPM, Debian, Runfile, or Conda package, depending on the platform being installed on.
3.1. Linux x86_64
For development on the x86_64 architecture. In some cases, x86_64 systems may act as host platforms targeting other architectures. See the Linux Installation Guide for more details.
3.1.1. Redhat / CentOS
When installing CUDA on Redhat or CentOS, you can choose between the Runfile Installer and the RPM Installer. The Runfile Installer is only available as a Local Installer. The RPM Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the RPM installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.1.1. RPM Installer
Perform the following steps to install CUDA and verify the installation.
1. Install EPEL to satisfy the DKMS dependency by following the instructions at EPEL’s
2. Enable optional repos:
On RHEL 7 Linux only, execute the following steps to enable optional repositories.
‣ On x86_64 workstation:
$ subscription-manager repos –enable=rhel-7-workstation-optional-rpms
‣ On POWER9 system:
$ subscription-manager repos –enable=rhel-7-for-power-9-optional-rpms
‣ On x86_64 server:
$ subscription-manager repos –enable=rhel-7-server-optional-rpms
CUDA Quick Start Guide DU-05347-301_v11.6 | 8

3. Install the repository meta-data, clean the yum cache, and install CUDA:
4. Reboot the system to load the NVIDIA drivers:
$ sudo reboot
5. Set up the development environment by modifying the PATH and LD_LIBRARY_PATH
variables:
6. Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/ cuda-samples/tree/master/Samples/nbody.
3.1.1.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
1. Disable the Nouveau drivers:
a). Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
b). Regenerate the kernel initramfs:
$ sudo dracut –force
2. Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to
the end of the system’s kernel boot parameters.
3. Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda__linux.run –silent
4. Create an xorg.conf file to use the NVIDIA GPU for display:
$ sudo nvidia-xconfig
5. Reboot the system to load the graphical interface:
$ sudo reboot
$ sudo rpm –install cuda-repo-..rpm $ sudo yum clean expire-cache
$ sudo yum install cuda
$ export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}} $ export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Note: Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
blacklist nouveau
options nouveau modeset=0
CUDA Quick Start Guide
DU-05347-301_v11.6

6. Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
7. Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/ cuda-samples/tree/master/Samples/nbody.
3.1.2. installing CUDA on Fedora, you can choose between the Runfile Installer and the RPM Installer. The Runfile Installer is only available as a Local Installer. The RPM Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the RPM installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.2.1. RPM Installer
Perform the following steps to install CUDA and verify the installation.
1. Install the RPMFusion free repository to satisfy the Akmods dependency:
2. Install the repository meta-data, clean the dnf cache, and install CUDA:
3. Reboot the system to load the NVIDIA drivers:
$ sudo reboot
4. Set up the development environment by modifying the PATH and LD_LIBRARY_PATH
variables:
5. Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/ cuda-samples/tree/master/Samples/nbody.
$ export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}} $ export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Note: Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
$ su -c ‘dnf install –nogpgcheck http://download1.rpmfusion.org/free/fedora/ rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm’
$ sudo rpm –install cuda-repo-..rpm $ sudo dnf clean expire-cache
$ sudo dnf install cuda
$ export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}} $ export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Note: Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
CUDA Quick Start Guide DU-05347-301_v11.6 | 10

3.1.2.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
1. Disable the Nouveau drivers:
a). Create a file at /usr/lib/modprobe.d/blacklist-nouveau.conf with the following contents:
b). Regenerate the kernel initramfs:
$ sudo dracut –force c). Run the below command:
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg d). Reboot the system:
$ sudo reboot
2. Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to
the end of the system’s kernel boot parameters.
3. Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda__linux.run –silent
4. Create an xorg.conf file to use the NVIDIA GPU for display:
$ sudo nvidia-xconfig
5. Reboot the system to load the graphical interface.
6. Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
7. Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/ cuda-samples/tree/master/Samples/nbody.
3.1.3. SUSE Linux Enterprise Server
When installing CUDA on SUSE Linux Enterprise Server, you can choose between the Runfile Installer and the RPM Installer. The Runfile Installer is only available as a Local Installer. The RPM Installer is available as both a Local Installer and a Network Installer. The Network
blacklist nouveau
options nouveau modeset=0
$ export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}} $ export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Note: Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
CUDA Quick Start Guide DU-05347-301_v11.6 | 11

Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the RPM installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.3.1. RPM Installer
Perform the following steps to install CUDA and verify the installation.
1. Install the repository meta-data, refresh the Zypper cache, and install CUDA:
2. Add the user to the video group:
$ sudo usermod -a -G video
3. Reboot the system to load the NVIDIA drivers:
$ sudo reboot
4. Set up the development environment by modifying the PATH and LD_LIBRARY_PATH
variables:
5. Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the vectorAdd sample using the Linux instructions in https://github.com/ NVIDIA/cuda-samples/tree/master/Samples/vectorAdd.
3.1.3.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
1. Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.
2. Run the installer silently to install with the default selections (implies acceptance of the EULA):
$ sudo rpm –install cuda-repo-..rpm $ sudo SUSEConnect –product PackageHub/15/x86_64
$ sudo zypper refresh
$ sudo zypper install cuda
$ export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}} $ export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Note: Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
sudo sh cuda__linux.run –silent
3. Create an xorg.conf file to use the NVIDIA GPU for display:
$ sudo nvidia-xconfig
4. Reboot the system to load the graphical interface:

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com