Pass the host environment LD_LIBRARY_PATH within a Singularity container
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24
- Forks
- 15
- Avg merge
- 10d 3h
- Merged PRs (30d)
- 1
Description
What would you like to see added?
We need to document a generic example of how to pass the host environment LD_LIBRARY_PATH and append it within a container-defined LD_LIBRARY_PATH. Can be added to this page https://docs.rc.uab.edu/workflow_solutions/getting_containers/#containers-on-cheaha.
For instance, executing the Parabricks container requires a CUDA library. In order to see host GPUs inside the container, we need to append the CUDA LD_LIBRARY_PATH to the containerized LD_LIBRARY_PATH.
The CUDA LD_LIBRARY_PATH in Cheaha is in "/cm/local/apps/cuda/libs/current/lib64".
Before appending the CUDA LD_LIBRARY_PATH, the environment inside the container is,
$ singularity exec parabricks.sif printenv LD_LIBRARY_PATH
/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/.singularity.d/libs
After appending the CUDA LD_LIBRARY_PATH to the containerized LD_LIBRARY_PATH we can see that the initial containerized definition is preserved by appending,
$ export SINGULARITYENV_LD_LIBRARY_PATH="/cm/local/apps/cuda/libs/current/lib64:\$LD_LIBRARY_PATH"
$ singularity exec parabricks.sif printenv LD_LIBRARY_PATH
/cm/local/apps/cuda/libs/current/lib64:$LD_LIBRARY_PATH:/.singularity.d/libs
In order to execute the container we need to bind the path of the CUDA library as well as set the LD_LIBRARY_PATH,
$ singularity run --nv -B /cm/local/apps/cuda/libs/current/lib64 parabricks.sif /bin/pbrun fq2bam ...
If required link the Parabricks page:https://docs.rc.uab.edu/education/case_studies/#parabricks-testing-on-pascalnodes-and-amperenodes-on-cheaha.
For reference see this github post to see how to append LD_LIBRARY_PATH to the containers LD_LIBRARY_PATH: https://github.com/apptainer/singularity/issues/5781
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Update the “Containers on Cheaha” page linked in the issue with the generic SINGULARITYENV_LD_LIBRARY_PATH and bind-path examples shown here. Include the Parabricks command and link to the Parabricks page if useful; done means the documentation explains preserving the container value while appending the host CUDA path.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100