VulkanMemoryAllocator icon indicating copy to clipboard operation
VulkanMemoryAllocator copied to clipboard

undefined symbol: 'vkGetDeviceBufferMemoryRequirements' and 'vkGetDeviceImageMemoryRequirements'

Open FuXiii opened this issue 2 years ago • 7 comments

I use VScode+clang+mingw32-make on Windows system

  1. I download project from source
  2. use CMake GUI set build with "MinGW Makefile", click configure and generate
  3. then run mingw32-makeand mingw32-make install
  4. then use the vma lib in my project
  5. the CmakeLists.txt:
add_library(vulkan STATIC IMPORTED)
set_target_properties(vulkan PROPERTIES IMPORTED_LOCATION F:/VulkanSDK/1.2.135.0/Lib/vulkan-1.lib)

add_library(vma STATIC IMPORTED)
set_target_properties(vma PROPERTIES IMPORTED_LOCATION E:/Lib/VulkanMemoryAllocator-master/VulkanMemoryAllocator-master/build/install/lib/libVulkanMemoryAllocator.a)
target_link_libraries(Turbo PUBLIC vulkan vma)

6.then build the project, the output: image

How do I fix this problem

FuXiii avatar Apr 09 '22 06:04 FuXiii

While I rebuild the vma lib, inexplicably succeeded... What???? ˃̣̣̥᷄⌓˂̣̣̥᷅

FuXiii avatar Apr 09 '22 06:04 FuXiii

That new functions come from Vulkan 1.3. Please make sure all your source files use Vulkan headers form the same SDK version. Might be related to #247

adam-sawicki-a avatar Apr 11 '22 08:04 adam-sawicki-a

That new functions come from Vulkan 1.3. Please make sure all your source files use Vulkan headers form the same SDK version. Might be related to #247

Got the same problem. Strange, because I created a CMake interface library which provides the VMA include directory (with some other things) and other projects depend on this lib (which in fact depends on the found Vulkan::Vulkan). This means that the same SDK (1.3.211.0) is used in my case. (I don't know if it's a complete bullshit, but can it happen that my video card / driver does not support Vulkan 1.3?)

It is easy to fix tho (as you've suggested in your comment), I just had to define the VMA_VULKAN_VERSION by hand:

#define VMA_VULKAN_VERSION 1000000

In my opinion, this version selection logic could be forced by the user of the lib instead of using defaults. The reason is that even if Vulkan 1.3 is available with the SDK, the target platform might be 1.2, 1.1 or even 1.0. Also, a helper macro could be useful, something like VMA_MAKE_VULKAN_VERSION(VK_API_VERSION_1_0)

csisy avatar May 10 '22 18:05 csisy

I just add VMA in to my project, like this:

image and in the project root CMakeLists.txt:

...
add_subdirectory(./thirdparty)
...

and the ./thirdparty/CMakeLists.txt

...
add_subdirectory(./VulkanMemoryAllocator)
...

then this issue fixed.

you can watch this: https://www.youtube.com/watch?v=ED-WUk440qc&list=PLalVdRk2RC6o5GHu618ARWh0VO0bFlif4&index=3

for detail you can get my project at: https://github.com/FuXiii/Turbo

Hope them can help you

FuXiii avatar May 11 '22 04:05 FuXiii

maybe you must use Vulkan 1.3 to compile VMA ┑( ̄Д  ̄)┍

FuXiii avatar May 11 '22 04:05 FuXiii

For others with this issue: All my API versions were set to 1.3 (instance creation and vma creation). However, my GPU (1070) only supported Vulkan 1.2. Updating my GPU drivers resolved the issue.

paulburgess1357 avatar Jun 01 '22 04:06 paulburgess1357

I've added documentation regarding selecting Vulkan version on compile time as well as runtime.

The idea for macro VMA_MAKE_VULKAN_VERSION(VK_API_VERSION_1_0) looks great. I tried to implement it. Unfortunately, this is not possible, as Vulkan macros that define or extract Vulkan API version use integer arithmetic, type casting etc. that is not supported during preprocessing, while it is needed inside VMA in lines like this:

#if VK_KHR_buffer_device_address || VMA_VULKAN_VERSION >= 1002000

So I decided to leave VMA_VULKAN_VERSION to be defined manually by the user.

adam-sawicki-a avatar Jun 14 '22 14:06 adam-sawicki-a