Skip to content

layers: Add checks and tests for VU 9941 - WIP#11713

Open
stefano-bucciarelli-arm wants to merge 1 commit intoKhronosGroup:mainfrom
stefano-bucciarelli-arm:VU_9941_spirv_tosa_only
Open

layers: Add checks and tests for VU 9941 - WIP#11713
stefano-bucciarelli-arm wants to merge 1 commit intoKhronosGroup:mainfrom
stefano-bucciarelli-arm:VU_9941_spirv_tosa_only

Conversation

@stefano-bucciarelli-arm
Copy link
Contributor

This is very specific for datagraphs defined with TOSA in a spirv program.
The unit test does NOT create a negative case; it is a positive test for testing and needs to be modified.

@stefano-bucciarelli-arm stefano-bucciarelli-arm requested a review from a team as a code owner February 19, 2026 13:34
@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

std::unordered_map<uint32_t, std::vector<VkQueueFamilyDataGraphPropertiesARM>> all_properties;
for (uint32_t i = 0; i < n_families; i++) {
uint32_t n_properties = 0;
assert(VK_SUCCESS == DispatchGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM(phys_dev, i, &n_properties, nullptr));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this crashes locally because my machine doesn't have this function, you are going to need to warp this with

const std::unordered_map<uint32_t, std::vector<VkQueueFamilyDataGraphPropertiesARM>> PhysicalDevice::GetQueueFamilyDataGraphProps(VkPhysicalDevice phys_dev) {
    std::unordered_map<uint32_t, std::vector<VkQueueFamilyDataGraphPropertiesARM>> all_properties;
    if (has_arm_tensors) {

    }
    return all_properties;
}

... see PhysicalDevice::has_maintenance9 as an example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copying what we do with has_maintenance9 doesn't work, it gets initialize after we pass through here.
Is there another way to check if an extension is supported at this stage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and how can DispatchGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM be undefined? It's in the generated vulkan code, layers/vulkan/generated/dispatch_functions.h.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is just null, there is no implementation in my driver, so it crashes

What we can do is just cache it, the first time someone calls it in the command buffer it gets the value, the 2nd time, it just reads from it

Copy link
Contributor Author

@stefano-bucciarelli-arm stefano-bucciarelli-arm Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed something to check if the function is not null in the dispatch table, does this work?
Is there a simple way to make the mock ICD emulate the issue for testing, i.e. force dispatch_table.GetPhysicalDeviceQueueFamilyDataGraphPropertiesARM == nullptr?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefano-bucciarelli-arm just remove it from TestICD and try to run any test, it will crash quite quickly

diff --git a/layers/vulkan/generated/test_icd_helper.h b/layers/vulkan/generated/test_icd_helper.h
index 8b34680c1..66fcb94e5 100644
--- a/layers/vulkan/generated/test_icd_helper.h
+++ b/layers/vulkan/generated/test_icd_helper.h
@@ -2140,9 +2140,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetDataGraphPipelinePropertiesARM(VkDevice
                                                                         const VkDataGraphPipelineInfoARM* pPipelineInfo,
                                                                         uint32_t propertiesCount,
                                                                         VkDataGraphPipelinePropertyQueryResultARM* pProperties);
-static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceQueueFamilyDataGraphPropertiesARM(
-    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pQueueFamilyDataGraphPropertyCount,
-    VkQueueFamilyDataGraphPropertiesARM* pQueueFamilyDataGraphProperties);
 static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM(
     VkPhysicalDevice physicalDevice,
     const VkPhysicalDeviceQueueFamilyDataGraphProcessingEngineInfoARM* pQueueFamilyDataGraphProcessingEngineInfo,
@@ -3094,7 +3091,6 @@ static const std::unordered_map<std::string, void*> name_to_func_ptr_map = {
     {"vkCmdDispatchDataGraphARM", (void*)CmdDispatchDataGraphARM},
     {"vkGetDataGraphPipelineAvailablePropertiesARM", (void*)GetDataGraphPipelineAvailablePropertiesARM},
     {"vkGetDataGraphPipelinePropertiesARM", (void*)GetDataGraphPipelinePropertiesARM},
-    {"vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM", (void*)GetPhysicalDeviceQueueFamilyDataGraphPropertiesARM},
     {"vkGetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM",
      (void*)GetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM},
     {"vkCmdSetAttachmentFeedbackLoopEnableEXT", (void*)CmdSetAttachmentFeedbackLoopEnableEXT},
diff --git a/tests/icd/test_icd.cpp b/tests/icd/test_icd.cpp
index 924d5c888..7d647e76f 100644
--- a/tests/icd/test_icd.cpp
+++ b/tests/icd/test_icd.cpp
@@ -1454,20 +1454,6 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalTensorPropertiesARM(
     }
 }
 
-static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceQueueFamilyDataGraphPropertiesARM(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t *pQueueFamilyDataGraphPropertyCount, VkQueueFamilyDataGraphPropertiesARM* pQueueFamilyDataGraphProperties) {
-
-    // TODO: Need a way for test to decide to support or not support various engines
-
-    if (pQueueFamilyDataGraphProperties == nullptr) {
-        *pQueueFamilyDataGraphPropertyCount = 1;
-    } else {
-        pQueueFamilyDataGraphProperties[0].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_DATA_GRAPH_PROPERTIES_ARM;
-        pQueueFamilyDataGraphProperties[0].engine = { VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_DEFAULT_ARM, false };
-        pQueueFamilyDataGraphProperties[0].operation = { VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_SPIRV_EXTENDED_INSTRUCTION_SET_ARM, "TOSA.001000.1", 0 };
-    }
-    return VK_SUCCESS;
-}
-
 static VKAPI_ATTR VkResult VKAPI_CALL
 GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
                                         VkImageFormatProperties2* pImageFormatProperties) {

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@spencer-lunarg
Copy link
Contributor

@stefano-bucciarelli-arm this PR got messy

I merged in #11753

I would suggest closing this, and trying again with my idea of still having

    const std::unordered_map<uint32_t, std::vector<VkQueueFamilyDataGraphPropertiesARM>> queue_family_data_graph_properties;

but in CoreChecks::FinishDeviceSetup() detect if VK_ARM_tensor is enabled and then call

if (IsExtEnabled(extensions.vk_arm_tensors)) {
    physical_device_state->GetQueueFamilyDataGraphProps();
}

when queue_family_data_graph_properties is set inside GetQueueFamilyDataGraphProps

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

- covers VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_DEFAULT_ARM only
- test skipped in mock ICD: we don't have a way to create an unsupported queue
@ci-tester-lunarg
Copy link
Collaborator

Author stefano-bucciarelli-arm not on autobuild list. Waiting for curator authorization before starting CI build.

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.

3 participants