Skip to content

GPU examples

The simulation examples publish saved figures from actual CUDA runs; the scaling report renders saved measurements on the CPU. Start with a native CPU aerosol, prepare supported processes on the GPU, and bring detached results back for analysis. Install Particula and its plotting extras, then read the prepared workflow guide. Warp is a declared package dependency; CUDA also needs an available NVIDIA GPU and compatible driver. There is no CPU fallback in publication runs.

If you want to build a study, begin with the prepared quick start, then choose one of three comparisons: controlled environmental response, repeated stochastic histories, or source/forcing interactions. If you want to understand execution internals, use the direct and resident examples after the public workflow. Their deliberately small fixtures are interface demonstrations, not calibrated physical populations. The topic explorer connects these execution choices back to growth, collisions, charge, and verification.

Example Scientific or workflow question
CPU → CUDA → CPU quick start How do eight aerosol boxes evolve, change forcing, capture and resume?
Custom process backends Can an imposed warming law agree with an analytic solution across CPU, CUDA, transfer, and restart?
Charged Brownian models How do five charged fits compare on CUDA against their CPU implementations?
Explicit atmospheric ion balance Do ion production, recombination and neutral-product export reproduce finite-population balance on CUDA?
Ground to mesopause and high pressure How do dry charged-aerosol size, charge and collision histories change from 0–86 km and from 1–10 atm?
Humid aerosols and explicit ions How do 2.6 million aerosols and ions exchange water, charge, attach and coagulate across sixteen environments?
The lucky few How often does a 3 nm seed reach 50 nm before background capture, under two explicit ion-attachment assumptions?
Heterogeneous boxes How do 64 boxes with different thermodynamic conditions, volume and composition respond?
Cooling, heating and vapor forcing How does a four-material/five-gas population respond to an external schedule?
Stochastic coagulation ensemble How much does evolution vary across sixteen random seeds?
Million-particle lifecycle Can 1,572,864 active particles use all five processes with exact capture/restart agreement?
Repeated source pulses How do new cohorts, Brownian collisions and cyclic condensation interact over 600 seconds?

The heterogeneous example varies several conditions together and does not identify a temperature-only effect. Ensemble shading is a distribution across seeds, not a confidence interval. Large counts establish execution and accounting; physical predictions still require appropriate model choice and convergence.

The RTX 5060 scaling report separates resident throughput, complete-workflow costs, old/new Brownian GPU execution and memory. Its small downloadable data contains plotted summaries and displayed provenance, not model states or image arrays.

Direct kernels and concrete resident interfaces

Section titled “Direct kernels and concrete resident interfaces”
Example Scope
Direct quick start Manual transfers and a first condensation step.
Direct Brownian coagulation Size distribution and conserved mass after a direct call.
Complete direct sequence Five explicit boundaries; the nucleation call has zero duration.
Condensation parity Fixed-four-substep numerical oracle, transfer and energy diagnostics.
Direct nucleation Unit-count events in boxes with different physical volumes.
Resident checkpoint lifecycle State ownership and exact restart, without advancing physics.
Resident multi-timestep loop An open-system sequence with explicit forcing and sinks.
Native graph capture Captured resident-loop execution and physical outputs.

For the public introduction, run:

Terminal window
python docs/examples/gpu/prepared/gpu_prepared_quick_start.py

For the illustrated CUDA path in an older direct/resident source, pass --cuda:

Terminal window
python docs/examples/gpu/direct/gpu_direct_kernels_quick_start.py --cuda

Older sources retain portable unflagged regression helpers. Their Warp CPU or no-Warp behavior is separate from published CUDA evidence. A clean optional skip does not establish GPU correctness or speed.

First identify which comparison the page actually makes. A heterogeneous scan can reveal diverse response without isolating a cause; a seed ensemble can quantify sampling spread without measuring parameter uncertainty; a capture comparison can establish repeatability without measuring speed. Choose your next control accordingly, and compare the scientific diagnostic before timing it.

For example, hold the initial population fixed while changing only a collision seed, or retain the same physical forcing times while halving a timestep. Document external sources and sinks before interpreting inventory differences. The individual studies close with more specific extensions and their evidence requirements.

Site builds render saved results without executing simulations. Refresh a CUDA example explicitly, then review and commit its complete result bundle:

Terminal window
python scripts/docs_examples.py refresh gpu-prepared-quick-start
python scripts/docs_examples.py refresh gpu-prepared-cyclic-chamber

Large scientific studies may take longer than ten minutes; their registry entries allow up to two hours. CI checks source, dependency freshness and saved file integrity without executing these CUDA studies. Download the helper ZIP for examples that use shared study code, then run example.py from its extracted folder. See authoring guidance and validation records.

Explore this topic: GPU workflows