From 8919958b4eefcf352558b4036416ff9ac075a36f Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 3 Nov 2023 16:07:28 -0400 Subject: [PATCH] cuda to gpu profile --- USAGE | 5 +++-- main.nf | 10 +++++++--- nextflow.config | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/USAGE b/USAGE index 99c9392..5f67daa 100755 --- a/USAGE +++ b/USAGE @@ -194,11 +194,12 @@ OPTIONAL ARGUMENTS (current value) --processes The number of parallel processes to launch ($cpu_count). Only affects the local scheduler. -AVAILABLE PROFILES (using -profile option (e.g. -profile use_cuda,fully_reproducible)) +AVAILABLE PROFILES (using -profile option (e.g. -profile use_gpu,fully_reproducible)) macos When this profile is used, TractoFlow will modify a parameter (scratch) for MacOS users. -use_cuda When this profile is used, TractoFlow will use eddy_cuda for Eddy process. +use_gpu When this profile is used, TractoFlow will use eddy_cuda for Eddy process. + If local tracking is also enabled, Tractoflow will use the gpu implementation of scil_compute_local_tracking.py. This feature is available with NVidia GPUs only. Without this profile, TractoFlow will run eddy_openmp. fully_reproducible When this profile is used, all the parameters will be set to have 100% reproducible results. diff --git a/main.nf b/main.nf index 8cf9143..b4b0e7b 100644 --- a/main.nf +++ b/main.nf @@ -355,6 +355,10 @@ if (params.bids && workflow.profile.contains("ABS") && !params.fs){ error "Error ~ --bids parameter cannot be run with Atlas Based Segmentation (ABS) profile" } +if (workflow.profile.containes("use_gpu")){ + warning "" +} + (dwi, gradients, t1, readout_encoding) = in_data .map{sid, rev_flag, bvals, bvecs, dwi, t1, readout, encoding -> [tuple(sid, rev_flag, dwi), tuple(sid, rev_flag, bvals, bvecs), @@ -375,9 +379,9 @@ if (params.eddy_cmd == "eddy_cpu" && params.processes_eddy == 1 && params.run_ed number_rev_dwi .subscribe{a -> if (a>0) error "Error ~ You have some subjects with a reverse encoding DWI.\n" + - "Eddy will take forever to run with this configuration. \nPlease add " + - "-profile use_cuda with a GPU environnement OR increase the number of processes " + - "for this task (--processes_eddy) to be able to analyse this data."} + "Eddy will take forever to run with this configuration. \nPlease add " + + "-profile use_gpu with a GPU environnement (GPU NVIDIA with cuda) OR increase the number " + + "of processes for this task (--processes_eddy) to be able to analyse this data."} } if (!params.run_topup || !params.run_eddy){ diff --git a/nextflow.config b/nextflow.config index 445d228..78dd4c7 100644 --- a/nextflow.config +++ b/nextflow.config @@ -192,7 +192,7 @@ singularity.autoMounts = true profiles { - use_cuda { + use_gpu { singularity.runOptions='--nv' docker.runOptions='--gpus all' params.eddy_cmd="eddy_cuda10.2"