Singularity: Difference between revisions

Jump to navigation Jump to search
Marked this version for translation
(Added troubleshooting for tmpfs issues in some modern linux distributions. Added sandbox use in building containers. Added troubleshooting for using CUDA with singularity. I did not add any reference number, as I didn't want to break anything.)
(Marked this version for translation)
Line 77: Line 77:
'''NOTE:''' Any image you create on your own computer needs to be uploaded to the cluster before you can use that image.
'''NOTE:''' Any image you create on your own computer needs to be uploaded to the cluster before you can use that image.


====Build error when building on a Linux distribution====
====Build error when building on a Linux distribution==== <!--T:122-->
When building on certain Linux distributions, you may get this error despite having enough memory on your device.
When building on certain Linux distributions, you may get this error despite having enough memory on your device.


<!--T:123-->
<source>$ WARNING: 'nodev' mount option set on /tmp, it could be a source of failure during build process
<source>$ WARNING: 'nodev' mount option set on /tmp, it could be a source of failure during build process
$FATAL: no memory left on device</source>
$FATAL: no memory left on device</source>


<!--T:124-->
Many modern Linux distributions, use an in-memory <tt>tmpfs</tt> filesystem, which may limit the size of the container you can build.  
Many modern Linux distributions, use an in-memory <tt>tmpfs</tt> filesystem, which may limit the size of the container you can build.  
The [https://sylabs.io/guides/3.6/user-guide/build_env.html#temporary-folders Singularity Documentation] gives a more detailed explanation.
The [https://sylabs.io/guides/3.6/user-guide/build_env.html#temporary-folders Singularity Documentation] gives a more detailed explanation.


<!--T:125-->
If that is the case, you can solve the problem by setting SINGULARITY_TMPDIR to a disk location.
If that is the case, you can solve the problem by setting SINGULARITY_TMPDIR to a disk location.


<!--T:126-->
<source>$ SINGULARITY_TMPDIR="disk/location" singularity build IMAGE_NAME.sif docker://DOCKER-IMAGE-NAME</source>
<source>$ SINGULARITY_TMPDIR="disk/location" singularity build IMAGE_NAME.sif docker://DOCKER-IMAGE-NAME</source>


Line 143: Line 147:
$ singularity build gqcp.sif docker-archive://gqcp.tar</source>
$ singularity build gqcp.sif docker-archive://gqcp.tar</source>


===Creating a custom image with sandbox===
===Creating a custom image with sandbox=== <!--T:127-->


<!--T:128-->
The <tt>--sandbox</tt> flag allows you to create a container within a writable directory.
The <tt>--sandbox</tt> flag allows you to create a container within a writable directory.
this allows for easy modifications of existing containers.
this allows for easy modifications of existing containers.
Line 392: Line 397:
* clusters using Infiniband need UCX.
* clusters using Infiniband need UCX.


=== Using CUDA on Compute Canada clusters ===  
=== Using CUDA on Compute Canada clusters === <!--T:129-->


<!--T:130-->
If you are running programs which use the CUDA library, you must make sure that your Singularity container has CUDA installed.
If you are running programs which use the CUDA library, you must make sure that your Singularity container has CUDA installed.


<!--T:131-->
The <tt>--nv</tt> flag needs to be added to make CUDA work.
The <tt>--nv</tt> flag needs to be added to make CUDA work.


<!--T:132-->
<source>
<source>
$ srun singularity run --nv container-name.sif [job to do]
$ srun singularity run --nv container-name.sif [job to do]
rsnt_translations
56,430

edits

Navigation menu