[tutorial] launch openpose with GPU support through Singularity

A user asked us to install a software named openpose on Baobab. This software needs a lot of dependencies and we didn’t had enough time to install it. More an more software are available as Docker image as well. That’s great because we support Docker like images through Singularity.

Steps:

  • build the image for singularity
  • launch the container

According to this page, the Docker image of openpose is available as garyfeng/docker-openpose.

Let’s build the Singularity image openpose. This will download the Docker images and takes some time. It will also produce some warnings because we are running this command as normal user instead as user root.

[sagon@login2 openpose] module load GCCcore/8.2.0 Singularity/3.4.0-Go-1.12
[sagon@login2 openpose] PATH=$PATH:/sbin singularity build openpose.simg docker://garyfeng/docker-openpose:latest
[...]
INFO:    Creating SIF file...
INFO:    Build complete: openpose.simg

As I don’t know how this software works, let’s try a quick test.

[sagon@login2 openpose][master] $ sbatch launchopenpose.sh 
Submitted batch job 25958248
[sagon@login2 openpose][master] $ ls -la ~/tests/output.avi 
-rw-r--r-- 1 sagon unige 17932086 Jan  8 17:49 /home/sagon/tests/output.avi
[sagon@login2 openpose][master] $ cat slurm-25958248.out 
Starting pose estimation demo.
Auto-detecting GPUs... Detected 1 GPU(s), using them all.
Starting thread(s)
Real-time pose estimation demo successfully finished. Total time: 39.014532 seconds.

You can download and modify the script to your need.

Your feedback is welcome.

Cheers

Thanks for the tutorial.
A very useful singularity flag is the -B flag which allows to mount an external folder to a folder inside the container. This is very useful when manipulating huge data file which should be on scratch and not in the home directory.
For example the flag

-B /home/strassp6/scratch/Data:/Data

will mount the Data folder on scratch to /Data.

To add more information about what Yann said. A good source of docker images is dockerhub and especially for gpu [ngc nvidia](https://ngc.nvidia.com/].