VK_ERROR_OUT_OF_HOST_MEMORY from vk.AllocateMemory
- Niko of Death
- Topic Author
Failed to initialize Vulkan runtime environment on runtime [pointer]
I finally decided to try and see what was causing this myself (assuming that this error was what is causing reshade not to work), and (through a lot of trial and error) was able to figure out the breaking point.
When vkCreateSwapchainKHR calls on_init(*pSwapchain, *pCreateInfo, hwnd), create_image() is called 3 times, once for the back buffer, once for the depth stencil, and once for the empty depth image. The first run (for the back buffer) works fine, however, on the next run, at
check_result(vk.AllocateMemory(_device, &alloc_info, nullptr, &mem)) VK_NULL_HANDLE;
Various variables I collected to try and determine what the issue was (obviously variable from run to run)
back buffer AllocateMemory (VK_SUCCESS):
_device = 000002A437EBB800
&alloc_info = 000000DE4D5AD970
alloc_info.sType = 5
alloc_info.pNext = 000000DE4D5AD990
alloc_info.allocationSize = 9437184
alloc_info.memoryTypeIndex = 0
_memory_props.memoryHeaps.size = 8321499136
_memory_props.memoryTypeCount = 4
_memory_props.memoryType.propertyFlags VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 1
&mem = 000000DE4D5AD9C8
_device = 000002A437EBB800
&alloc_info = 000000DE4D5AD970
alloc_info.sType = 5
alloc_info.pNext = 000000DE4D5AD990
alloc_info.allocationSize = 2555912
alloc_info.memoryTypeIndex = 0
_memory_props.memoryHeaps.size = 8321499136
_memory_props.memoryTypeCount = 4
_memory_props.memoryType.propertyFlags VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 1
&mem = 000000DE4D5AD9C8
Please Log in or Create an account to join the conversation.
- Niko of Death
- Topic Author
Windows 10 1909
RX 580 (20.1.3 drivers)
i5 3570k
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- Niko of Death
- Topic Author
It's only this specific allocation, commenting out the allocation (or just running it on its own without the VK_SUCCESS check) gets it to work (i.e. log file shows a successful runtime return), but the game crashes, aftercrosire wrote: Is it this specific allocation fails or does it just generally fail after a certain amount of allocations (e.g. does the next allocation still fail if you comment this one out)? Is this true everywhere, including the test app (Debug App target in Visual Studio), or just specific games?
Loading image files for textures ...
Successfully loaded "DisplayDepth.fx".
It's the case for the games I've tested, which are No Mans Sky, Doom 2016, RAGE 2.
Using the debug app, I get an assertion failure earlier:
File: source\dll_main.cpp
Line: 549
Expression: res == VK_SUCCESS || res == VK_SUBOPTIMAL_KHR
Exception thrown at 0x0000000000000000 in ReShade64.exe: 0xC0000005: Access violation executing location 0x0000000000000000.
Please Log in or Create an account to join the conversation.
- Niko of Death
- Topic Author
Please Log in or Create an account to join the conversation.
- crosire
The allocation failing sounds like a driver bug. This particular error code should not be returned under normal behavior. You can try this: github.com/crosire/reshade/commit/5e72f0...c9b05f22395540cfd2fc and hope that the driver bug is not triggered with that usage flag removed (which was superflous anyway).
Please Log in or Create an account to join the conversation.
- Niko of Death
- Topic Author
No luck, unfortunately. Assuming it is a driver bug, it's strange that it has both persisted throughout countless driver updates (I've been trying to use reshade in vulkan since the support was first pushed to master) and seemingly not cropped up for others with the same graphics card. I've even done multiple clean installs. Also, I do still have the Vulkan SDK installed (since it was needed to compile reshade at one point), is there a specific version needed? I have 1.1.114.0.crosire wrote: Debug app is failing on device creation because you are missing the Vulkan SDK most likely and it's trying to pull in a couple of debugging layers that are part of that SDK.
The allocation failing sounds like a driver bug. This particular error code should not be returned under normal behavior. You can try this: github.com/crosire/reshade/commit/5e72f0...c9b05f22395540cfd2fc and hope that the driver bug is not triggered with that usage flag removed (which was superflous anyway).
Is there anywhere to go from here? If it helps, here's my vulkaninfo readout: pastebin.com/DxWpiRc3
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- Niko of Death
- Topic Author
Please Log in or Create an account to join the conversation.