diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e3a6539e..0585a1c438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -156,6 +156,7 @@ - Update template components ([#3328](https://github.com/nf-core/tools/pull/3328)) - Template: Remove mention of GRCh37 if igenomes is skipped ([#3330](https://github.com/nf-core/tools/pull/3330)) - Be more verbose in approval check action ([#3338](https://github.com/nf-core/tools/pull/3338)) +- Add `gpu` profile ([#3272](https://github.com/nf-core/tools/pull/3272)) ### Download diff --git a/nf_core/pipeline-template/conf/base.config b/nf_core/pipeline-template/conf/base.config index 16a4fe6cdf..9f51eb7cd5 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') } + } } diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 0bad472b2c..3e0e281073 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -197,6 +197,11 @@ profiles { } } {%- endif %} + gpu { + docker.runOptions = '-u $(id -u):$(id -g) --gpus all' + apptainer.runOptions = '--nv' + singularity.runOptions = '--nv' + } {%- if test_config %} test { includeConfig 'conf/test.config' } test_full { includeConfig 'conf/test_full.config' }