From 8fd89b686f3383845b95817e6abd34fda3ea42ca Mon Sep 17 00:00:00 2001 From: Michael Weisner Date: Fri, 12 Dec 2025 13:55:16 -0500 Subject: [PATCH 1/3] Update 03_singularity_with_conda.md added --fakeroot and Apptainer explanation. --- docs/hpc/07_containers/03_singularity_with_conda.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/hpc/07_containers/03_singularity_with_conda.md b/docs/hpc/07_containers/03_singularity_with_conda.md index 51182ced6..2b22c55ce 100644 --- a/docs/hpc/07_containers/03_singularity_with_conda.md +++ b/docs/hpc/07_containers/03_singularity_with_conda.md @@ -83,10 +83,13 @@ For the most recent supported versions of PyTorch, please check the [PyTorch web Launch the appropriate Singularity container in read/write mode (with the :rw flag): ```sh -singularity exec --overlay overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.1.1-cudnn8.9.0-devel-ubuntu22.04.2.sif /bin/bash +singularity exec --fakeroot --overlay overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.1.1-cudnn8.9.0-devel-ubuntu22.04.2.sif /bin/bash ``` -The above starts a bash shell inside the referenced Singularity Container overlaid with the 15GB 500K you set up earlier. This creates the functional illusion of having a writable filesystem inside the typically read-only Singularity container. +The above starts a bash shell inside the referenced Singularity Container overlaid with the 15GB 500K you set up earlier. This creates the functional illusion of having a writable filesystem inside the typically read-only Singularity container. + +:::information +Please note that the default Singularity on Torch is now Apptainer, which requires the --fakeroot option to load overlay files in read/write mode. Now, inside the container, download and install miniforge to `/ext3/miniforge3`: ```bash @@ -164,7 +167,7 @@ The login nodes restrict memory to 2GB per user, which may cause some large pack After it is running, you’ll be redirected to a compute node. From there, run singularity to setup on conda environment, same as you were doing on login node: ```sh -[NetID@cm001 pytorch-example]$ singularity exec --overlay overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.1.1-cudnn8.9.0-devel-ubuntu22.04.2.sif /bin/bash +[NetID@cm001 pytorch-example]$ singularity exec --fakeroot --overlay overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.1.1-cudnn8.9.0-devel-ubuntu22.04.2.sif /bin/bash Singularity> source /ext3/env.sh # activate the environment From 13db630f8fd68d492ae823f274516ff4da55dafe Mon Sep 17 00:00:00 2001 From: Michael Weisner Date: Fri, 12 Dec 2025 13:56:49 -0500 Subject: [PATCH 2/3] Update 03_singularity_with_conda.md fixed note section --- docs/hpc/07_containers/03_singularity_with_conda.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/hpc/07_containers/03_singularity_with_conda.md b/docs/hpc/07_containers/03_singularity_with_conda.md index 2b22c55ce..614d0a86b 100644 --- a/docs/hpc/07_containers/03_singularity_with_conda.md +++ b/docs/hpc/07_containers/03_singularity_with_conda.md @@ -88,8 +88,9 @@ singularity exec --fakeroot --overlay overlay-15GB-500K.ext3:rw /share/apps/imag The above starts a bash shell inside the referenced Singularity Container overlaid with the 15GB 500K you set up earlier. This creates the functional illusion of having a writable filesystem inside the typically read-only Singularity container. -:::information +:::note Please note that the default Singularity on Torch is now Apptainer, which requires the --fakeroot option to load overlay files in read/write mode. +::: Now, inside the container, download and install miniforge to `/ext3/miniforge3`: ```bash From 7bc539dac0ab1325d0ec9d9434b0b4f6f9d1dd95 Mon Sep 17 00:00:00 2001 From: Michael Weisner Date: Fri, 12 Dec 2025 14:01:05 -0500 Subject: [PATCH 3/3] Update 07_jupyter_with_conda_singularity.mdx added info about apptainer and --fakeroot --- docs/hpc/09_ood/07_jupyter_with_conda_singularity.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/hpc/09_ood/07_jupyter_with_conda_singularity.mdx b/docs/hpc/09_ood/07_jupyter_with_conda_singularity.mdx index 5f007e8f7..22309b44c 100644 --- a/docs/hpc/09_ood/07_jupyter_with_conda_singularity.mdx +++ b/docs/hpc/09_ood/07_jupyter_with_conda_singularity.mdx @@ -65,7 +65,7 @@ Above we used the overlay file `overlay-15GB-500K.ext3.gz` which will contain al ### Launch Singularity Environment for Installation ```bash -[NetID@log-1 ~]$ singularity exec --overlay /scratch/$USER/my_env/overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash +[NetID@log-1 ~]$ singularity exec --fakeroot --overlay /scratch/$USER/my_env/overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash ``` Above we used the Singularity OS image `cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif` which provides the base operating system environment for the conda environment. There are other Singularity OS images available at `/share/apps/images` @@ -137,6 +137,8 @@ Singularity> which pip Now use either conda or pip to install your required python packages to the Miniforge environment. +:::note If using Apptainer (the default Singularity installation on Torch) be sure to use the --fakeroot flag when launching overlay files in read-write mode (:rw). + To install larger packages, like Tensorflow, you must first start an interactive job with adequate compute and memory resources to install packages. The login nodes restrict memory to 2GB per user, which may cause some large packages to crash. ```bash Singularity> exit @@ -145,7 +147,7 @@ Singularity> exit # wait to be assigned a node -[NetID@cm001 my_env]$ singularity exec --overlay /scratch/$USER/my_env/overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash +[NetID@cm001 my_env]$ singularity exec --fakeroot --overlay /scratch/$USER/my_env/overlay-15GB-500K.ext3:rw /share/apps/images/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash Singularity> source /ext3/env.sh # activate the environment