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.cu changes.
  • A new supported NVIDIA SM target must be added.

Prerequisites

  • haxe and hl on PATH.
  • CUDA toolkit with nvcc; set NVCC, CUDA_HOME, or CUDA_PATH if nvcc is not on PATH.
  • 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:

  1. Compile quadrants/runtime/cuda/graph_do_while_cond.cu with relocatable device code for each configured SM architecture.
  2. Device-link the result with libcudadevrt.a to resolve the CUDA graph conditional device symbol.
  3. 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

FilePurpose
quadrants/runtime/cuda/graph_do_while_cond.cuCUDA source for the condition kernel.
scripts/BuildConditionKernelFatbin.hxHaxe regeneration script.
scripts/build_condition_kernel_fatbin.hxmlHaxe compiler arguments for the script.
quadrants/runtime/cuda/graph_do_while_cond_fatbin.hGenerated C header checked into git.