// Config profile for HPC2N params { config_profile_description = 'Cluster profile for HPC2N' config_profile_contact = 'User @username' config_profile_url = 'https://www.hpc2n.umu.se/' project = "ProjectID" clusterOptions = null max_memory = 128.GB max_cpus = 28 max_time = 1.h email = 'my@gmail.com' } /*************************************** * PROFILES ***************************************/ profiles { apptainer { singularity { enabled = true autoMounts = true runOptions = '--nv' // enables GPU inside container } process { containerOptions = '--nv' } } gpu { process { withLabel: gpu { container = "./pytorch_22.01.sif" containerOptions = '--nv' time = { params.max_time } clusterOptions = { "-A $params.project --gres=gpu:l40s:1 ${params.clusterOptions ?: ''}" } } } // Pass GPU-related environment variables into container env { CUDA_VISIBLE_DEVICES = "$CUDA_VISIBLE_DEVICES" NVIDIA_VISIBLE_DEVICES = "$NVIDIA_VISIBLE_DEVICES" NVIDIA_DRIVER_CAPABILITIES = "$NVIDIA_DRIVER_CAPABILITIES" APPTAINERENV_CUDA_VISIBLE_DEVICES = "$CUDA_VISIBLE_DEVICES" } } } /*************************************** * DEFAULT PROCESS CONFIG ***************************************/ process { executor = 'slurm' containerOptions = '--nv' clusterOptions = { "-A $params.project ${params.clusterOptions ?: ''}" } }