Distro Planets

Igalia cuts Vulkan CTS memory usage 67% with delayed test creation fix

Key Takeaway

Ricardo Garcia from Igalia reduced deqp-vk peak memory from 900 MB to 300 MB by applying CTS's existing delayed-creation mechanism to test case hierarchies, with a pending change targeting 200 MB.

Summary

At XDC 2026 in Toronto, Ricardo Garcia of Igalia presented a lightning talk detailing how his team solved a long-standing memory bloat problem in the Vulkan Conformance Test Suite (CTS). The main deqp-vk binary had grown to approximately 900 MB of peak memory usage on his test system, causing failures in CI environments with constrained resources. Using Valgrind for profiling, Garcia identified that the culprit was not test instances—which allocate buffers, images, and pipelines—but rather the premature creation of large test case objects when building the test hierarchy tree.

The fix involved applying an existing but underutilized CTS mechanism for delayed creation of child nodes, which keeps only the currently active portion of the test tree in memory. By converting affected test groups to this approach, peak memory dropped to roughly 300 MB, with a further reduction to 200 MB under review. The change also improves tree traversal speed when running selective test subsets, since unexpanded subtrees are never instantiated.

How delayed creation reduces CTS memory pressure

  • Test hierarchy architecture: CTS organizes tests in a tree where dot-separated paths like dEQP-VK.api.smoke.triangle represent traversal from root through test groups to leaf test cases; groups and cases are C++ objects instantiated in this hierarchy.
  • Memory attribution: Valgrind profiling showed test instances (which manage Vulkan buffers, images, and pipelines) were not the primary consumer despite being the obvious suspect; instead, test case objects themselves dominated allocations.
  • Direct creation problem: Much CTS code creates entire subtrees of hundreds or thousands of test case objects in a single step when a parent group is instantiated, even though only one test runs at a time in the single-threaded deqp-vk binary.
  • Delayed creation mechanism: CTS contains an existing but sparsely documented internal facility that defers child node creation until the parent is entered for execution, then destroys children upon exit; this keeps only the active tree slice resident in memory.
  • Performance side effect: The same fix accelerates selective test execution because deqp-vk checks glob patterns before expanding groups, and delayed creation means unmatched subtrees are never constructed at all.

Why it matters

Lower memory requirements for Vulkan CTS directly benefit Mesa CI pipelines, driver vendor validation labs, and distribution package builds that run conformance tests on resource-constrained runners. The fix is particularly relevant for AMD, Intel, and NVIDIA open-source driver teams who rely on deqp-vk for regression testing, and for Steam Deck and Linux gaming ecosystem stability where Vulkan driver correctness underpins Proton compatibility.

Original reference: rg3.name →