Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Vulkan spec violation #86

Closed
TheJackiMonster opened this issue Jan 13, 2023 · 1 comment
Closed

Potential Vulkan spec violation #86

TheJackiMonster opened this issue Jan 13, 2023 · 1 comment

Comments

@TheJackiMonster
Copy link

Currently I get the following output from the Vulkan validation layer:

VUID-VkPipelineShaderStageCreateInfo-pNext-02755(ERROR / SPEC): msgNum: -2142406189 - Validation Error: [ VUID-VkPipelineShaderStageCreateInfo-pNext-02755 ] Object 0: handle = 0xee4c36000000268e, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x804d79d3 | Stage VK_SHADER_STAGE_COMPUTE_BIT is not in VkPhysicalDeviceSubgroupSizeControlPropertiesEXT::requiredSubgroupSizeStages (Unhandled VkShaderStageFlagBits). The Vulkan spec states: If a VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is included in the pNext chain, the subgroupSizeControl feature must be enabled, and stage must be a valid bit specified in requiredSubgroupSizeStages (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPipelineShaderStageCreateInfo-pNext-02755)
    Objects: 1
        [0] 0xee4c36000000268e, type: 15, name: NULL

It seems to be related to the drivers on Linux. RADV and AMDGPU-PRO do not include the VK_SHADER_STAGE_COMPUTE_BIT in the requiredSubgroupSizeStages from VkPhysicalDeviceSubgroupSizeControlPropertiesEXT. That causes a violation regarding the specification when VkPipelineShaderStageRequiredSubgroupSizeCreateInfo gets used creating the compute shader stages for the FSR2 compute pipelines. AMDVLK works fine because requiredSubgroupSizeStages contains the valid bit.

I recommend adding a check for that bits before using that feature or the Vulkan specification needs to address a special case when requiredSubgroupSizeStages is zero (that is currently the case causing the issue).

I've created a commit to apply a fix for the meantime: TheJackiMonster@ec9fcf9

@Saancreed
Copy link

This appears to have been fixed in 2.2.0:

// NOTE: It's important to check requiredSubgroupSizeStages flags (and it's required by the spec).
// As of August 2022, AMD's Vulkan drivers do not support subgroup size selection through Vulkan API
// and this information is reported through requiredSubgroupSizeStages flags.
if (subgroupSizeControlProperties.requiredSubgroupSizeStages & VK_SHADER_STAGE_COMPUTE_BIT)
{
deviceCapabilities->waveLaneCountMin = subgroupSizeControlProperties.minSubgroupSize;
deviceCapabilities->waveLaneCountMax = subgroupSizeControlProperties.maxSubgroupSize;
}

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

No branches or pull requests

2 participants