Skip to content

Commit 4bfafe4

Browse files
bobcao3claude
andcommitted
fix(slurm/ib): build slurm against HPC-X SDK PMIx 5 (OMPI 5)
DOCA-OFED's openmpi.deb does not expose a link-clean libpmix: its libpmix.so has 21 unresolved references to opal_libevent2022_* and opal_hwloc201_* symbols inside libopen-pal, so slurm's autoconf AC_LINK_IFELSE on -lpmix fails ("unable to locate pmix installation"). Switch the IB image to NVIDIA HPC-X SDK v2.26 (CUDA13 build) instead. HPC-X ships a self-contained OMPI 5 + PMIx 5.0.10rc3 stack at /opt/mellanox/hpcx/ompi5/. Its libpmix.so has clean DT_NEEDED entries (libevent_core, libevent_pthreads, libhwloc) and DT_RUNPATH=$ORIGIN/. so it links and runs cleanly without dragging in libopen-pal. slurm is now configured --with-pmix=/opt/mellanox/hpcx/ompi5, which makes slurm's autoconf bake -Wl,-rpath,/opt/mellanox/hpcx/ompi5/lib into mpi_pmix_v5.so. slurmstepd dlopens libpmix.so.2 via that RPATH at MPI step launch — no /etc/ld.so.conf.d entry for HPC-X is needed (and adding one would make slurmd link against HPC-X's bundled libhwloc.so.15 during dh_shlibdeps and break the .deb build). DOCA-OFED apt repo is still used for IB userland (rdma-core, ibverbs-providers, infiniband-diags) — only the openmpi package is dropped in favor of HPC-X. Locally validated end-to-end: configure detects PMIx 5 at /opt/mellanox/hpcx/ompi5, mpi_pmix_v5.so / mpi_pmi2.so / gpu_nvml.so all build, dh_shlibdeps passes, 17 slurm-smd debs produced. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dd81057 commit 4bfafe4

3 files changed

Lines changed: 70 additions & 45 deletions

File tree

schedmd/slurm/25.11/ubuntu24.04/Dockerfile

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -225,26 +225,35 @@ ldconfig
225225
EOR
226226

227227
################################################################################
228-
# base-ib — DOCA userland IB verbs + DOCA OpenMPI 4.
228+
# base-ib — DOCA-OFED userland IB verbs + NVIDIA HPC-X SDK (OMPI 5 + PMIx 5).
229229
#
230-
# Installs only guest/userland components (no kmod, no metapackage bloat).
231-
# Open MPI comes from DOCA repo (4.1.x, Mellanox-tuned for IB).
230+
# IB userland (rdma-core, ibverbs, infiniband-diags) comes from the DOCA repo.
231+
# We deliberately do NOT install DOCA's `openmpi` apt package: its libpmix.so
232+
# has 21 unresolved references to symbols inside libopen-pal (opal_libevent2022_*
233+
# / opal_hwloc201_*), which makes slurm's autoconf AC_LINK_IFELSE on -lpmix fail.
234+
# The DOCA OMPI is also OMPI 4 + PMIx 3.2.5, which is not the modern stack.
232235
#
233-
# Deliberately NO Ubuntu libpmix-dev/libpmix2t64. DOCA's openmpi deb installs
234-
# a complete standalone PMIx 3.2.5 tree under /usr/mpi/gcc/openmpi-4.1.9a1/
235-
# (libpmix.so.2 + pmix.h + pmix.pc) which is the PMIx that DOCA OMPI itself
236-
# is linked against. The slurm-build stage builds slurm --with-pmix pointing
237-
# at this tree, so slurmd's mpi/pmix server plugin and DOCA OMPI's PMIx
238-
# client share one ABI-identical libpmix.so.2 — the single-vendor invariant
239-
# NVIDIA HPC-X requires. Co-installing apt libpmix-dev (PMIx 5.x) would only
240-
# put a second pmix.h on the build search path and a second libpmix.so on
241-
# the loader path, with no benefit (DOCA OMPI was not built --with-pmi=slurm,
242-
# so PMI-2-only launch is not an option on this fabric).
236+
# Instead we lay down NVIDIA HPC-X SDK at /opt/mellanox/hpcx. HPC-X ships both
237+
# ompi4 (OMPI 4 + PMIx 3) and ompi5 (OMPI 5 + PMIx 5.0.10rc3) trees, plus UCX,
238+
# HCOLL, SHARP, UCC, and the NCCL-RDMA-SHARP plugin. We expose only the OMPI 5
239+
# tree to slurmd so the mpi/pmix plugin links against PMIx 5 cleanly. The OMPI 5
240+
# libpmix.so.2 has self-contained DT_NEEDED entries (libevent_core,
241+
# libevent_pthreads, libhwloc) and `$ORIGIN/.` RUNPATH, so it is portable.
242+
#
243+
# Deliberately NO Ubuntu apt libpmix-dev/libpmix2t64: HPC-X's PMIx is the only
244+
# PMIx installed on the image, keeping the loader search path unambiguous.
243245
FROM base-cuda AS base-ib
244246

245247
SHELL ["bash", "-c"]
246248

247249
ARG DEBIAN_FRONTEND=noninteractive
250+
# HPC-X SDK pin. Update by querying the downloader API at
251+
# https://downloaders.azurewebsites.net/downloaders/hpcx_downloader/helper.php
252+
# (see slinky-containers/docs/hpcx-pin.md if added later) and verifying SHA256.
253+
ARG HPCX_VERSION=v2.26
254+
ARG HPCX_TARBALL=hpcx-v2.26-gcc-doca_ofed-ubuntu24.04-cuda13-x86_64.tbz
255+
ARG HPCX_URL=https://content.mellanox.com/hpc/hpc-x/v2.26_cuda13/hpcx-v2.26-gcc-doca_ofed-ubuntu24.04-cuda13-x86_64.tbz
256+
ARG HPCX_SHA256=57656486279f6bcf44bfc60228bac5c34e25366e6d3b7f7d1d0a46427a8836ff
248257

249258
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
250259
--mount=type=cache,target=/var/lib/apt,sharing=locked <<EOR
@@ -263,22 +272,39 @@ apt-get -qq -y install --no-install-recommends \
263272
libibverbs-dev \
264273
librdmacm1 \
265274
librdmacm-dev \
266-
infiniband-diags \
267-
openmpi
268-
# DOCA openmpi installs under /usr/mpi/gcc/openmpi-*/ but does not create
269-
# /usr/bin symlinks. Expose a version-agnostic MPI_HOME symlink + /usr/bin
270-
# entries so the downstream slurmd stage and operators can resolve mpirun.
271-
OMPI_DIR=$(ls -d /usr/mpi/gcc/openmpi-* | head -1)
272-
ln -sfn "${OMPI_DIR}" /usr/mpi/gcc/openmpi
275+
infiniband-diags
276+
EOR
277+
278+
# Lay down HPC-X SDK at /opt/mellanox/hpcx. Versioned dir is the actual extract
279+
# target; /opt/mellanox/hpcx is a symlink to it so paths in slurm builds and
280+
# ld.so.conf.d entries are stable across HPCX_VERSION bumps.
281+
RUN <<EOR
282+
set -xeuo pipefail
283+
cd /tmp
284+
curl -fsSL --retry 3 -o "${HPCX_TARBALL}" "${HPCX_URL}"
285+
echo "${HPCX_SHA256} ${HPCX_TARBALL}" | sha256sum -c -
286+
mkdir -p /opt/mellanox
287+
tar -xf "${HPCX_TARBALL}" -C /opt/mellanox
288+
HPCX_DIR=$(ls -d /opt/mellanox/hpcx-* | head -1)
289+
ln -sfn "${HPCX_DIR}" /opt/mellanox/hpcx
290+
rm -f "${HPCX_TARBALL}"
291+
# Deliberately NOT adding /opt/mellanox/hpcx/*/lib to /etc/ld.so.conf.d/.
292+
# HPC-X is fully self-resolving:
293+
# - slurm's mpi_pmix_v5.so plugin is built --with-pmix=/opt/mellanox/hpcx/ompi5,
294+
# and slurm's autoconf bakes -Wl,-rpath,$pmix_libdir into the plugin
295+
# (PMIX_V5_LDFLAGS), so slurmstepd dlopens the right libpmix.so.2 at MPI step
296+
# launch without depending on ld.so.cache;
297+
# - HPC-X's libpmix.so itself has DT_RUNPATH=$ORIGIN/. so its sibling libs
298+
# (libevent_core, libevent_pthreads, libhwloc) resolve relative to its own
299+
# directory;
300+
# - HPC-X mpirun / mpiexec carry DT_RPATH=$ORIGIN/../lib so they self-resolve
301+
# when invoked via the /usr/bin symlinks below.
302+
# Putting HPC-X libs on /etc/ld.so.conf.d/ would shadow Ubuntu's libhwloc.so.15
303+
# during the slurmd link, causing dh_shlibdeps to fail with "no dependency
304+
# information found" (HPC-X libs are not from any Debian package).
273305
for b in mpirun mpiexec mpicc mpicxx; do
274-
ln -sf "/usr/mpi/gcc/openmpi/bin/${b}" "/usr/bin/${b}"
306+
ln -sf "/opt/mellanox/hpcx/ompi5/bin/${b}" "/usr/bin/${b}"
275307
done
276-
# Expose DOCA OMPI's lib dir to the system loader so libpmix.so.2
277-
# (and the OMPI runtime libs) resolve via ldconfig. Required for slurmd
278-
# step launch: mpi_pmix.so is built --with-pmix=/usr/mpi/gcc/openmpi
279-
# and dlopens libpmix.so.2 at MPI step bootstrap.
280-
printf '%s\n' "/usr/mpi/gcc/openmpi/lib" > /etc/ld.so.conf.d/200_doca-ompi.conf
281-
ldconfig
282308
EOR
283309

284310
################################################################################
@@ -289,7 +315,7 @@ EOR
289315
# from patches/common/ then patches/${FABRIC}/ so EFA and IB paths receive the
290316
# correct debian/control and debian/rules hunks (EFA drops apt libpmix-dev and
291317
# points --with-pmix at /opt/amazon/pmix; IB drops apt libpmix-dev and points
292-
# --with-pmix at /usr/mpi/gcc/openmpi where DOCA's PMIx 3.2.5 lives).
318+
# --with-pmix at /opt/mellanox/hpcx/ompi5 where HPC-X's PMIx 5 lives).
293319
ARG FABRIC=ib
294320
ARG FABRIC_BASE=base-${FABRIC}
295321
FROM ${FABRIC_BASE} AS slurm-build
@@ -338,7 +364,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
338364
--mount=type=cache,target=/var/lib/apt,sharing=locked <<EOR
339365
set -xeuo pipefail
340366
mk-build-deps -ir --tool='apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' ${SLURM_DIR}/debian/control >/dev/null
341-
( cd ${SLURM_DIR} && debuild -b -uc -us )
367+
( cd ${SLURM_DIR} && debuild -b -uc -us >/dev/null )
342368
EOR
343369

344370
################################################################################

schedmd/slurm/25.11/ubuntu24.04/patches/ib/debian-control-ib.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Description: IB fabric build-deps: add cuda-nvml-dev, drop apt libpmix-dev.
55
enable the mpi/gpu_nvml autodetect plugin at build time (runtime
66
libnvidia-ml.so.1 is injected by nvidia-container-toolkit from the host
77
driver).
8-
libpmix-dev is dropped because the IB image builds slurm against DOCA's
9-
standalone PMIx 3.2.5 (under /usr/mpi/gcc/openmpi/, see debian/rules
10-
--with-pmix= patch). Keeping apt libpmix-dev (PMIx 5.x) installed would
11-
put two PMIx vendors on the image and let the wrong pmix.h leak into
12-
the build search path.
8+
libpmix-dev is dropped because the IB image builds slurm against HPC-X's
9+
PMIx 5 (under /opt/mellanox/hpcx/ompi5/, see debian/rules --with-pmix=
10+
patch). Keeping apt libpmix-dev installed would put a second pmix.h on
11+
the build search path and a second libpmix.so on the loader path, with
12+
the wrong vendor/ABI for the HPC-X OMPI 5 stack.
1313
Author: meshy-dev
1414
Forwarded: not-needed
1515
Last-Update: 2026-05-06
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
Description: Configure Slurm with NVML and DOCA-bundled PMIx for IB fabric.
1+
Description: Configure Slurm with NVML and HPC-X PMIx 5 for IB fabric.
22
--with-nvml=/usr/local/cuda tells slurm's GPU autodetect plugin to
33
link libnvidia-ml at build time, enabling slurmd GPU enumeration via
44
NVML (required for GresTypes=gpu + GPUs GRES binding on H200 nodes).
55
.
6-
--with-pmix=/usr/mpi/gcc/openmpi points slurmd's mpi/pmix plugin at
7-
the standalone PMIx 3.2.5 tree shipped inside DOCA's OpenMPI install
8-
(DOCA openmpi.deb lays down libpmix.so.2 + pmix.h + pmix.pc under
9-
/usr/mpi/gcc/openmpi-4.1.9a1/, exposed via the /usr/mpi/gcc/openmpi
10-
version-agnostic symlink). This keeps slurmd's PMIx server plugin
11-
ABI-identical to the PMIx client linked into DOCA OpenMPI 4 — single
12-
vendor, no cross-version dance — which is what NVIDIA HPC-X / DOCA
13-
OMPI requires (DOCA OMPI was not built --with-pmi=slurm and only
14-
supports PMIx-based launch).
6+
--with-pmix=/opt/mellanox/hpcx/ompi5 points slurmd's mpi/pmix plugin
7+
at the PMIx 5.0.10rc3 tree shipped inside NVIDIA HPC-X SDK's OMPI 5
8+
subtree. HPC-X's ompi5/lib/libpmix.so.2 has self-contained DT_NEEDED
9+
entries (libevent_core, libevent_pthreads, libhwloc) and `$ORIGIN/.`
10+
RUNPATH, so it links cleanly without dragging in libopen-pal — unlike
11+
DOCA-OFED's openmpi.deb whose libpmix has 21 unresolved opal_libevent2022_*
12+
/ opal_hwloc201_* symbols. HPC-X is also the modern OMPI 5 + PMIx 5
13+
stack NVIDIA documents for HPC + slurm; OMPI 4 / PMIx 3 are not used.
1514
Author: meshy-dev
1615
Forwarded: not-needed
1716
Last-Update: 2026-05-06
@@ -22,7 +21,7 @@ Last-Update: 2026-05-06
2221
# Run with --disable-debug to allow optimizations, -g is still provided
2322
# by dpkg-buildflags.
2423
- dh_auto_configure -- --sysconfdir=/etc/slurm --disable-debug --with-mysql_config --with-slurmrestd --with-pmix --enable-pam --with-pam_dir=/usr/lib/$(DEB_HOST_MULTIARCH)/security --with-systemdsystemunitdir=/lib/systemd/system/ SUCMD=/bin/su SLEEP_CMD=/bin/sleep
25-
+ dh_auto_configure -- --sysconfdir=/etc/slurm --disable-debug --with-mysql_config --with-slurmrestd --with-pmix=/usr/mpi/gcc/openmpi --with-nvml=/usr/local/cuda --enable-pam --with-pam_dir=/usr/lib/$(DEB_HOST_MULTIARCH)/security --with-systemdsystemunitdir=/lib/systemd/system/ SUCMD=/bin/su SLEEP_CMD=/bin/sleep
24+
+ dh_auto_configure -- --sysconfdir=/etc/slurm --disable-debug --with-mysql_config --with-slurmrestd --with-pmix=/opt/mellanox/hpcx/ompi5 --with-nvml=/usr/local/cuda --enable-pam --with-pam_dir=/usr/lib/$(DEB_HOST_MULTIARCH)/security --with-systemdsystemunitdir=/lib/systemd/system/ SUCMD=/bin/su SLEEP_CMD=/bin/sleep
2625

2726
override_dh_auto_install:
2827
dh_auto_install

0 commit comments

Comments
 (0)