VK_EXT_gpu_assisted_validation overhead and default activation state
0 reputation · 15 Sept 2023, 14:42 UTC
0 reputation · 15 Sept 2023, 14:42 UTC
The VK_EXT_gpu_assisted_validation extension allows the Vulkan SDK to offload validation checks to the GPU, which reduces the CPU bottleneck typically associated with heavy validation layers and improves the accessibility of the debugging workflow.
While this feature provides immediate feedback during rendering, it introduces constraints regarding GPU memory consumption and potential performance degradation on low-end hardware. Currently, the extension is opt-in and requires explicit activation via VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT during instance creation.
There is an unresolved design decision regarding the default state of this validation mode across different build configurations. Specifically, it is unclear if this should remain a manual opt-in or become a default for debug-specific builds.
31775 reputation · 15 Sept 2023, 19:20 UTC
GPU‑assisted validation should be turned on by default in debug builds only when the target device has enough dedicated VRAM to absorb the extra validation buffers without risking out‑of‑memory (OOM) failures, and when the measured CPU‑time savings outweigh the added GPU workload. On hardware that does not meet those conditions the extension must remain opt‑in.
VK_EXT_gpu_assisted_validation extension is explicitly opt‑in via VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT during vkCreateInstance; it is not enabled by default in any Vulkan SDK release.To decide whether to flip the default to “on” for debug builds, evaluate the following:
VkMemoryHeap::flags for VK_MEMORY_HEAP_DEVICE_LOCAL_BIT and sum the size of all device‑local heaps. If the total exceeds a safe threshold (commonly ≈ 1 GB – 2 GB, depending on the application’s baseline usage), the extra validation buffers are unlikely to cause OOM.VK_VALIDATION_FEATURE_ENABLE_* flags. Fewer active checks mean lower GPU memory demand.VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT. If the CPU time saved is significant (> 10 % of frame time) and GPU frame time does not increase beyond acceptable limits, the extension is a net win.If you determine that GPU‑assisted validation is beneficial but VRAM is tight, apply these scoped actions:
VkValidationFeatureEnableEXT enables[] = {
VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT,
VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT
};
VkValidationFeaturesEXT features = {
.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT,
.enabledValidationFeatureCount = 2,
.pEnabledValidationFeatures = enables
};
VkInstanceCreateInfo createInfo = { .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, .pNext = &features };
vkGetPhysicalDeviceMemoryProperties2 with VK_KHR_get_memory_requirements2 to monitor device‑local heap usage and dynamically disable the extension if usage approaches a safe limit (e.g., 80 % of total device‑local memory).To give a definitive recommendation for a specific device, we need to know the total dedicated VRAM size reported by the physical device. If you can provide that value, we can confirm whether the default‑on threshold is satisfied.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.