Skip to content

novaphy.CudaGraphCapture

Driver-level CUDA graph capture helper for Newton-style external capture. Solvers do not own graph capture; user code captures a warm, allocation-free step loop from the driver layer.

Constructor

capture = novaphy.CudaGraphCapture(device_ordinal=0)

Methods and Properties

Member Description
begin() / end() Start / end stream capture.
launch() Launch the captured graph on the capture stream.
synchronize() Synchronize the capture stream.
active True while capture is active.
captured True after a graph has been instantiated.
device_ordinal CUDA device ordinal.
stream Opaque CUDA stream pointer used by the capture.

Example

capture = novaphy.CudaGraphCapture(0)

with capture:
    solver.step(state, state, control, contacts, dt)

capture.launch()
capture.synchronize()

Pre-allocate and warm up model, solver, state, and contact buffers before capture. The captured body must not allocate or resize device buffers.

Constructing CudaGraphCapture in a CPU-only build raises RuntimeError. Only use this helper after installing a core CUDA-enabled build.

See Also