Skip to content

Commit

Permalink
cuda to gpu profile
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbore committed Nov 3, 2023
1 parent 1df6976 commit 8919958
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions USAGE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 7 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8919958

Please sign in to comment.