microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.33k stars 6.45k forks source link

[vulkan-validationlayers] ErrorOutOfHostMemory when run #42128

Open InfiniteLoopGameDev opened 1 week ago

InfiniteLoopGameDev commented 1 week ago

Description When running a vulkan project that loads validation layers, I am unable to successfully create an instance due to an ErrorOutOfHostMemory exception

Environment

To Reproduce Steps to reproduce the behavior:

  1. ./vcpkg install vulkan-validationlayers
  2. Set VK_ADD_LAYER_PATH=@layer_path@
  3. Run program with vulkan validation layers
  4. See error vk::createInstance: ErrorOutOfHostMemory

Expected behavior The program successfully loads the validation layers

Additional context Using system installed Vulkan SDK the error is not present on the same build (running the exe directly without setting VK_ADD_LAYER_PATH)

dg0yt commented 1 week ago

Set VK_ADD_LAYER_PATH=@layer_path@

What did you actually do in this step?

InfiniteLoopGameDev commented 1 week ago

Set VK_ADD_LAYER_PATH=@layer_path@

What did you actually do in this step?

I set as VK_ADD_LAYER_PATH=vcpkg_installed\x64-mingw-dynamic\bin I have also set it to the absolute path with the same result

FrankXie05 commented 1 week ago

@InfiniteLoopGameDev Could you please try x64-windows?

InfiniteLoopGameDev commented 1 week ago

@FrankXie05 I have installed visual studio and ran my project with it. The triple was set to x64-windows and the same errror is occurring

InfiniteLoopGameDev commented 1 week ago

I am able to confirm that it is specifically vulkan-validationlayers; by replacing the DLL in vcpkg_installed\x64-mingw-dynamic\bin by the one that is provided by the vulkan SDK without actually installing the DLL.

I have also tried using the debug version by setting it to VK_ADD_LAYER_PATH=vcpkg_installed\x64-mingw-dynamic\debug\bin. That gave me the following output:

mimalloc-redirect: error: unable to find target module.
mimalloc-redirect: warning: standard malloc is _not_ redirected! -- using regular malloc/free. (v1.1c)
mimalloc: assertion failed: at "C:/Users/<username>/.vcpkg-clion/vcpkg/buildtrees/mimalloc/src/v2.1.7-7cda0129ba.clean/src/options.c":264, mi_add_stderr_output
  assertion: "mi_out_default == NULL"
smile-zyk commented 1 week ago

I'm having the same issue when i use mingw

InfiniteLoopGameDev commented 1 week ago

I'm having the same issue when i use mingw

@smile-zyk Have you tried with Visual Studio / x64-windows? If, so does it give you the same issue?

InfiniteLoopGameDev commented 5 days ago

After much trouble of trying to get WSL2 to work. I have successfully compiled and ran my code with WSL2. So the problem seems to come from Windows

InfiniteLoopGameDev commented 5 days ago

I also tried x64-windows-static which also worked (the test on WSL was x64-linux-dynamic) but x64-mingw-static doesn't. I now don't know what is happening. It might be that vulkan-validationlayers might not be able to find its dependencies at runtime on Windows host

dg0yt commented 4 days ago

but x64-mingw-static. I now don't know what is happening.

Maybe https://github.com/microsoft/mimalloc/issues/542? There is "redirect: unable to find module".

dg0yt commented 4 days ago

BTW does x64-mingw-dynamic work?

InfiniteLoopGameDev commented 4 days ago

BTW does x64-mingw-dynamic work?

Sadly, No