Jonathan Manning
02/20/2026, 9:26 AMMaxime Garcia
02/20/2026, 9:51 AMFamke Bäuerle
02/20/2026, 9:53 AMFamke Bäuerle
02/20/2026, 9:53 AMMaxime Garcia
02/20/2026, 9:54 AMFamke Bäuerle
02/20/2026, 9:55 AMJonathan Manning
02/20/2026, 9:55 AMFamke Bäuerle
02/20/2026, 9:56 AMFamke Bäuerle
02/20/2026, 9:59 AMThe previousneeds to be solved but I would solve this via the process directive:profile setgpuglobally, meaning every Docker container gotdocker.runOptions = '--gpus all', not just GPU tasks. On heterogeneous clusters where CPU tasks run on non-GPU nodes, this caused Docker to fail with--gpus all.could not select device driver "" with capabilities: [[gpu]]
withLabel: process_gpu {
ext.use_gpu = { workflow.profile.contains('gpu') }
accelerator = { workflow.profile.contains('gpu') ? 1 : null }
}Famke Bäuerle
02/20/2026, 10:01 AMJonathan Manning
02/20/2026, 10:06 AMprocess_gpu label via `containerOptions`:
withLabel: process_gpu {
ext.use_gpu = true
accelerator = 1
containerOptions = {
if (workflow.containerEngine in ['singularity', 'apptainer']) {
return '--nv'
}
return '--gpus all'
}
}
The old process_gpu block had accelerator and ext.use_gpu but was missing the actual container runtime flags. Those were in the gpu profile as global `docker.runOptions`/`apptainer.runOptions`/`singularity.runOptions`, which hit every container, not just GPU ones.
containerOptions is the per-process equivalent of runOptions. It passes flags to whatever container engine is active, scoped to just that process. So --gpus all only ends up on the docker run for Parabricks tasks.
On `accelerator`: the Parabricks module reads task.accelerator to set --num-gpus in the pbrun command, so making it executor-conditional would drop that flag on local/SLURM runs. Setting it unconditionally to 1 is harmless where unsupported (those executors ignore it) and keeps pbrun working everywhere.
Re the gpu profile: the reason I removed it rather than keeping it is that process_gpu tasks only run when --use_parabricks_star is set, so the flags are never applied when you're not using GPU features. There's no need for an extra opt-in step. But happy to discuss if there's a use case I'm missing.Famke Bäuerle
02/20/2026, 10:10 AMJonathan Manning
02/20/2026, 10:10 AMJonathan Manning
02/20/2026, 10:11 AMFamke Bäuerle
02/20/2026, 10:12 AMYou will need to add the accelerator directive to your local config in order to make use of the GPUs correctly if you do not use a cluster setup with a dedicated GPU queue. The accelerator diretive is added automatically for the executors. See [Nextflow executors](https://www.nextflow.io/docs/latest/executor.html) for more infos.'awsbatch','google-batch','hq','k8s'
Famke Bäuerle
02/20/2026, 10:14 AMJonathan Manning
02/20/2026, 10:18 AMMaxime Garcia
02/20/2026, 10:21 AMFamke Bäuerle
02/20/2026, 10:23 AMFamke Bäuerle
02/20/2026, 10:25 AMJonathan Manning
02/20/2026, 10:27 AMaccelerator was always designed as an executor scheduling directive (telling K8s/AWS/local which GPUs to provision), not a way to pass runtime parameters to tools - and once nextflow-io/nextflow#5850 lands, Nextflow will actively manage CUDA_VISIBLE_DEVICES based on accelerator, meaning the value the executor assigns may not even match what the tool should receive as --num-gpus, making the decoupling to task.ext.num_gpus essential.Famke Bäuerle
02/20/2026, 10:28 AMbecause omittingI think num-gpus is only needed if we do not specify --gpus all or something cluster specific and it is not a prblem that we drop it from the run commandon local/SLURM also dropsacceleratorfrom the tool command.--num-gpus
Adam Talbot
02/20/2026, 10:28 AM--gpus all has attached all the GPUs to the container. On a big node, you might have 8 GPUs attached to 8 or more running tasks! You really want --gpus $num or indexed with --gpus '"device=1,2"'Adam Talbot
02/20/2026, 10:29 AM--num-gpus in the help?Jonathan Manning
02/20/2026, 10:30 AMAdam Talbot
02/20/2026, 10:31 AMFamke Bäuerle
02/20/2026, 10:31 AMNumber of GPUs to use for a run. (default: 1)so if its dropped its set to 1
Adam Talbot
02/20/2026, 10:31 AMJonathan Manning
02/20/2026, 10:31 AMcontainerOptions = {
if (workflow.profile.contains('gpu')) {
if (workflow.containerEngine in ['singularity', 'apptainer']) {
return '--nv'
}
def ngpus = task.accelerator?.request ?: 1
return "--gpus ${ngpus}"
}
return null
}
???Famke Bäuerle
02/20/2026, 10:32 AMAdam Talbot
02/20/2026, 10:32 AM--gpus null? in certain situations?Famke Bäuerle
02/20/2026, 10:33 AMFamke Bäuerle
02/20/2026, 10:33 AMI can't seebecause that is a parabricks commandin the help?--num-gpus
Adam Talbot
02/20/2026, 10:34 AMJonathan Manning
02/20/2026, 10:34 AMWon't that beNo, the safe navigation will get it to 1? in certain situations?--gpus null
Adam Talbot
02/20/2026, 10:37 AMprocess.containerOptions for Parabricks all the time. I'm not sure what benefit having it behind conditionals like "--profile gpus" adds?Famke Bäuerle
02/20/2026, 10:37 AMAdam Talbot
02/20/2026, 10:41 AMparams.gpu_container_options = "--gpus 1"
withLabel: process_gpu {
containerOptions = params.gpu_container_options
}Adam Talbot
02/20/2026, 10:41 AMJose Espinosa-Carrasco
02/20/2026, 10:43 AMnextflow.config for each container technology e.g.:Jonathan Manning
02/20/2026, 10:44 AMprocess_gpu-labelled processes get GPU container flags. Pipeline provides sensible defaults, users can tune via a param or override containerOptions in their own config.
nf-core/rnaseq#1711:
withLabel: process_gpu {
ext.use_gpu = true
accelerator = 1
containerOptions = {
if (workflow.profile.contains('gpu')) {
if (workflow.containerEngine in ['singularity', 'apptainer']) {
return '--nv'
}
return params.gpu_container_options ?: '--gpus all'
}
return null
}
}
gpu profile kept as opt-in. Users can tune Docker GPU flags via --gpu_container_options '--gpus 1' etc. accelerator = 1 for executor-level scheduling (K8s, AWS Batch, local once nextflow-io/nextflow#5850 lands).
nf-core/modules#10118:
// before
def num_gpus = task.accelerator ? "--num-gpus ${task.accelerator.request}" : ''
// after
def num_gpus = task.ext.num_gpus ? "--num-gpus ${task.ext.num_gpus}" : ''
accelerator is an executor scheduling directive (nextflow-io/nextflow#997), not a tool parameter. Decoupled across all 11 Parabricks modules.
Does this look right?Jose Espinosa-Carrasco
02/20/2026, 10:50 AMnextflow.config đ
Adam Talbot
02/20/2026, 10:51 AMDoes this look right?Why do this?
return params.gpu_container_options ?: '--gpus all'
When setting the params.gpu_container_options to have a default is easier to control?
I'm waging a war against random profiles and secret configs đJonathan Manning
02/20/2026, 10:51 AMJonathan Manning
02/20/2026, 10:55 AMWhen setting thefairto have a default is easier to control?params.gpu_container_options
Jonathan Manning
02/20/2026, 11:06 AMgpu param is probably more useful than a profile sounded sensible to me. PR now updated:
https://github.com/nf-core/rnaseq/pull/1711
(see also https://github.com/nf-core/modules/pull/10118)Adam Talbot
02/20/2026, 11:22 AM--gpus boolean flag, right @Jose Espinosa-Carrasco?Jose Espinosa-Carrasco
02/20/2026, 11:23 AM--use-gpuJonathan Manning
02/23/2026, 9:21 AMMaxime Garcia
02/23/2026, 9:50 AMAdam Talbot
02/23/2026, 10:31 AM-profile gpu add that --gpu doesn't? But --gpu can be validated, checked. Doesn't require introspection...?Maxime Garcia
02/23/2026, 10:35 AMJonathan Manning
02/23/2026, 10:36 AMMaxime Garcia
02/23/2026, 10:37 AMMaxime Garcia
02/23/2026, 10:37 AMAdam Talbot
02/23/2026, 10:43 AM-profile gpu you can apply that will work everywhere, I think nearly every GPU enabled system has some nuance to it about containerOptions and flags. It would be like setting the queue directive to gpu, it's a big assumption to makeGary Burnett
02/23/2026, 2:16 PMJonathan Manning
02/23/2026, 3:53 PMThanks for the fix!
Just a matter of preference, and again not that familiar with nextflow yet so I am probably missing context, but I think requiring a flag --gpu for only some configurations confusing. I would think that saying "use the GPU aligner" or "this step uses a GPU" would be enough signal from the user.
I am also a little confused on how this will effect specifying the number of GPUs I want a task to use. I had thought that passing an accelerator requirement would have communicated to slurm to pass a GPU resource requirement, but I'm not sure that is happening. I'm going to play around with this next week and see how this works, since the parabricks team had recommended going with two GPUs per alignment task.Gary Burnett
02/23/2026, 4:48 PMcontainerOptions to set the gpu container flags, but I'm not sure I fully understand the purpose of the --use-gpu flag or what extra functionality that it adds.Jonathan Manning
02/23/2026, 5:13 PMcontainerOptions is always set on process_gpu tasks, but the flags inside (--gpus all, --nv) only activate when --use_gpu is true. Without the gate, every Parabricks run would inject GPU container flags, which breaks on cloud executors (AWS Batch, Google Batch, K8s) that handle GPU passthrough via their own APIs. --use_gpu lets local/HPC users opt in to container-level GPU flags while cloud users just set --use_parabricks_star and let the executor handle it.Jonathan Manning
02/23/2026, 5:21 PMsetting the accelerator lead to to runs breaking on my cluster which is why we only set it for specific executors.Did you ever report this as a Nextflow bug?
Adam Talbot
02/23/2026, 5:23 PMI would think that saying "use the GPU aligner" or "this step uses a GPU" would be enough signal from the user.I agree with this. If someone specifies they want to use Parabricks, that should be enough to enable any GPU features. Having a specific GPU flag only makes sense if you have byte-level CPU duplication and want to accelerate it with GPU hardware. I don't think this exists yet? Sarek does this reasonably well with
--tools and --skip-tools , after all, if you specify --tools parabricks you must use GPUs.Maxime Garcia
02/23/2026, 5:24 PMMaxime Garcia
02/23/2026, 5:25 PMAdam Talbot
02/23/2026, 5:25 PM--tools parabricks_deepvariant?Adam Talbot
02/23/2026, 5:25 PMMaxime Garcia
02/23/2026, 5:25 PMMaxime Garcia
02/23/2026, 5:26 PMI guess this is up to the pipeline author in some waysYeah, and that's what is troubling me
Maxime Garcia
02/23/2026, 5:26 PMAdam Talbot
02/23/2026, 5:27 PMJonathan Manning
02/23/2026, 5:27 PMMaxime Garcia
02/23/2026, 5:29 PMMaxime Garcia
02/23/2026, 5:30 PMAdam Talbot
02/23/2026, 5:30 PMMaxime Garcia
02/23/2026, 5:31 PMrun_whatever and skip_whatever, right?
so more or less that's a similar approach than what we do in sarek, so we could follow a similar set up and check if we have gpu if the specified params are onJonathan Manning
02/23/2026, 5:34 PMAdam Talbot
02/23/2026, 5:36 PMparamsMaxime Garcia
02/23/2026, 5:39 PMMaxime Garcia
02/23/2026, 5:39 PMGary Burnett
02/23/2026, 5:42 PMNote: For faster CPU runs with BWA-Meth, enable the BWA-MEM2 algorithm using --use_mem2. The GPU pathway (Parabricks) requires -profile gpu and a container runtime (Docker, Singularity, or Podman); Conda/Mamba are not supported for the GPU module.Gary Burnett
02/23/2026, 5:43 PM-profile gpu then maybe they will run into the same CPU issue that Isaac originally flaggedMaxime Garcia
02/23/2026, 5:44 PMMaxime Garcia
02/23/2026, 5:45 PMJonathan Manning
02/23/2026, 6:00 PMparams.gpus_per_parabricks = 2
accelerator = params.gpus_per_parabricks
ext.args = "--num-gpus ${gpus_per_parabricks}"
Feels like we need something closer to task.cpusJonathan Manning
02/23/2026, 6:01 PMext if folks would let me have it)Maxime Garcia
02/23/2026, 6:12 PMJonathan Manning
02/24/2026, 9:36 AMext?Maxime Garcia
02/24/2026, 9:41 AMMaxime Garcia
02/24/2026, 9:41 AMAdam Talbot
02/24/2026, 10:18 AMdef num_gpus = task.accelerator.request ? "--num-gpus ${task.accelerator.request}" : '' // or --num-gpus 1 as default?
I think introducing a new variable task.ext.num_gpus which duplicates the task.accelerator.request value doesn't achieve much?Jonathan Manning
02/24/2026, 10:23 AMAdam Talbot
02/24/2026, 10:24 AMdef num_gpus = task.accelerator?.request ? "--num-gpus ${task.accelerator.request}" : '--num-gpus 1'Jonathan Manning
02/24/2026, 10:25 AMsetting the accelerator lead to runs breaking on my cluster which is why we only set it for specific executors
Adam Talbot
02/24/2026, 10:25 AMAdam Talbot
02/24/2026, 10:27 AMprocess {
withName: PARABRICKS_STAR {
accelerator = null
ext.args = [
task.accelerator?.request ? "--num-gpus ${task.accelerator.request}" : '--num-gpus 1',
// stuff
].join().strip()
}
}Maxime Garcia
02/24/2026, 10:28 AMFamke Bäuerle
02/24/2026, 10:30 AMMaxime Garcia
02/24/2026, 10:34 AMJonathan Manning
02/24/2026, 10:41 AM--gpus all for Docker, --nv for Singularity) - these tell the container runtime to expose GPUs to the process. Only needed on local/HPC. Cloud executors (AWS Batch, K8s etc.) handle this via their own APIs.
2. accelerator directive - tells Nextflow how many GPUs a task needs. On cloud executors this drives provisioning. On SLURM/local it's silently ignored (confirmed from Nextflow source), but the value is still available in the script via task.accelerator.request so tools like pbrun can read it for --num-gpus.
The plan:
- containerOptions on process_gpu handles #1, auto-detecting the right flags per container engine, gated so cloud executors don't get them
- accelerator = 1 set unconditionally on process_gpu handles #2
- Drop --use_gpu as a separate param in rnaseq, since --use_parabricks_star already signals GPU intent (we might need to tweak later if we get extra GPU things)
- No new ext attributes - pbrun reads task.accelerator.request for --num-gpus (matching existing modules, I closed the modules PR)
- Users who want multiple GPUs per task (e.g. Parabricks team recommends 2) override accelerator = 2 in their config - task.accelerator.request feeds --num-gpus 2 to pbrun automatically, and --gpus all already exposes all GPUs to the container
- If a cluster needs to override any of this (e.g. accelerator = null), a withName block in the local config handles itJose Espinosa-Carrasco
02/24/2026, 10:51 AMJonathan Manning
02/24/2026, 10:52 AMAdam Talbot
02/24/2026, 11:03 AMOnly needed on local/HPC. Cloud executors (AWS Batch, K8s etc.) handle this via their own APIs.this isn't true
Jonathan Manning
02/24/2026, 11:03 AMAdam Talbot
02/24/2026, 11:04 AMAdam Talbot
02/24/2026, 11:04 AMJonathan Manning
02/24/2026, 11:07 AMAdam Talbot
02/24/2026, 11:07 AMMaxime Garcia
02/24/2026, 11:08 AMMaxime Garcia
02/24/2026, 11:09 AMAdam Talbot
02/24/2026, 11:09 AMprocess {
withLabel: 'GPU' {
accelerator = 1
containerOptions = { params.gpu_container_options ?: (workflow.containerEngine in ['singularity', 'apptainer'] ? '--nv' : '--gpus all') }
}
withName: 'PARABRICKS_.*' {
ext.args = {
[
task.accelerator?.request ? "--num-gpus ${task.accelerator.request}" : '--num-gpus 1',
// Parabricks args
].join().strip()
}
}
}Jonathan Manning
02/24/2026, 11:11 AMAdam Talbot
02/24/2026, 11:12 AMMaxime Garcia
02/24/2026, 11:13 AMMaxime Garcia
02/24/2026, 11:13 AMAdam Talbot
02/24/2026, 11:15 AMacclerator as a pod selector value and has a device plugin which may handle it
⢠GCP and Azure use container options in docker exec , GCP also uses accelerator as a Node requirements selector (e.g. it enables GPU machines)
⢠A couple of clusters turn accelerator into a job submission field, but not all. They don't do anything re: containerOptions so you have to supply this.Jonathan Manning
02/24/2026, 11:17 AMwithName: 'PARABRICKS_.*' {
ext.args = {
[
task.accelerator?.request ? "--num-gpus ${task.accelerator.request}" : '--num-gpus 1',
// Parabricks args
].join().strip()
}
}
It's covered in the modules:
def num_gpus = task.accelerator ? "--num-gpus ${task.accelerator.request}" : ''Adam Talbot
02/24/2026, 11:18 AMargs right?Jonathan Manning
02/24/2026, 11:18 AMAdam Talbot
02/24/2026, 11:19 AMJonathan Manning
02/24/2026, 11:21 AMAdam Talbot
02/24/2026, 11:25 AMarg to me
1.2 Non-file mandatory command arguments
Non-file mandatory arguments or arguments needed to modify the command to make the module run with no error, SHOULD be provided as value channels (for examplein salmon/quant) - see âInput/output optionsâ below.lib_type
1.3 Optional command arguments
All non-mandatory command-line tool non-file arguments MUST be provided as a string via thevariable.$task.ext.args
Adam Talbot
02/24/2026, 11:27 AMJonathan Manning
02/24/2026, 11:31 AM--threads ${task.cpus} in ext.args.Jonathan Manning
02/24/2026, 11:35 AMAdam Talbot
02/24/2026, 11:40 AMGary Burnett
02/24/2026, 2:52 PMJonathan Manning
02/24/2026, 2:54 PM