diff --git a/.gitignore b/.gitignore index 05aa7e0..9f86a51 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ testing* *.pyc .nf-test.log .nf-test/ +null diff --git a/conf/base.config b/conf/base.config index 71978a4..2d1927b 100644 --- a/conf/base.config +++ b/conf/base.config @@ -58,4 +58,7 @@ process { withName:'ILASTIK_PIXELCLASSIFICATION|ILASTIK_MULTICUT' { label = "process_high" } + withLabel:process_gpu { + ext.use_gpu = { use_gpu } + } } diff --git a/modules.json b/modules.json index 17f6235..040e65b 100644 --- a/modules.json +++ b/modules.json @@ -8,7 +8,8 @@ "cellpose": { "branch": "master", "git_sha": "7c1543a730197e2f0b8ca5141f851c4a2b08bed6", - "installed_by": ["modules"] + "installed_by": ["modules"], + "patch": "modules/nf-core/cellpose/cellpose.diff" }, "deepcell/mesmer": { "branch": "master", diff --git a/modules/nf-core/cellpose/cellpose.diff b/modules/nf-core/cellpose/cellpose.diff new file mode 100644 index 0000000..086698d --- /dev/null +++ b/modules/nf-core/cellpose/cellpose.diff @@ -0,0 +1,23 @@ +Changes in module 'nf-core/cellpose' +Changes in 'cellpose/main.nf': +--- modules/nf-core/cellpose/main.nf ++++ modules/nf-core/cellpose/main.nf +@@ -1,8 +1,10 @@ + process CELLPOSE { + tag "$meta.id" + label 'process_medium' ++ label 'process_gpu' + +- container "docker.io/biocontainers/cellpose:3.0.1_cv1" ++ container "${ task.ext.use_gpu ? 'docker.io/kbestak/cellpose:3.0.1_cuda12.2.0' : ++ 'docker.io/biocontainers/cellpose:3.0.1_cv1'}" + + input: + tuple val(meta), path(image) + +'modules/nf-core/cellpose/meta.yml' is unchanged +'modules/nf-core/cellpose/tests/main.nf.test' is unchanged +'modules/nf-core/cellpose/tests/main.nf.test.snap' is unchanged +'modules/nf-core/cellpose/tests/nextflow_wflows.config' is unchanged +'modules/nf-core/cellpose/tests/tags.yml' is unchanged +************************************************************ diff --git a/modules/nf-core/cellpose/main.nf b/modules/nf-core/cellpose/main.nf index f100904..cb32012 100644 --- a/modules/nf-core/cellpose/main.nf +++ b/modules/nf-core/cellpose/main.nf @@ -1,8 +1,10 @@ process CELLPOSE { tag "$meta.id" label 'process_medium' + label 'process_gpu' - container "docker.io/biocontainers/cellpose:3.0.1_cv1" + container "${ task.ext.use_gpu ? 'docker.io/kbestak/cellpose:3.0.1_cuda12.2.0' : + 'docker.io/biocontainers/cellpose:3.0.1_cv1'}" input: tuple val(meta), path(image) diff --git a/nextflow.config b/nextflow.config index aff1a48..11040a6 100644 --- a/nextflow.config +++ b/nextflow.config @@ -56,6 +56,9 @@ params { max_multiqc_email_size = '25.MB' multiqc_methods_description = null + // GPU for segmentation + use_gpu = false + // Boilerplate options outdir = null publish_dir_mode = 'copy' @@ -187,6 +190,12 @@ profiles { } test { includeConfig 'conf/test.config' } test_full { includeConfig 'conf/test_full.config' } + 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' + use_gpu = true + } } // Load nf-core custom profiles from different Institutions diff --git a/nextflow_schema.json b/nextflow_schema.json index 870e933..82e6266 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -145,7 +145,7 @@ }, "clahe_kernel": { "type": "number", - "default": 25, + "default": 25.0, "description": "Kernel size to be used by CLAHE.", "fa_icon": "far fa-object-group" }, @@ -411,5 +411,10 @@ { "$ref": "#/$defs/generic_options" } - ] + ], + "properties": { + "use_gpu": { + "type": "boolean" + } + } }