|
| 1 | +""" |
| 2 | +HPC Base image |
| 3 | +
|
| 4 | +Contents: |
| 5 | + CUDA |
| 6 | + FFTW |
| 7 | + GNU compilers |
| 8 | + HDF5 |
| 9 | + HPC-X (Open MPI, UCX, etc.) |
| 10 | + NetCDF |
| 11 | + + typical development environment |
| 12 | +
|
| 13 | + Use --userarg cuda_version=X.Y.Z and/or --userarg distro=<value> to |
| 14 | + alter the defaults, where X.Y.Z is 13.2.0, for instance, and the distro |
| 15 | + value is ubuntu24.04 or rockylinux9. |
| 16 | +""" |
| 17 | + |
| 18 | +cuda_version = USERARG.get('cuda_version', '13.2.0') |
| 19 | +distro = USERARG.get('distro', 'ubuntu24.04') |
| 20 | +runtime = USERARG.get('runtime', False) |
| 21 | + |
| 22 | +###### |
| 23 | +# Devel stage |
| 24 | +###### |
| 25 | + |
| 26 | +Stage0 += comment(__doc__, reformat=False) |
| 27 | + |
| 28 | +Stage0 += baseimage(image='nvcr.io/nvidia/cuda:{0}-devel-{1}'.format(cuda_version, distro), _as='devel') |
| 29 | + |
| 30 | +# Typical development environment |
| 31 | +common_packages = ['automake', 'autoconf', 'autoconf-archive', 'binutils', |
| 32 | + 'bzip2', 'ca-certificates', 'cmake', 'diffutils', 'file', |
| 33 | + 'gdb', 'git', 'gzip', 'libtool', 'make', 'numactl', 'patch', |
| 34 | + 'tar', 'vim', 'wget'] |
| 35 | +Stage0 += packages(apt=common_packages + ['libaec-dev', 'libnuma-dev', |
| 36 | + 'libsz2', 'lmod', 'xz-utils', |
| 37 | + 'zlib1g-dev'], |
| 38 | + epel=True, |
| 39 | + powertools=True if distro == 'rockylinux8' else False, |
| 40 | + yum=common_packages + ['Lmod', 'libaec-devel', |
| 41 | + 'numactl-devel', 'xz', 'zlib-devel']) |
| 42 | + |
| 43 | +# GNU compilers |
| 44 | +compiler = gnu() |
| 45 | +Stage0 += compiler |
| 46 | + |
| 47 | +# OFED |
| 48 | +Stage0 += ofed() |
| 49 | + |
| 50 | +# gdrcopy |
| 51 | +Stage0 += gdrcopy(ldconfig=True, version='2.4.2', annotate=True) |
| 52 | + |
| 53 | +# HPC-X |
| 54 | +Stage0 += hpcx(version='2.25.1', hpcxinit=False, inbox=True, ldconfig=True) |
| 55 | + |
| 56 | +# FFTW |
| 57 | +Stage0 += fftw(version='3.3.10', mpi=True, toolchain=compiler.toolchain, |
| 58 | + annotate=True) |
| 59 | + |
| 60 | +# HDF5 |
| 61 | +Stage0 += hdf5(version='1.14.5', toolchain=compiler.toolchain, annotate=True) |
| 62 | + |
| 63 | +# NetCDF |
| 64 | +Stage0 += netcdf(version='4.9.2', version_cxx='4.3.1', version_fortran='4.6.1', |
| 65 | + toolchain=compiler.toolchain, annotate=True) |
| 66 | + |
| 67 | +###### |
| 68 | +# Runtime image |
| 69 | +###### |
| 70 | + |
| 71 | +if runtime: |
| 72 | + Stage1 += baseimage(image='nvcr.io/nvidia/cuda:{0}-runtime-{1}'.format(cuda_version, distro)) |
| 73 | + |
| 74 | + Stage1 += Stage0.runtime(_from='devel') |
0 commit comments