From 03c83367666cba5cc206877777ee7ff2e6c1d73a Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Nov 2024 14:25:30 +0100 Subject: [PATCH 1/5] template: add gpu profile --- nf_core/pipeline-template/nextflow.config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 599998f38..cbaaed461 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -187,6 +187,11 @@ profiles { } } {%- endif %} + gpu { + docker.runOptions = '-u $(id -u):$(id -g) --gpus device=0' + apptainer.runOptions = '--no-mount tmp --writable-tmpfs --nv' + singularity.runOptions = '--no-mount tmp --writable-tmpfs --nv' + } {% if test_config -%} test { includeConfig 'conf/test.config' } test_full { includeConfig 'conf/test_full.config' } From d790b9c02e2a49ebb6369c5d64341bcbf358eda3 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Thu, 7 Nov 2024 13:27:09 +0000 Subject: [PATCH 2/5] [automated] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61d8dbf51..0bc42b845 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - fix workflow_dispatch trigger and parse more review comments in awsfulltest ([#3235](https://github.com/nf-core/tools/pull/3235)) - Add resource limits to Gitpod profile([#3255](https://github.com/nf-core/tools/pull/3255)) - Fix a typo ([#3268](https://github.com/nf-core/tools/pull/3268)) +- Add `gpu` profile ([#3272](https://github.com/nf-core/tools/pull/3272)) ### Download From 51a232c4b861f6b3447ea4f4e73e711bce6ba4ff Mon Sep 17 00:00:00 2001 From: Nico Trummer <52698566+nictru@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:38:35 +0100 Subject: [PATCH 3/5] Mount all available GPUs when using Docker Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> --- nf_core/pipeline-template/nextflow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index cbaaed461..6fc619843 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -188,7 +188,7 @@ profiles { } {%- endif %} gpu { - docker.runOptions = '-u $(id -u):$(id -g) --gpus device=0' + docker.runOptions = '-u $(id -u):$(id -g) --gpus all' apptainer.runOptions = '--no-mount tmp --writable-tmpfs --nv' singularity.runOptions = '--no-mount tmp --writable-tmpfs --nv' } From 23f6951e864f6fe18b3f716d6b903cf873c655ca Mon Sep 17 00:00:00 2001 From: Nico Trummer <52698566+nictru@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:38:53 +0100 Subject: [PATCH 4/5] Remove tmpdir artifact Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> --- nf_core/pipeline-template/nextflow.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 6fc619843..884fadf52 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -189,8 +189,8 @@ profiles { {%- endif %} gpu { docker.runOptions = '-u $(id -u):$(id -g) --gpus all' - apptainer.runOptions = '--no-mount tmp --writable-tmpfs --nv' - singularity.runOptions = '--no-mount tmp --writable-tmpfs --nv' + apptainer.runOptions = '--nv' + singularity.runOptions = '--nv' } {% if test_config -%} test { includeConfig 'conf/test.config' } From 4c883978b3f10b759c9568e6b25876b237ac3b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20H=C3=B6rtenhuber?= Date: Wed, 13 Nov 2024 12:17:10 +0100 Subject: [PATCH 5/5] add proccess label to base.config Co-authored-by: Nico Trummer --- nf_core/pipeline-template/conf/base.config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nf_core/pipeline-template/conf/base.config b/nf_core/pipeline-template/conf/base.config index 16a4fe6cd..e95c906e1 100644 --- a/nf_core/pipeline-template/conf/base.config +++ b/nf_core/pipeline-template/conf/base.config @@ -59,4 +59,7 @@ process { errorStrategy = 'retry' maxRetries = 2 } + withLabel: process_gpu { + ext.use_gpu = {workflow.profile.contains('gpu')} + } }