Singularity / Apptainer
Our Docker containers are converted to Singularity/Apptainer containers and stored on object storage.
Download Singularity containers
Section titled “Download Singularity containers”First get an overview of which containers are available as Singularity containers in neurocommand/cvmfs/log.txt:
curl -s https://raw.githubusercontent.com/neurodesk/neurocommand/main/cvmfs/log.txtAssign the container name to a variable:
export container=itksnap_3.8.0_20201208Then download the container. One way is to use curl:
curl -X GET https://neurocontainers.neurodesk.workers.dev/$container.simg -OSingularity containers and GPUs
Section titled “Singularity containers and GPUs”Some of our containers contain GPU-accelerated applications. Here is an example that tests the GPU-accelerated program eddy in FSL:
curl -X GET https://neurocontainers.neurodesk.workers.dev/fsl_6.0.5.1_20221016.simg -Ogit clone https://github.com/neurolabusc/gpu_test.gitsingularity shell --nv fsl_6.0.5.1_20221016.simgcd gpu_test/etest/bash runme_gpu.shOpenGL GUIs on NVIDIA displays
Section titled “OpenGL GUIs on NVIDIA displays”When NVIDIA drives your X display, container OpenGL GUIs need --nv, even without CUDA use. Images include Mesa’s GLX library, but the NVIDIA X server requires libGLX_nvidia.so.0. Without it, GUIs fail. Look for GLX or libGLX_nvidia.so.0 in diagnostic output.
The --nv option supplies the host’s NVIDIA libraries. For a downloaded image, run:
apptainer exec --nv "$container.simg" itksnapFor Singularity, replace apptainer with singularity. For Neurocommand wrappers, set this in the terminal you use to launch applications:
export neurodesk_singularity_opts="${neurodesk_singularity_opts:+$neurodesk_singularity_opts }--nv"For Apptainer, including CVMFS module wrappers, alternatively use:
export APPTAINER_NV=1If this causes a GLIBC_2.38 error, see the Ubuntu compatibility guidance. Details are in neurocommand issue #810.
Transparent Singularity
Section titled “Transparent Singularity”The Singularity containers can also be used in combination with our Transparent Singularity Tool, which wraps the executables inside a container so they are easily available to pipelines.
One example:
curl -s https://raw.githubusercontent.com/neurodesk/neurocommand/main/cvmfs/log.txtexport container=itksnap_3.8.0_20201208git clone https://github.com/neurodesk/transparent-singularity ${container}cd ${container}./run_transparent_singularity.sh ${container}