Skip to content

Commit 27ea5ae

Browse files
authored
add cuda build of lammps + changes to other lammps containers (#14)
* add cuda build of lammps + changes to other lammps containers * chore * fix: change back dir after oras push from /mnt * fix tag of gnu image * delete sif files once pushed to ghcr
1 parent 3cf025a commit 27ea5ae

6 files changed

Lines changed: 102 additions & 7 deletions

.github/workflows/cicd.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,6 @@ jobs:
105105
106106
cd /mnt
107107
oras push "$oras_uri" --artifact-type "application/vnd.sylabs.sif.layer.v1.sif" "${sif_file}:application/vnd.sylabs.sif.layer.v1.sif"
108+
rm -f "${sif_file}"
109+
cd -
108110
done

inheritance-tree.png

-713 Bytes
Loading

lammps/lammps-2025.07.22.2-gnu.def

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ From: ghcr.io/exabyte-io/application-containers-public/almalinux-apptainer-gnu:9
1111
mpirun -np 1 apptainer exec <image>.sif lmp -i in.min
1212

1313
%environment
14-
export PATH=/usr/lib64/openmpi/bin:/opt/lammps-gnu-2025.07.22.2/bin:$PATH
15-
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
14+
export PATH=/usr/lib64/openmpi/bin:/opt/lammps-2025.07.22.2/bin:$PATH
1615

1716
%post
1817
# source env variables from base image
@@ -58,7 +57,7 @@ From: ghcr.io/exabyte-io/application-containers-public/almalinux-apptainer-gnu:9
5857
-D WITH_JPEG=yes \
5958
-D WITH_PNG=yes \
6059
-D WITH_FFMPEG=yes \
61-
-D CMAKE_INSTALL_PREFIX=/opt/lammps-gnu-2025.07.22.2 ./cmake
60+
-D CMAKE_INSTALL_PREFIX=/opt/lammps-2025.07.22.2 ./cmake
6261

6362
cmake --build _build -j$(nproc)
6463
cmake --install _build
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
Bootstrap: oras
2+
From: ghcr.io/exabyte-io/application-containers-public/almalinux-apptainer-intel-nvhpc:i2023.1-nv25.3-cuda-12.8-0
3+
Stage: devel
4+
5+
%post
6+
if [ -f /.singularity.d/env/91-environment.sh ]; then
7+
. /.singularity.d/env/91-environment.sh
8+
fi
9+
10+
# enable additional repos
11+
dnf in -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
12+
dnf in -y --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm
13+
14+
# install lammps specific dependencies
15+
dnf in -y ffmpeg \
16+
ffmpeg-devel \
17+
libjpeg-turbo \
18+
libjpeg-turbo-devel \
19+
libpng \
20+
libpng-devel
21+
22+
export __INTEL_PRE_CFLAGS="-diag-disable=10441"
23+
24+
# build lammps
25+
wget -q https://download.lammps.org/tars/lammps-22Jul2025_update2.tar.gz
26+
tar -xf lammps-22Jul2025_update2.tar.gz
27+
rm -f lammps-22Jul2025_update2.tar.gz
28+
cd lammps-22Jul2025
29+
30+
cmake -B _build \
31+
-C cmake/presets/most.cmake \
32+
-C cmake/presets/nolib.cmake \
33+
-C cmake/presets/gpu-cuda.cmake \
34+
-D CMAKE_BUILD_TYPE="Release" \
35+
-D BUILD_MPI=yes \
36+
-D BUILD_OMP=yes \
37+
-D CMAKE_CXX_STANDARD=17 \
38+
-D FFT=MKL \
39+
-D FFTW3_INCLUDE_DIR=${MKLROOT}/include/fftw \
40+
-D GPU_ARCH=sm_80 \
41+
-D CMAKE_CUDA_ARCHITECTURES=80 \
42+
-D KSPACE=yes \
43+
-D MC=yes \
44+
-D MOLECULE=yes \
45+
-D QEQ=yes \
46+
-D WITH_JPEG=yes \
47+
-D WITH_PNG=yes \
48+
-D WITH_FFMPEG=yes \
49+
-D CMAKE_INSTALL_PREFIX=/opt/lammps-2025.07.22.2 ./cmake
50+
51+
cmake --build _build -j$(nproc)
52+
cmake --install _build
53+
54+
#-------------------------------- Final image ---------------------------------#
55+
56+
Bootstrap: oras
57+
From: ghcr.io/exabyte-io/application-containers-public/almalinux-apptainer-base:9.7-1
58+
59+
%labels
60+
Maintainer Mat3ra.com
61+
Version lammps-2025.07.22.2-host-intel-2023.1-cuda-12.8-0
62+
63+
%help
64+
LAMMPS 2025.07.22.2 (requires mapping Intel OneAPI 2023.1 and CUDA 12.8 from
65+
the host)
66+
Example command:
67+
mpirun -np 1 apptainer exec --nv <image>.sif lmp -sf gpu -pk gpu 1 -i in.min
68+
69+
%files from devel
70+
/opt/lammps-2025.07.22.2 /opt/
71+
72+
%environment
73+
export PATH=/opt/lammps-2025.07.22.2/bin:$PATH
74+
75+
%post
76+
# enable additional repos
77+
dnf in -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
78+
dnf in -y --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm
79+
80+
# install lammps specific dependencies
81+
dnf in -y ffmpeg \
82+
ffmpeg-devel \
83+
libjpeg-turbo \
84+
libjpeg-turbo-devel \
85+
libpng \
86+
libpng-devel
87+
88+
# Clean up
89+
dnf clean all && rm -rf /var/cache/yum && rm -rf /var/cache/dnf

lammps/lammps-2025.07.22.2-host-intel-2023.1.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Stage: devel
4444
-D WITH_JPEG=yes \
4545
-D WITH_PNG=yes \
4646
-D WITH_FFMPEG=yes \
47-
-D CMAKE_INSTALL_PREFIX=/opt/lammps-2025.07.22.2-intel-2023.1 ./cmake
47+
-D CMAKE_INSTALL_PREFIX=/opt/lammps-2025.07.22.2 ./cmake
4848

4949
cmake --build _build -j$(nproc)
5050
cmake --install _build
@@ -56,18 +56,18 @@ From: ghcr.io/exabyte-io/application-containers-public/almalinux-apptainer-base:
5656

5757
%labels
5858
Maintainer Mat3ra.com
59-
Version lammps-2025.07.22.2-intel-2023.1
59+
Version lammps-2025.07.22.2-host-intel-2023.1
6060

6161
%help
6262
LAMMPS 2025.07.22.2 (requires mapping Intel OneAPI 2023.1 from the host)
6363
Example command:
6464
mpirun -np 2 apptainer exec <image>.sif lmp -i in.min
6565

6666
%files from devel
67-
/opt/lammps-2025.07.22.2-intel-2023.1 /opt/
67+
/opt/lammps-2025.07.22.2 /opt/
6868

6969
%environment
70-
export PATH=/opt/lammps-2025.07.22.2-intel-2023.1/bin:$PATH
70+
export PATH=/opt/lammps-2025.07.22.2/bin:$PATH
7171

7272
%post
7373
# enable additional repos

manifest.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ images:
6161
path: lammps/lammps-2025.07.22.2-host-intel-2023.1.def
6262
registry: ghcr.io/exabyte-io/application-containers-public/lammps
6363
tag: 2025.07.22.2-host-intel-2023.1-0
64+
# Intel + CUDA
65+
- name: lammps
66+
path: lammps/lammps-2025.07.22.2-host-intel-2023.1-cuda-12.8.def
67+
registry: ghcr.io/exabyte-io/application-containers-public/lammps
68+
tag: 2025.07.22.2-host-intel-2023.1-cuda-12.8-0
6469
# NanoLabo+MatterSim
6570
- name: nanolabo-mattersim
6671
path: nanolabo/nanolabo-mattersim.def

0 commit comments

Comments
 (0)