hardware — compute resources#

Schema: HardwareConfig in src/thesis/core/config/validators.py.

Drives Nipype scheduler hints, the startup GPU check, and downstream node-level resource hints. Copy config/hardware.example.yaml to config/hardware.yaml (gitignored) and adjust for your machine.

Field

Type

Default

Constraints

Description

threads

int

4

1 n 128

CPU threads available to workflow execution. Read by Nipype plugin args and per-node thread hints.

memory_gb

int

16

1 n 1024

Memory budget in GB used by Nipype memory_gb plugin arg.

gpu_enabled

bool

False

Enable GPU-aware node selection (e.g. probtrackx2_gpu). On the first run the CLI validates CUDA availability via thesis.core.gpu.check_gpu() and prompts to fall back to CPU on interactive shells (auto-falls back without prompting in non-TTY contexts).

gpu_device

int | None

None

GPU device index for multi-GPU systems. Currently informational; the binary selects its own device unless CUDA_VISIBLE_DEVICES is set.

n_gpu_procs

int

1

1

Nipype scheduler GPU worker slots — maximum number of GPU-bound nodes that may run concurrently. Prevents CUDA OOM. Only effective when gpu_enabled: true and the active plugin honours n_gpu_procs (MultiProc).

n_gpus

int

1

1

Physical GPUs visible per worker slot. Passed through as a scheduler hint.

Example#

hardware:
  threads: 16
  memory_gb: 64
  gpu_enabled: true
  n_gpu_procs: 2     # allow 2 concurrent GPU nodes (e.g. left + right hemisphere)
  n_gpus: 1          # each slot sees 1 GPU

Interaction with nipype.plugin_args#

hardware values are injected as plugin args at CLI build time:

  • n_procs ← falls back to cli --max-workers, then nipype.plugin_args.n_procs, then the plugin default.

  • memory_gbhardware.memory_gb is propagated when not already set in nipype.plugin_args.

  • n_gpu_procs / n_gpus ← copied when hardware.gpu_enabled: true.

You can still set the underlying nipype.plugin_args explicitly to override.