Common pitfalls and how to recover from them.
cupy.cuda.runtime.CUDARuntimeError: cudaErrorNoDevice: no CUDA-capable device is detected
nvidia-smi and verify the GPU is visible to the OS.nvidia-smi (e.g. cupy-cuda12x for CUDA 12).--gpus all and the NVIDIA
Container Toolkit is installed.get_image_space_coordinates enforces that all input volumes have the same
depth. Pad the shorter ones with zeros (and update the motor coordinates
accordingly) before running the pipeline.
The Utilities.H5MaxIV.reader tries a list of common layouts:
exchange/data — ForMAX / HZBimage — genericstitched_data/stitched_image — outputs of a previous TomoImageStitcher runentry/instrument/zyla/data — a NeXus layoutIf your data uses a different layout, either:
Utilities.H5MaxIV.reader to add your path, orexclude_NCC thresholdPossible causes:
check_padding for obvious
misalignments.downscale=0.5 with
downscale_stages=2 instead of downscale=0.25, downscale_stages=1.apply_mean_filter_zyx=(3, 3, 3).Lower the per-pair data volume sent to the GPU:
mask_radius to exclude border regions.equal_crop_xy=N to send only a centered square of side N.start_slice= and end_slice=.apply_affine_warp=False) and use
translation-only registration.Try:
alpha=1 for a smooth distance-map blend, or higher for sharper edges.use_equalize=True to apply linear intensity matching in the overlap.prop_x_y=(0, 0) (Chebyshev) for “square” distance propagation, useful
when the slices are arranged on a regular grid.stitch_volumes_blend_equalize_parallelmultiprocessing.Pool is not compatible with CuPy on some setups — the
code uses a ThreadPool instead, but you may still hit the global
interpreter lock. Lower n_cores or use a single process.
Verify that the motor coordinates you pass to Stitcher are in millimetres
and degrees (or both, in a consistent unit). The pipeline does not
auto-detect; you control the x_y_z_correspondance mapping.
Force float32 everywhere by setting:
os.environ["CUPY_DTYPE_POLICY"] = "strict"
before importing CuPy.