-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathtest_nvhpc.py
294 lines (276 loc) · 18.4 KB
/
test_nvhpc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=invalid-name, too-few-public-methods, bad-continuation
"""Test cases for the nvhpc module"""
from __future__ import unicode_literals
from __future__ import print_function
import logging # pylint: disable=unused-import
import unittest
from helpers import aarch64, centos, docker, ppc64le, ubuntu, x86_64, zen2
from hpccm.building_blocks.nvhpc import nvhpc
from hpccm.toolchain import toolchain
class Test_nvhpc(unittest.TestCase):
def setUp(self):
"""Disable logging output messages"""
logging.disable(logging.ERROR)
@x86_64
@ubuntu
@docker
def test_defaults_ubuntu(self):
"""Default HPC SDK building block"""
n = nvhpc(eula=True)
self.assertMultiLineEqual(str(n),
r'''# NVIDIA HPC SDK version 24.9
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
gnupg \
wget && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/share/keyrings && \
rm -f /usr/share/keyrings/DEB-GPG-KEY-NVIDIA-HPC-SDK.gpg && \
wget -qO - https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | gpg --dearmor -o /usr/share/keyrings/DEB-GPG-KEY-NVIDIA-HPC-SDK.gpg && \
echo "deb [signed-by=/usr/share/keyrings/DEB-GPG-KEY-NVIDIA-HPC-SDK.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /" >> /etc/apt/sources.list.d/hpccm.list && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
nvhpc-24-9-cuda-multi && \
rm -rf /var/lib/apt/lists/*
ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/include:$CPATH \
LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/lib64:$LD_LIBRARY_PATH \
MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/man:$MANPATH \
PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/bin:$PATH''')
@x86_64
@centos
@docker
def test_defaults_centos(self):
"""Default HPC SDK building block"""
n = nvhpc(eula=True)
self.assertMultiLineEqual(str(n),
r'''# NVIDIA HPC SDK version 24.9
RUN yum install -y \
ca-certificates && \
rm -rf /var/cache/yum/*
RUN yum install -y yum-utils && \
yum-config-manager --add-repo https://developer.download.nvidia.com/hpc-sdk/rhel/nvhpc.repo && \
yum install -y \
nvhpc-cuda-multi-24.9 && \
rm -rf /var/cache/yum/*
ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/include:$CPATH \
LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/lib64:$LD_LIBRARY_PATH \
MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/man:$MANPATH \
PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/bin:$PATH''')
@x86_64
@centos
@docker
def test_package_centos(self):
"""Local package"""
n = nvhpc(eula=True,
package='nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz')
self.assertMultiLineEqual(str(n),
r'''# NVIDIA HPC SDK version 20.7
COPY nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz
RUN yum install -y \
bc \
gcc \
gcc-c++ \
gcc-gfortran \
libatomic \
numactl-libs \
openssh-clients \
wget \
which && \
rm -rf /var/cache/yum/*
RUN mkdir -p /var/tmp && tar -x -f /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz -C /var/tmp -z && \
cd /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi && NVHPC_ACCEPT_EULA=accept NVHPC_INSTALL_DIR=/opt/nvidia/hpc_sdk NVHPC_SILENT=true ./install && \
rm -rf /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz
ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/math_libs/include:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/mpi/include:$CPATH \
LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/cuda/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/mpi/lib:$LD_LIBRARY_PATH \
MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/man:$MANPATH \
PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/mpi/bin:$PATH''')
@x86_64
@centos
@docker
def test_extended_environment(self):
"""Extended environment"""
n = nvhpc(eula=True, extended_environment=True,
package='nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz')
self.assertMultiLineEqual(str(n),
r'''# NVIDIA HPC SDK version 20.7
COPY nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz
RUN yum install -y \
bc \
gcc \
gcc-c++ \
gcc-gfortran \
libatomic \
numactl-libs \
openssh-clients \
wget \
which && \
rm -rf /var/cache/yum/*
RUN mkdir -p /var/tmp && tar -x -f /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz -C /var/tmp -z && \
cd /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi && NVHPC_ACCEPT_EULA=accept NVHPC_INSTALL_DIR=/opt/nvidia/hpc_sdk NVHPC_SILENT=true ./install && \
rm -rf /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi /var/tmp/nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz
ENV CC=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/nvc \
CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/math_libs/include:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/mpi/include:$CPATH \
CPP=cpp \
CXX=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/nvc++ \
F77=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/nvfortran \
F90=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/nvfortran \
FC=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin/nvfortran \
LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/cuda/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/mpi/lib:$LD_LIBRARY_PATH \
MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/man:$MANPATH \
PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/20.7/comm_libs/mpi/bin:$PATH''')
@aarch64
@ubuntu
@docker
def test_aarch64(self):
"""Default HPC SDK building block on aarch64"""
n = nvhpc(cuda_multi=False, eula=True, version='21.2', tarball=True)
self.assertMultiLineEqual(str(n),
r'''# NVIDIA HPC SDK version 21.2
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bc \
debianutils \
g++ \
gcc \
gfortran \
libatomic1 \
libnuma1 \
openssh-client \
wget && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://developer.download.nvidia.com/hpc-sdk/21.2/nvhpc_2021_212_Linux_aarch64_cuda_11.2.tar.gz && \
mkdir -p /var/tmp && tar -x -f /var/tmp/nvhpc_2021_212_Linux_aarch64_cuda_11.2.tar.gz -C /var/tmp -z && \
cd /var/tmp/nvhpc_2021_212_Linux_aarch64_cuda_11.2 && NVHPC_ACCEPT_EULA=accept NVHPC_INSTALL_DIR=/opt/nvidia/hpc_sdk NVHPC_SILENT=true ./install && \
rm -rf /var/tmp/nvhpc_2021_212_Linux_aarch64_cuda_11.2 /var/tmp/nvhpc_2021_212_Linux_aarch64_cuda_11.2.tar.gz
ENV CPATH=/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/math_libs/include:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/mpi/include:$CPATH \
LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/compilers/lib:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/cuda/lib64:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/mpi/lib:$LD_LIBRARY_PATH \
MANPATH=/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/compilers/man:$MANPATH \
PATH=/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/profilers/bin:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/compilers/bin:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/cuda/bin:/opt/nvidia/hpc_sdk/Linux_aarch64/21.2/comm_libs/mpi/bin:$PATH''')
@ppc64le
@ubuntu
@docker
def test_ppc64le(self):
"""Default HPC SDK building block on ppc64le"""
n = nvhpc(eula=True, cuda_multi=False, cuda='11.0', version='20.7',
tarball=True)
self.assertMultiLineEqual(str(n),
r'''# NVIDIA HPC SDK version 20.7
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bc \
debianutils \
g++ \
gcc \
gfortran \
libatomic1 \
libnuma1 \
openssh-client \
wget && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://developer.download.nvidia.com/hpc-sdk/20.7/nvhpc_2020_207_Linux_ppc64le_cuda_11.0.tar.gz && \
mkdir -p /var/tmp && tar -x -f /var/tmp/nvhpc_2020_207_Linux_ppc64le_cuda_11.0.tar.gz -C /var/tmp -z && \
cd /var/tmp/nvhpc_2020_207_Linux_ppc64le_cuda_11.0 && NVHPC_ACCEPT_EULA=accept NVHPC_DEFAULT_CUDA=11.0 NVHPC_INSTALL_DIR=/opt/nvidia/hpc_sdk NVHPC_SILENT=true ./install && \
rm -rf /var/tmp/nvhpc_2020_207_Linux_ppc64le_cuda_11.0 /var/tmp/nvhpc_2020_207_Linux_ppc64le_cuda_11.0.tar.gz
ENV CPATH=/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/math_libs/include:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/mpi/include:$CPATH \
LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/compilers/lib:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/cuda/lib64:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/mpi/lib:$LD_LIBRARY_PATH \
MANPATH=/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/compilers/man:$MANPATH \
PATH=/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/profilers/bin:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/compilers/bin:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/cuda/bin:/opt/nvidia/hpc_sdk/Linux_ppc64le/20.7/comm_libs/mpi/bin:$PATH''')
@x86_64
@ubuntu
@docker
def test_runtime_ubuntu(self):
"""Runtime"""
n = nvhpc(eula=True, redist=['compilers/lib/*'])
r = n.runtime()
self.assertMultiLineEqual(r,
r'''# NVIDIA HPC SDK
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libatomic1 \
libnuma1 \
openssh-client && \
rm -rf /var/lib/apt/lists/*
COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/compilers/lib/* /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib/
COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi
ENV LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:$LD_LIBRARY_PATH \
PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/bin:$PATH''')
@x86_64
@centos
@docker
def test_runtime_centos(self):
"""Runtime"""
n = nvhpc(eula=True, mpi=False,
redist=['comm_libs/11.8/nccl/lib/libnccl.so',
'compilers/lib/*',
'math_libs/11.8/lib64/libcufft.so.10',
'math_libs/11.8/lib64/libcublas.so.11'])
r = n.runtime()
self.assertMultiLineEqual(r,
r'''# NVIDIA HPC SDK
RUN yum install -y \
libatomic \
numactl-libs \
openssh-clients && \
rm -rf /var/cache/yum/*
COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/comm_libs/11.8/nccl/lib/libnccl.so /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/11.8/nccl/lib/libnccl.so
COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/compilers/lib/* /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib/
COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/math_libs/11.8/lib64/libcufft.so.10 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/11.8/lib64/libcufft.so.10
COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/math_libs/11.8/lib64/libcublas.so.11 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/11.8/lib64/libcublas.so.11
ENV LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/11.8/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/11.8/lib64:$LD_LIBRARY_PATH''')
@x86_64
@ubuntu
@docker
def test_makelocalrc(self):
"""makelocalrc"""
tc = toolchain(CC='gcc-10', CXX='g++-10', F77='gfortran-10')
n = nvhpc(eula=True, mpi=False, toolchain=tc, version='22.3')
self.assertMultiLineEqual(str(n),
r'''# NVIDIA HPC SDK version 22.3
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
gnupg \
wget && \
rm -rf /var/lib/apt/lists/*
RUN echo "deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /" >> /etc/apt/sources.list.d/hpccm.list && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
nvhpc-22-3-cuda-multi && \
rm -rf /var/lib/apt/lists/*
RUN /opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/bin/makelocalrc /opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/bin -x -gcc gcc-10 -gpp g++-10 -g77 gfortran-10
ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/math_libs/include:$CPATH \
LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/cuda/lib64:$LD_LIBRARY_PATH \
MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/man:$MANPATH \
PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/cuda/bin:$PATH''')
def test_toolchain(self):
"""Toolchain"""
n = nvhpc()
tc = n.toolchain
self.assertEqual(tc.CC, 'nvc')
self.assertEqual(tc.CXX, 'nvc++')
self.assertEqual(tc.FC, 'nvfortran')
self.assertEqual(tc.F77, 'nvfortran')
self.assertEqual(tc.F90, 'nvfortran')
@zen2
def test_toolchain_zen2(self):
"""CPU arch optimization flags"""
n = nvhpc()
tc = n.toolchain
self.assertEqual(tc.CFLAGS, '-tp zen2')
self.assertEqual(tc.CXXFLAGS, '-tp zen2')
self.assertEqual(tc.FFLAGS, '-tp zen2')
self.assertEqual(tc.FCFLAGS, '-tp zen2')