[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/].

Hello, thank you for the tutorial.

I’m interested to do the same but with AlphaPose.

I already have a docker ready so now I want to test it on baobab.
Docker hub / Dockerfile

I’m no docker expert so if you have any advice/recommendation to improve it feel free. I would love to learn.

Anyway, when trying your tuto, It looks like singularity is no more available on baobab at least not through module.

module spider Singularity does not return anything.

Is it still possible to run docker on it ? And if so, how (taking into account the need for GPU and mounted directory) ?

Thank you for your time.

Dear @Thibaut.Chataing

Singularity was replaced by Apptainer some time ago. The functionality are mainly the same.

If you need to access a GPU through apptainer, you need to use
--nv to enable Nvidia support

1 Like