In this article
A smaller final acceleration structure does not mean that compaction requires less memory at every stage of the operation.
Distinguish resident size from construction peak
Compaction can reduce the memory occupied by an acceleration structure after it is built. A worker still needs enough memory to reach that state. The original structure and a compacted destination can coexist while work is in progress, along with other rendering allocations. Budget the transition separately from the final resident scene. A capacity estimate based only on the compacted result can fail before the first useful render begins.
Enable and query the supported operation
The OptiX host declarations state that a structure must have been built with compaction permission. They describe querying the compacted size and creating a compacted output through the API. Preserve the original build flags and emitted property results with the resource state. Do not guess a compression ratio from another scene or infer a destination allocation from the original vertex-buffer size.
Allocate the reported destination correctly
The type declarations define the compacted-size property and acceleration-buffer alignment requirements. Allocate an appropriately sized and aligned destination before starting the operation. The reported structure size does not include every other live scene resource or every allocator’s overhead. Measure the actual process and device-memory peak while compaction runs, particularly when several scene builds are admitted concurrently on the same GPU worker.
Track the returned handle and dependencies
Compaction returns an output traversable handle associated with the new storage. The device API uses traversable handles for ray operations, so moving bytes alone is not a complete application-level resource transition. Update scene references and dependent instance structures as required by the integration. Keep source memory valid until work using it has completed, and retain the compacted storage for as long as its handle remains in use.
Compare memory and geometry results
Trace a controlled set of rays before and after compaction, checking the intended geometry results while measuring peak and steady-state allocations separately. Also exercise scene replacement and cleanup rather than only the first successful frame. The guides to GPU BVH traversal and renderer compatibility provide related context. A useful compaction policy preserves valid handle references and execution lifetimes, reaches the desired resident footprint and fits the temporary memory budget needed to get there.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.