0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CentOS7にNVIDIA HPC SDKのインストール

Last updated at Posted at 2021-04-17

#概要
・NVIDIA HPC SDKとは
一言でいうと、GPU開発に必要なツールがある程度揃っている開発環境(SDK)です。
無料で使用することができます。
私は、以前有料で提供されていたOpenACCがNVIDIA HPC SDKに含まれており、
無料で使えるとのことなので、インストールしました。
以下に、NVIDIA HPC SDKのインストール方法を示します。

#インストールする上での注意事項
2021/04/17現在、NVIDIA HPC SDK Version 21.3が提供されています。
Version 21.3はCUDA 11.2を必要とするので、古いCUDAが入っている方は
予めCUDA 11.2にアップデートしておく必要があります。

#環境
インストールした環境をいかに示します。

# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
# uname -r
3.10.0-1160.11.1.el7.x86_64
# nvidia-smi
Sat Apr 17 12:21:51 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:01:00.0 Off |                  N/A |
| 18%   43C    P0    59W / 250W |      0MiB / 11176MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

#インストール方法
#######SDKのダウンロード&展開

・NVIDIA HPC SDK Version 21.3ダウンロード
$ wget https://developer.download.nvidia.com/hpc-sdk/21.3/nvhpc_2021_213_Linux_x86_64_cuda_11.2.tar.gz

・tar ball展開
$ tar xpzf nvhpc_2021_213_Linux_x86_64_cuda_11.2.tar.gz

#######SDKのインストール

# nvhpc_2021_213_Linux_x86_64_cuda_11.2/install

Welcome to the NVIDIA HPC SDK Linux installer!

You are installing NVIDIA HPC SDK 2021 version 21.3 for Linux_x86_64.
Please note that all Trademarks and Marks are the properties
of their respective owners.

Press enter to continue...


A network installation will save disk space by having only one copy of the
compilers and most of the libraries for all compilers on the network, and
the main installation needs to be done once for all systems on the network.

1  Single system install
2  Network install

Please choose install option:
1 ★1を選択

Please specify the directory path under which the software will be installed.
The default directory is /opt/nvidia/hpc_sdk, but you may install anywhere you wish,
assuming you have permission to do so.

Installation directory? [/opt/nvidia/hpc_sdk]
/opt_ext/nvidia/hpc_sdk ★SDKのインストール先を設定

Installing NVIDIA HPC SDK version 21.3 into /opt_ext/nvidia/hpc_sdk
localrc has not changed
Making symbolic links in /opt_ext/nvidia/hpc_sdk/Linux_x86_64/2021

generating environment modules for NV HPC SDK 21.3 ... done.
Installation complete.

Please check https://developer.nvidia.com for documentation,
use of NVIDIA HPC SDK software, and other questions.

#######パスを通す

export PATH=/opt_ext/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin:$PATH
export PATH=/opt_ext/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/man:$PATH
export PATH=/opt_ext/nvidia/hpc_sdk/Linux_x86_64/21.3/comm_libs/openmpi/openmpi-3.1.5/bin:$PATH
export PATH=/opt_ext/nvidia/hpc_sdk/Linux_x86_64/21.3/comm_libs/openmpi/openmpi-3.1.5/share/man:$PATH

#######コマンド実行
・pgaccelinfo、pgccコマンドが通り、以下のような情報が出力されます。

# pgaccelinfo

CUDA Driver Version:           11020
NVRM version:                  NVIDIA UNIX x86_64 Kernel Module  460.32.03  Sun Dec 27 19:00:34 UTC 2020

Device Number:                 0
Device Name:                   GeForce GTX 1080 Ti
Device Revision Number:        6.1
Global Memory Size:            11719409664
Number of Multiprocessors:     28
Concurrent Copy and Execution: Yes
Total Constant Memory:         65536
Total Shared Memory per Block: 49152
Registers per Block:           65536
Warp Size:                     32
Maximum Threads per Block:     1024
Maximum Block Dimensions:      1024, 1024, 64
Maximum Grid Dimensions:       2147483647 x 65535 x 65535
Maximum Memory Pitch:          2147483647B
Texture Alignment:             512B
Clock Rate:                    1582 MHz
Execution Timeout:             No
Integrated Device:             No
Can Map Host Memory:           Yes
Compute Mode:                  default
Concurrent Kernels:            Yes
ECC Enabled:                   No
Memory Clock Rate:             5505 MHz
Memory Bus Width:              352 bits
L2 Cache Size:                 2883584 bytes
Max Threads Per SMP:           2048
Async Engines:                 2
Unified Addressing:            Yes
Managed Memory:                Yes
Concurrent Managed Memory:     Yes
Preemption Supported:          Yes
Cooperative Launch:            Yes
  Multi-Device:                Yes
Default Target:                cc60

# pgcc
pgcc-Warning-No files to process

#今後
OpenACC(pgcc)を使ってGPUで計算させる予定です。
プログラム中にディレクティブを挿入するだけで
GPUに計算させることができるようです。

#参考
・OpenACCについて
https://hpcworld.jp/archive/SPG/Pgi/OpenACC/001.html#openacc

・NVIDIA HPC SDK
https://developer.nvidia.com/hpc-sdk

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?