I have a bash file (generateData.sh) that contains hundred of python scripts such as :
python create_video.py input output --param1 --param2 --param3
Each python script processes a different input video and uses in the process one of the two available GPU on my machine (for some computer vision tasks).
I tried to parallelize the bash file using GNU parallel (or xargs or &) with :
cat generateData.sh | parallel
This allows me to parallelize 48 python scripts. However, because of the limited space on GPU, only 10 of them correctly finish with a good output video. The other input videos are not handle at all, probably because it encountered some cuda out-of-memory errors.
I would like GPU parallel to wait that some jobs finish to have some free space on GPUs. Otherwise, GPU parallel will only process correctly a sub-part of my bash file.
Thanks for you answers !