Difference between revisions of "Submit a Singularity job"

From ScientificComputing
Jump to: navigation, search
(Created page with "__NOTOC__ $ singularity pull docker://dockeruser/ubuntu-python3 $ ls ubuntu-python3_latest.sif $ singularity run ubuntu-python3_latest.sif python3 -c "import tensorflow...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
  
 +
== Download the container image ==
 +
Please see [[Deploy a container using Singularity]] for how to create the example container image ubuntu-python3
 
  $ singularity pull docker://dockeruser/ubuntu-python3
 
  $ singularity pull docker://dockeruser/ubuntu-python3
 
  $ ls
 
  $ ls
 
  ubuntu-python3_latest.sif
 
  ubuntu-python3_latest.sif
   
+
 
  $ singularity run ubuntu-python3_latest.sif python3 -c "import tensorflow as tf; print(tf.__version__)"
+
== Create a job script ==
  2021-07-16 17:48:23.073697: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /.singularity.d/libs
+
Create a file called ''job_script.bsub'' and add
2021-07-16 17:48:23.073724: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
+
  #!/usr/bin/bash
2.5.0
+
#BSUB -n 1
 +
#BSUB -R singularity
 +
#BSUB -R "rusage[mem=2048]"
 +
#BSUB -W 1:00
 +
 
 +
  singularity run ubuntu-python3_latest.sif python3 -c "import tensorflow as tf; print(tf.__version__)"
 +
 
 +
Submit the job script
 +
  $ bsub < job_script.bsub
 +
 
 +
When the job has finished, you can see the output in the output file lsf.o*
 +
2.5.0

Revision as of 16:36, 11 October 2021


Download the container image

Please see Deploy a container using Singularity for how to create the example container image ubuntu-python3

$ singularity pull docker://dockeruser/ubuntu-python3
$ ls
ubuntu-python3_latest.sif

Create a job script

Create a file called job_script.bsub and add

#!/usr/bin/bash
#BSUB -n 1
#BSUB -R singularity
#BSUB -R "rusage[mem=2048]"
#BSUB -W 1:00
singularity run ubuntu-python3_latest.sif python3 -c "import tensorflow as tf; print(tf.__version__)"

Submit the job script

$ bsub < job_script.bsub

When the job has finished, you can see the output in the output file lsf.o*

2.5.0