GPUOpen-LibrariesAndSDKs / VulkanMemoryAllocator

Easy to integrate Vulkan memory allocation library
MIT License
2.63k stars 359 forks source link

The procedure Entry point could not be located #280

Open marvkey opened 2 years ago

marvkey commented 2 years ago

Every time I add the VMA_IMPLEMENTATION in 1 cpp file I keep getting this error at runtime, just before my application starts running

image

adam-sawicki-a commented 2 years ago

This issue has been observed before. Please check following tickets, they may help: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/247 , https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/256.

Please make sure your entire project uses the same version of Vulkan SDK.

darby-anderson commented 2 years ago

Not sure if it helpful to add to the pile of reports on this issue, but I have run into the same error. My project only uses the 1.3.224 Vulkan SDK (it's the only one on my device) and I am using the 3.0.0 version of VMA.

The fix of removing #define VMA_IMPLEMENTATION has worked for me, but was hoping to see if I could help by adding information.

janlaff commented 1 year ago

For me it worked to just #define VMA_VULKAN_VERSION 1002000 and the error is gone

squadack commented 1 year ago

This issue can be caused by graphics card driver not supporting Vulkan 1.3. You are trying link statically with a function that is not there. The solution to this would be to fetch those functions dynamically. To do that, you have to define

#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1

in the same place where you have #define VMA_IMPLEMENTATION and pass 2 functions vkGetInstanceProcAddr and vkGetDeviceProcAddr when creating the allocator:

VmaAllocatorCreateInfo allocInfo = {};
VmaVulkanFunctions func = {};
func.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
func.vkGetDeviceProcAddr = vkGetDeviceProcAddr;
allocInfo.pVulkanFunctions = &func;
//add other stuff to allocInfo and pass it to vmaCreateAllocator()