Skip to content

Enable subgroup size control on Vulkan 1.2 devices - #9558

Closed
nova-aryan wants to merge 1 commit into
ProjectLeonida:mainfrom
nova-aryan:contrib/22-vulkan12-subgroup-control
Closed

nova-aryan wants to merge 1 commit into
ProjectLeonida:mainfrom
nova-aryan:contrib/22-vulkan12-subgroup-control

Conversation

@nova-aryan

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue.

The runtime's Vulkan 1.2 path and the shader-build capability probe both ignored advertised VK_EXT_subgroup_size_control. This could force wave64 emulation when the device can pin the required subgroup size.

Query and enable the extension on eligible Vulkan 1.2 devices, and use the same feature bit in the Python probe. Synthetic devices cover the extension enabled, missing, and advertised with the feature disabled. The C++ test verifies the enable chain and the existing core path.

54 Windows probe tests and the Linux C++ Vulkan feature suite passed. Hardware coverage for the Vulkan 1.2 extension remains open. The runtime test harness's core-version gating is tracked separately in #4936. In the combined run, the 5,957-test Linux semantic suite reproduced the baseline failures in test_image_atomics_guard and test_image_store_d16. No game files were used.

Developed with AI assistance.

@LukeOsland1

Copy link
Copy Markdown
Contributor

I exercised the extension path at bcfabd8 and parent 5d74c27 against both physical Windows drivers. The application requested Vulkan 1.2 and passed that effective version to Vulkan13Features::query. Both physical devices advertise Vulkan 1.4, so this tests the real extension entry points and feature chain under a 1.2 application, rather than driver behavior on a 1.2-only GPU.

The parent helper reported subgroup_size_control=false and omitted VK_EXT_subgroup_size_control on both devices. The PR detected it, added it to the device extensions, and successfully created logical devices with the helper's enable chain. I pinned each supported size on a compute pipeline and read gl_SubgroupSize and gl_NumSubgroups from every invocation in a 64-lane workgroup.

Adapter and Windows driver Required size Readback
NVIDIA RTX 4070 Ti SUPER, 32.0.16.1088 32 64/64 reported size 32, two subgroups
NVIDIA 64 Skipped, device limits 32..32
AMD Radeon(TM) Graphics, 32.0.21042.62 32 64/64 reported size 32, two subgroups
AMD Radeon(TM) Graphics 64 64/64 reported size 64, one subgroup

Windows build 26300, MSVC, Vulkan SDK 1.4.341.1, validation layer enabled. The synthetic module passed spirv-val for Vulkan 1.2. No validation diagnostics on these runs. The Python probe was outside this check. No game files. AI-assisted with Codex.

Claim: #9522 (comment)

@thehollowedone

Copy link
Copy Markdown

Independent Windows check of bcfabd83. Windows 11 x64, MSVC 19.44, CPython 3.12.8, Vulkan SDK 1.4.363.0.

  • The stock vulkan13_features_test passed. All 54 tests in tests/test_vk_subgroup_info.py passed with zero skips, including the Vulkan 1.2 cases that simulate an absent extension or a disabled feature.
  • On an RTX 3080 Ti, tools/vk_subgroup_info.py used the Vulkan 1.4 core path. It reported subgroup size control, a fixed supported size of 32, and no native wave64 support. This complements the Vulkan 1.2 extension check.

Synthetic inputs only. AI-assisted.

@adorted

adorted commented Nov 23, 2026

Copy link
Copy Markdown

Tested bcfabd83d merged onto main 5d74c2723 (clean merge) with the device itself reporting Vulkan 1.2, complementing the application-side 1.2 run above. NVIDIA GeForce RTX 5090, driver 610.88, Windows 10 Pro 19045, MSVC 19.44.35230, Vulkan SDK 1.4.363.0. No game files. Pass, no regression.

The SDK's profiles layer can lower the reported device API version while leaving the driver's real extensions (including VK_EXT_subgroup_size_control) visible. With these set, vulkaninfo reports apiVersion = 1.2.148 for the 5090:

VK_LAYER_PATH=%VULKAN_SDK%\Bin
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_profiles
VK_KHRONOS_PROFILES_PROFILE_DIRS=%VULKAN_SDK%\Config\VK_LAYER_KHRONOS_profiles
VK_KHRONOS_PROFILES_PROFILE_NAME=VP_LUNARG_desktop_baseline_2023
VK_KHRONOS_PROFILES_SIMULATE_CAPABILITIES=SIMULATE_API_VERSION_BIT
VK_KHRONOS_PROFILES_EMULATE_PORTABILITY=false

Under that, main and this PR side by side (both full runtime builds on this machine):

main 5d74c2723 this PR
tools/vk_subgroup_info.py "subgroup_size_control": false "subgroup_size_control": true
device log of the vk_test_device GPU tests subgroupSizeControl off (6 tests) subgroupSizeControl on (6 tests)
full runtime ctest -j4 258/265 258/265, identical pass/fail set
d3d12_mesh_test pass pass
  • The 7 failures are the same on both sides and are pre-existing on this host (root_signature_oracle, d3d12_vulkan_device, d3d12_close_parity, d3d12_execute_indirect_validation, d3d12_depth_resolve, d3d12_pso_validation, d3d12_set_descriptor_heaps). d3d12_indirect_rt and dxgi_swapchain skip under the 1.2 profile on both sides.
  • With LEONIDA_VK_VALIDATION=1 under the 1.2 profile, device creation with the PR's extension chain produced no validation messages. d3d12_mesh_test does report 4 messages (pipeline-statistics query with mesh shaders), but it reports the same 4 natively without the profile, so they are unrelated to this PR.
  • Natively (Vulkan 1.4 core path) the full suite gives the same 8 pre-existing failures as main; vulkan13_features and the 54 tests in tests/test_vk_subgroup_info.py pass.

AI-assisted (Claude Code).

@sgonzalez-glitch

Copy link
Copy Markdown

Tested bcfabd83d (as part of #9429, #9505, #9516, #9547, #9549 and #9558 merged together onto main 5d74c2723) on NVIDIA GeForce RTX 2080, driver 621.24 (32.0.16.2124), Windows 11, MSVC 19.44 RelWithDebInfo: pass.

AI-assisted: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants