You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--mpi-command as root fails on AL2: Open MPI 4.0.1 ignores OMPI_ALLOW_RUN_AS_ROOT #1481
On an Amazon Linux 2 AMI (--ami), I expect every --mpi-command to fail before any rank starts. Rank 0 runs mpirun as root and permits that only through OMPI_ALLOW_RUN_AS_ROOT=1 / OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 in /etc/profile.d/mpi.sh (pkg/userdata/mpi.go). AL2's openmpi package is Open MPI 4.0.1, which predates those variables and refuses to run as root unless --allow-run-as-root is on the command line.
Evidence (container, no AWS)
amazonlinux:2 + yum install -y openmpi gives mpirun (Open MPI) 4.0.1. With both variables set:
$ OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 mpirun --oversubscribe -np 2 bash -c 'echo hi'
mpirun has detected an attempt to run as root.
...
You can override this protection by adding the --allow-run-as-root
option to your cmd line.
Adding --allow-run-as-root makes it run. On amazonlinux:2023 (Open MPI 4.1.2) the variables alone work. Found while verifying #1479 / PR #1480, whose real-mpirun test has to pass the flag under root on AL2.
Scope
AL2023 is the default AMI, so this only affects a user-supplied AL2 image (or another distro on an Open MPI older than the variables). Not reproduced on EC2. Possible fix: pass --allow-run-as-root on rank 0's mpirun line, which every 4.x and 5.x release accepts. Or document AL2 as unsupported for --mpi.
Activity
fix(mpi): pass --allow-run-as-root so --mpi-command starts as root on…