morphogen.gpu

Optional GPU backend (NVIDIA GPUs, through CuPy): the choice of the device.

The FFT solvers of voxel images run their conjugate gradients on the GPU with device="gpu" (or "auto": the GPU when there is one): the stiffness operators of the voxels, applied matrix-free, become CUDA kernels and the Fourier preconditioner cuFFT transforms (morphogen.homogenization.gpu). Along loading paths the integration points stay on the GPU, where their behaviours are integrated; the Newton iterations of the periodic element stay on the CPU. CuPy and the CUDA libraries it needs (the runtime, NVRTC and cuFFT, about 270 MB; no CUDA toolkit is needed) are optional:

pip install cupy-cuda13x "cuda-toolkit[cudart,nvrtc,cufft]==13.*"

(cupy-cuda12x and cuda-toolkit[...]==12.* for drivers older than CUDA 13).

morphogen.gpu.available() → bool[source]

Whether the GPU backend can run (CuPy, a CUDA device and its runtime).

morphogen.gpu.device_of(name) → str[source]

The device that a choice "cpu", "gpu" or "auto" designates: "auto" is the GPU when it is available; "gpu" without one is an error.

morphogen.gpu.info() → dict[source]

The GPU and CuPy, or why the backend is not available.