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

Validation Error at vkAllocateMemory #323

Open
saccharineboi opened this issue Feb 12, 2023 · 0 comments
Open

Validation Error at vkAllocateMemory #323

saccharineboi opened this issue Feb 12, 2023 · 0 comments

Comments

@saccharineboi
Copy link

I've been testing my Vulkan program on different computers, and I've noticed that on my laptop with AMD GPU (integrated GPU that comes with Ryzen 7 3700U) following validation error gets printed:

(Validation Error: [ VUID-vkAllocateMemory-deviceCoherentMemory-02790 ] Object 0: handle = 0x56258b93fe10, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x8830dc95 | vkAllocateMemory: attempting to allocate memory type 8, which includes the VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD memory property, but the deviceCoherentMemory feature is not enabled. The Vulkan spec states: If the deviceCoherentMemory feature is not enabled, pAllocateInfo->memoryTypeIndex must not identify a memory type supporting VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkAllocateMemory-deviceCoherentMemory-02790))

This doesn't affect rendering, but it is annoying nonetheless. I've come up with the following hack to "fix" it:

for (uint32_t i = 0; i < memProperties.memoryTypeCount; i++) {
    if ((typeFilter & (1 << i)) && (memProperties.memoryTypes[i].propertyFlags & properties) == properties) {
        if (memProperties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD) {
            continue;
        }
        return i;
    }
}

This makes the validation error go away. But I'm not sure if it's the correct way to handle this? Should there be a notice for those with AMD GPUs that this validation error may come up and what to do with it? Also, relevant issues in other projects: vulkan validation error and AMD GPU wants "deviceCoherentMemory" to be enabled.

This is on arch linux with vulkan-radeon package installed. I haven't tested it on a different OS.

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

1 participant