Skip to content

Put cray-mpich's libraries on LD_LIBRARY_PATH in Perlmutter templates - #541

Merged
xylar merged 2 commits into
E3SM-Project:mainfrom
xylar:fix-pm-gpu-ld-library-path
Oct 23, 2026
Merged

xylar merged 2 commits into
E3SM-Project:mainfrom
xylar:fix-pm-gpu-ld-library-path

Conversation

@xylar

@xylar xylar commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

On Perlmutter, /opt/cray/pe/lib64 now links the intel and nvidia MPI libraries and cray-mpich's GTL to the default cray-mpich 9.1.0, while the templates use 9.0.1. Since Spack clears LD_LIBRARY_PATH, executables that Spack builds and runs mid-build pick those up: Boost's b2 fails on gnugpu (libcudart.so.13), anything built with intel fails to load (libifport.so.5), and nvidia builds silently run against MPI 4.1. This puts each template's cray-mpich 9.0.1 lib directory, plus CUDA 12.9's for the GPU templates, ahead of libfabric. The gnu libraries in /opt/cray/pe/lib64 still point at 9.0.1, but the gnu templates get the same change so they keep working when that moves.

Checklist

  • PR description includes a summary and any relevant issue references
  • Testing comment, if appropriate, in the PR documents testing used to verify the changes

Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.

@xylar xylar added bug Something isn't working spack Changes relate to creating conda and Spack environments, and creating a load script labels Oct 23, 2026
@xylar xylar changed the title Put cray-mpich and CUDA libs on pm-gpu gnugpu's LD_LIBRARY_PATH Put cray-mpich's libraries on LD_LIBRARY_PATH in Perlmutter templates Oct 23, 2026
xylar and others added 2 commits October 23, 2026 18:06
With craype-accel-nvidia80, the Cray wrappers link the GTL into every
executable.  Spack clears LD_LIBRARY_PATH, so executables run during a
build (such as boost's b2) found the GTL through /opt/cray/pe/lib64,
which now points at the default cray-mpich 9.1.0 and needs CUDA 13
rather than the 12.9 the template loads.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
/opt/cray/pe/lib64 links the intel and nvidia MPI libraries, and the
GTL, to the default cray-mpich 9.1.0, so executables run during a
build either failed to load (libifport.so.5 for intel, libcudart.so.13
wherever the GTL is linked) or silently ran against MPI 4.1 (nvidia).
The gnu libraries there still point at 9.0.1, but are included too so
the templates keep working when that changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@xylar
xylar force-pushed the fix-pm-gpu-ld-library-path branch from fe8546d to 50df93a Compare October 23, 2026 16:07
@xylar

xylar commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Testing

All on pm-gpu, with templates identical to this branch:

  • gnugpu, end to end: compass's Albany deployment (Update to v2.1.0-alpha.1 and mache v5.2.0 MPAS-Dev/compass#1008) built Boost, whose b2 failed with libcudart.so.13 before this change, then CUDA trilinos-for-albany and albany. MALI built against them ran compass's full_integration on a GPU node. Its failures are the known Tests failing on pm-gpu with gnugpu MPAS-Dev/compass#909 and the unrelated MISMIP+ smoke tests abort in Albany on pm-gpu with gnugpu MPAS-Dev/compass#1011.
  • gnu, gnugpu, intel and intelgpu: a Polaris main deploy (--compiler gnu gnugpu intel intelgpu --deploy-spack, fresh Spack path) built all four library environments and the gnu software environment without failures. Each build's LD_LIBRARY_PATH starts with its own cray-mpich 9.0.1 lib directory, plus CUDA 12.9's for gnugpu and intelgpu.
  • intel, intelgpu, nvidia and nvidiagpu at run time: an MPI program built with each template's modules failed to load (libifport.so.5 or libcudart.so.13), or ran on cray-mpich 9.1.0 (nvidia), with only libfabric on LD_LIBRARY_PATH, and ran on 9.0.1 with this branch's paths. The nvidia templates get no Spack build here, since no downstream package uses them.

pixi run pytest tests/test_spack_templates.py passes. The Polaris log is /pscratch/sd/x/xylar/mache_pr541_test/logs/deploy_combined_1.log.


Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.

@xylar
xylar marked this pull request as ready for review October 23, 2026 16:43
@xylar
xylar merged commit 4c7b87f into E3SM-Project:main Oct 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working spack Changes relate to creating conda and Spack environments, and creating a load script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant