create def file
Bootstrap: docker
From: <give docker image path> example: nvcr.io/nvidia/pytorch:24.11-py3
%post
<required packages to be installed or commands to be exectued for preparation of the main program>
apt-get -y update
apt-get install -y python-pip
pip install diffusers==0.30.2
huggingface-cli login --token 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 --add-to-git-credential
create sif file from def:
singularity build --fakeroot test.sif tutorial-1.def
create mpi file:
#!/bin/bash
#SBATCH --job-name=myjob # create a short name for your job
#SBATCH --nodes=1 # node count
#SBATCH --ntasks=1 # total number of tasks across all nodes
#SBATCH --cpus-per-task=4 # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=4G # memory per cpu-core (4G per cpu-core is default)
#SBATCH --time=00:05:00 # total run time limit (HH:MM:SS)
#SBATCH --gres=gpu:1 # number of gpus per node
nvidia-smi
Slrum template for singularity run:
#!/bin/bash
#SBATCH --job-name=cv # create a short name for your job
#SBATCH --nodes=1 # node count
#SBATCH --ntasks=1 # total number of tasks across all nodes
#SBATCH --cpus-per-task=4 # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=4G # memory per cpu-core (4G per cpu-core is default)
#SBATCH --time=23:59:00 # total run time limit (HH:MM:SS)
#SBATCH --mail-type=begin #send mail when job begins
#SBATCH --mail-type=end
#SBATCH --mail-user=142204003@smail.iitpkd.ac.in
#SBATCH --gres=gpu:1 # number of gpus per node
#SBATCH --partition=gpu02
srun singularity exec --nv inpaint.sif python FLUX-Controlnet-Inpainting/main.py
For interactive session on gpu run this while you are in master/cpu node:
srun --partition=gpu01 --nodes=1 --time=00:30:00 --pty /bin/bash