[2] NVIDIA HPC SDK

11 marca 2022 Wyłączono przez Adam [zicherka] Nogły

Zainstalujemy teraz NVIDIA HPC SDK.

[1] Zainstaluj najpierw sterowniki Nvidia.

[2] Zainstaluj Nvidia HPC SDK.

[root@vlsr05 ~]# dnf group install "Development tools"
[root@vlsr05 ~]# dnf config-manager --add-repo https://developer.download.nvidia.com/hpc-sdk/rhel/nvhpc.repo
Dodawanie repozytorium z: https://developer.download.nvidia.com/hpc-sdk/rhel/nvhpc.repo
[root@vlsr05 ~]# dnf install nvhpc-22.2
[root@vlsr05 ~]# dnf install environment-modules
[root@vlsr05 ~]# mcedit /etc/environment-modules/modulespath
# dodaj ścieżkę
# This file defines the initial setup for the modulefiles search path
# Each line containing one or multiple paths delimited by ':' will be
# added to the MODULEPATH environment variable.
/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles:/opt/nvidia/hpc_sdk/modulefiles
[root@vlsr05 ~]# source /etc/profile.d/modules.sh
[root@vlsr05 ~]# module avail
--------------------------- /usr/share/Modules/modulefiles ---------------------------
dot  module-git  module-info  modules  null  use.own
-------------------------- /opt/nvidia/hpc_sdk/modulefiles ---------------------------
nvhpc-byo-compiler/22.2  nvhpc-nompi/22.2  nvhpc/22.2
[root@vlsr05 ~]# module load nvhpc/22.2
[root@vlsr05 ~]# nvc --version
nvc 22.2-0 64-bit target on x86-64 Linux -tp sandybridge
NVIDIA Compilers and Tools
Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.
[root@vlsr05 ~]# nvaccelinfo
CUDA Driver Version:           11060
NVRM version:                  NVIDIA UNIX x86_64 Kernel Module  510.47.03  Mon Jan 24 22:58:54 UTC 2022
Device Number:                 0
Device Name:                   NVIDIA GeForce GTX 1050
Device Revision Number:        6.1
Global Memory Size:            2097152000
Number of Multiprocessors:     5
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:                    1468 MHz
Execution Timeout:             No
Integrated Device:             No
Can Map Host Memory:           Yes
Compute Mode:                  default
Concurrent Kernels:            Yes
ECC Enabled:                   No
Memory Clock Rate:             3504 MHz
Memory Bus Width:              128 bits
L2 Cache Size:                 1048576 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:                cc61

[3] Sprawdź instalację ze zwykłym użytkownikiem, uruchamiając programy testowe.

[user01@vlsr05 ~]$ module load nvhpc/22.2

# program w języku C
[user01@vlsr05 ~]$ mcedit helloworld.c
# stwórz nowy
#include <stdio.h>
int main() {
  printf("Hello World\n");
}
# skompiluj
[user01@vlsr05 ~]$ nvc -o helloworld helloworld.c
# uruchom
[user01@vlsr05 ~]$ ./helloworld
Hello World

# program w języku C++
[user01@vlsr05 ~]$ mcedit helloworld.cpp
# stwórz nowy
#include <iostream>
int main() {
  std::cout << "Hello World!\n";
}
# skompiluj
[user01@vlsr05 ~]$ nvc++ -o helloworld2 helloworld.cpp
# uruchom
[user01@vlsr05 ~]$ ./helloworld2
Hello World!

# program w języku Fortran
[user01@vlsr05 ~]$ mcedit helloworld.f90
# stwórz nowy
program helloworld
  print *, 'Hello World!'
end program helloworld
# skompiluj
[user01@vlsr05 ~]$ nvfortran -o helloworld3 helloworld.f90
# uruchom
[user01@vlsr05 ~]$ ./helloworld3
 Hello World!