Pyxis Administrator Guide
Pyxis is a SPANK plugin for
Slurm that allows unprivileged users to run containerized tasks via
srun --container-image=<image>.
HPE has developed a variant of the Pyxis plugin that supports container backends beyond the upstream plugin’s Enroot. It is released as part of USS, and is required for SUPS tool usage including parallel debugging. While Pyxis supports multiple container backend engines, SUPS supports only the Apptainer backend. Ensure the Pyxis plugin is configured to use Apptainer as its backend.
After a Slurm upgrade, recompile the plugin to ensure the plugin is running against the proper ABI for the Slurm release.
For installation and configuration, see Install and configure Pyxis in the HPE Cray Supercomputing User Services Software Administration Guide for HPE Performance Cluster Manager Software in the HPE Support Center.
Recommended Slurm settings for container workloads
Container teardown delay can cause spurious node drains. Reduce SIGTERM-to-SIGKILL window from 30s to 15s, add the following to the site Slurm configuration:
KillWait=15
UnkillableStepTimeout=120
Pyxis configuration for SUPS
SUPS provides environment wrapper scripts that configure compiler and MPI
paths inside containers at task launch time. These scripts are installed at
/usr/local/sups/environment-wrapper/ in SUPS container images and are
available in PATH as env-{compiler}-{mpi} (e.g. env-amd-cray,
env-gnu-ompi).
Apptainer configuration at /etc/pyxis/apptainer-args.sh:
# PALS spool directory (required for Cray PMI job launch)
if [ -n "$PALS_SPOOL_DIR" ] && [ -d "$PALS_SPOOL_DIR" ]; then
echo "--bind"
echo "${PALS_SPOOL_DIR}:${PALS_SPOOL_DIR}"
fi
# Cray SHMEM hugepages
if [ -d /var/lib/hugetlbfs/global/pagesize-2097152 ]; then
echo "--bind"
echo "/var/lib/hugetlbfs/global/pagesize-2097152:/var/lib/hugetlbfs/global/pagesize-2097152"
fi
# Slurm spool directory
if [ -d /var/spool/slurm ]; then
echo "--bind"
echo "/var/spool/slurm:/var/spool/slurm:ro"
fi
Using –container-task-prolog for environment setup
SUPS adds task prolog scripts to the container with the naming convention
prolog-{compiler}-{mpi}. They are located alongside the env- wrappers in
/usr/local/sups/environment-wrapper/.
Pass the appropriate prolog to srun with the --container-task-prolog option.
For example, to run an application using the ROCm LLVM compilers with Cray MPICH environment:
srun --container-image=./sups-image.sif \
--container-task-prolog=/usr/local/sups/environment-wrapper/prolog-amd-cray \
./my_app
GPU Isolation via task_env_script
To assign one GPU per task, configure /etc/pyxis/pyxis-task-env.sh to set CUDA_VISIBLE_DEVICES or ROCR_VISIBLE_DEVICES based on the task’s local rank.
For more complex scenarios, replace the script with site-specific logic or use Slurm’s native GRES GPU scheduling instead.
#!/bin/bash
# /etc/pyxis/pyxis-task-env.sh
# Per-task GPU isolation: assigns one GPU per task based on local rank ID.
#
# Only sets VISIBLE_DEVICES if Slurm has not already assigned GPUs
# (i.e., the site does not use GresTypes=gpu with --gres=gpu:N).
# When Slurm GRES GPU scheduling is active, the variable is already
# set correctly and this script is a no-op.
if [ -e /dev/nvidia0 ]; then
[ -z "$CUDA_VISIBLE_DEVICES" ] && echo "CUDA_VISIBLE_DEVICES=${SLURM_LOCALID}"
elif [ -e /dev/kfd ]; then
[ -z "$ROCR_VISIBLE_DEVICES" ] && echo "ROCR_VISIBLE_DEVICES=${SLURM_LOCALID}"
fi
exit 0
Then, add the task environment script to the Pyxis Plugstack configuration.
required /usr/local/lib/slurm/spank_pyxis.so backend=apptainer
task_env_script=/etc/pyxis/pyxis-task-env.sh