Building the CUDA graph conditional fatbin
The CUDA graph_do_while path uses a small pre-built device fatbin for the condition kernel. The fatbin is checked in as quadrants/runtime/cuda/graph_do_while_cond_fatbin.h so normal Quadrants builds do not need nvcc or libcudadevrt.a.
This page documents the rare developer-only regeneration step. The old Python regeneration script has been replaced by a Haxe/HashLink script.
When to regenerate
Regenerate the fatbin only when:
quadrants/runtime/cuda/graph_do_while_cond.cuchanges.- A new supported NVIDIA SM target must be added.
Prerequisites
haxeandhlonPATH.- CUDA toolkit with
nvcc; setNVCC,CUDA_HOME, orCUDA_PATHifnvccis not onPATH. - CUDA toolkit support for the SM targets listed in
scripts/BuildConditionKernelFatbin.hx.
Regenerating
Run from the repository root:
haxe scripts/build_condition_kernel_fatbin.hxml
hl build_condition_kernel_fatbin.hl
The script will:
- Compile
quadrants/runtime/cuda/graph_do_while_cond.cuwith relocatable device code for each configured SM architecture. - Device-link the result with
libcudadevrt.ato resolve the CUDA graph conditional device symbol. - Write the generated byte array to
quadrants/runtime/cuda/graph_do_while_cond_fatbin.h.
After regenerating, commit the updated header and rebuild Quadrants.
Adding a new SM architecture
Edit SM_VERSIONS in scripts/BuildConditionKernelFatbin.hx, then rerun the Haxe/HL script.
Files
| File | Purpose |
|---|---|
quadrants/runtime/cuda/graph_do_while_cond.cu | CUDA source for the condition kernel. |
scripts/BuildConditionKernelFatbin.hx | Haxe regeneration script. |
scripts/build_condition_kernel_fatbin.hxml | Haxe compiler arguments for the script. |
quadrants/runtime/cuda/graph_do_while_cond_fatbin.h | Generated C header checked into git. |