VulkanMemoryAllocator icon indicating copy to clipboard operation
VulkanMemoryAllocator copied to clipboard

vkGetPhysicalDeviceMemoryProperties2KHR not found

Open FilippoLeon opened this issue 11 months ago • 4 comments

I have a feeling that even on vulkan >= 1.1, sometimes

vkGetPhysicalDeviceMemoryProperties2KHR is not found by the loader, unless the VK_KHR_get_physical_device_properties2 is enabled.

maybe could be a good idea to fallback to the "non"-khr version if the pointer is not found?

I'm using vma with #define VMA_STATIC_VULKAN_FUNCTIONS 0 #define VMA_DYNAMIC_VULKAN_FUNCTIONS 1

I pass instance and device pointers that I obtain from the vulkan-hpp dynamic dispatcher.

FilippoLeon avatar Dec 24 '24 11:12 FilippoLeon

Sorry, I think this might be a duplicate of https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/410

I think the underlying cause is a bug in the Nvidia driver implementation for linux.

FilippoLeon avatar Dec 24 '24 12:12 FilippoLeon

Currently, function ImportVulkanFunctions_Dynamic fetches this function pointer:

  • From "vkGetPhysicalDeviceMemoryProperties2" if Vulkan version >= 1.1.
  • Else, from "vkGetPhysicalDeviceMemoryProperties2KHR" if VK_KHR_get_physical_device_properties2 extension is enabled.

Which I think matches the Vulkan spec. How do you propose to change this logic to make it more robust against this driver bug?

adam-sawicki-a avatar Jan 15 '25 11:01 adam-sawicki-a

EDIT: I'm talking nonsense, that can't work :)

I could check if in the broken driver implementation it could work by falling back if we get a nullptr back.

FilippoLeon avatar Jan 15 '25 16:01 FilippoLeon

I pushed some changes, always trying to load the function pointer from both "vkGetPhysicalDeviceMemoryProperties2" or "vkGetPhysicalDeviceMemoryProperties2KHR" names. Please let me know if it helps.

adam-sawicki-a avatar Jan 16 '25 10:01 adam-sawicki-a