Blumenkrantz Optimizes Mesa Vulkan Submission Merging – Some Test Cases Improve 1000%+
Mike Blumenkrantz, a member of Valve’s Linux graphics driver team, has achieved impressive optimization of the Mesa Vulkan driver code, benefiting multiple drivers and hardware vendors. Blumenkrantz focused on Mesa’s handling of Vulkan queues, which can be slow. He discovered that while the Vulkan API allows for performing an array of command buffer submissions at once, Mesa’s current handling splits the batched submits and submits each one individually. This approach increases overhead and memory allocation overhead.
To address this issue, Blumenkrantz reworked the Vulkan queue submission code, added threaded waits, and merged queue submissions where possible to reduce synchronization overhead. The optimization took place within Mesa’s common Vulkan run-time code, making it even more exciting as it benefits all drivers, not just specific ones.
The pending improvements in some vkOverhead benchmark test cases show significant performance gains. The RADV driver on RDNA3 GPUs can be approximately 1000% faster for command submission. The Lavapipe software driver saw gains ranging from 1000% to 3000% in some cases. The Intel ANV Vulkan driver with Arc Graphics (DG2) achieved up to 5000% faster speeds, and the Qualcomm Adreno TURNIP driver saw improvements of around 3000% to 4000%. The code to optimize submission merging for the Vulkan Mesa drivers is currently under review via a Mesa MR.
For more details on Blumenkrantz’s relentless optimizing work, please refer to this blog post.