Singularity containers can be used to package entire scientific workflows, software and libraries, and even data. Singularity is useful to users that have different environmental needs than what is provided by the service provider.
The Singularity software can import your Docker images without having Docker installed or being a superuser:
Alternatively, you can also package and build your containers using
Singularity Hub and then use URLs using the
Notice that we set the
SINGULARITY_CACHEDIR to the present working directory to not save the
image to our cache.
If not specified,
SINGULARITY_CACHEDIR is set to
Singularity 2.3 adds support for Nvidia GPUs. Adding the
--nv option will ensure that your
container is using the same Nvidia drivers than the host.
This section shows an example of use with the latest TensorFlow with GPU support.
Singularity itself is available as a module on XStream:
Please be sure to store your Singularity images in
$HOME is NOT suited to store container images.
See Storage Resources for more information about storage spaces
Get the latest (stable) TensorFlow docker image with GPU support:
Alternatively, you can get a more recent build:
Test your TensorFlow container by launching a shell:
Importing the tensorflow module should not return any error:
You’re good to go and to run the latest TensorFlow within a job on XStream.
Below is an example of SLURM batch script to execute TensorFlow within Singularity
to train the CIFAR-10 model on
a single GPU. The example also makes use of the local SSD (
$LSTOR) available on the
compute nodes to speed up processing of all the small images.