Fix Vulkan compute pipeline crash by checking if VK_EXT_subgroup_size_control is enabled#20762
Fix Vulkan compute pipeline crash by checking if VK_EXT_subgroup_size_control is enabled#20762RanjithRagavan wants to merge 2 commits into
Conversation
…_control is successfully enabled
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20762
Note: Links to docs will display an error until the docs builds have been completed.
|
|
Root Cause: The Vulkan physical device reported supporting the VK_EXT_subgroup_size_control feature during initial queries. However, during logical device creation (vkCreateDevice), the extension itself was not successfully enabled (common on modern drivers because the extension has been promoted to core in Vulkan 1.3, but ExecuTorch initializes Vulkan with a Vulkan 1.1 target version, making it non-core). Passing the features struct in pNext of VkDeviceCreateInfo without enabling the corresponding extension is a Vulkan specification violation, leading to driver errors (-3 VK_ERROR_INITIALIZATION_FAILED) when compute pipelines attempt to bind or compile shaders. |
|
@pytorchbot label "release notes: none" |
This PR fixes a native Vulkan compute pipeline creation crash (-3 VK_ERROR_INITIALIZATION_FAILED) in Android 16 (API 36) system images. The bug occurs because the physical device reports subgroup size control support, but the extension is not enabled on the logical device (due to it being promoted to core Vulkan 1.3, which is not core in Vulkan 1.1 instance/device target). Passing the extension feature struct in pNext of VkDeviceCreateInfo without enabling the extension is invalid usage. This change checks if VK_EXT_subgroup_size_control is successfully enabled before utilizing its features. Fixes #11754.
cc @SS-JIA @manuelcandales @digantdesai @cbilgin