vkDOOM3 icon indicating copy to clipboard operation
vkDOOM3 copied to clipboard

VK_ERROR_OUT_OF_DEVICE_MEMORY when starting

Open wodim opened this issue 6 years ago • 16 comments

Black screen and then...

----- Initializing Render Shaders -----
VK: VK_ERROR_OUT_OF_DEVICE_MEMORY - vkAllocateMemory( vkcontext.device, &memoryAllocateInfo, NULL, &m_deviceMemory )

This is using v0.93.0 on Windows. What could be wrong?

wodim avatar Feb 16 '19 14:02 wodim

I'm also experiencing this problem my GPU is a AMD RX 570 8GB, don't know if this is the problems but VRAM size on the console shows as -1.

HMart81 avatar Feb 18 '19 15:02 HMart81

Try to run with r_vkDeviceLocalMemoryMB set to higher value than default one (128), e.g. Doom3BFG.exe +set r_vkDeviceLocalMemoryMB 256

It works for me, but in my case the memory seems to be exhausted earlier (when the depth buffer is being created). This problem is related to VK allocator default block size for device local allocations.

gwizdz avatar Mar 07 '19 17:03 gwizdz

Thanks for the hint but in my case it unfortunately didn't worked.

HMart81 avatar Mar 15 '19 15:03 HMart81

Same issue on a AMD Radeon Vega 56, Vulkan API v1.1.101 , Windows 10.

Using parameter +set r_vkDeviceLocalMemoryMB with any value from 128 doubling through until reaching 8192 doesn't change the behaviour. Game doesn't startup.

Tried with vkdoom3 0.90 - 0.93.

Not sure how I could manually test older Vulkan versions without downgrading my graphics driver. Or if trying that out would even make sense at all...

Another update: I just tried several vulkan-1.dll runtime files put inside of the doom binary directory, old ones from ~ mid 2017 (to best match date of latest vkdoom release) and they definitely register during launch since I get a different error when i use the wrong one of the 32bit & 64bit ones in the VulkanRT package from their website. But the original error (VK_ERROR_OUT_OF_DEVICE_MEMORY) is the same for all 4 versions I tried. I suspect it has something to do with AMD driver vulkan interface. I am on AMD driver version 19.4.1 which has a "Vulkan Driver Version 2.0.78" ... an internal versioning of their driver<->VulkanAPI interface I imagine

Redundanz avatar Apr 17 '19 16:04 Redundanz

I also see this issue on an AMD RX 560. Does an API Dump help? VK_LAYER_LUNARG_api_dump.txt

toehead2001 avatar Aug 28 '19 04:08 toehead2001

Yeah I have this issue too, no idea why my radeon vii is failing on a 64MB allocate. Doom2016 runs great.

LWSS avatar Sep 28 '19 18:09 LWSS

Wait fellas, just use the amd allocator and it works.

LWSS avatar Sep 28 '19 19:09 LWSS

@LWSS sry. what did you exactly do? I dont unterstand

kleinermob avatar Oct 14 '19 15:10 kleinermob

while ur compiling it, there's a definition to use the amd allocator

LWSS avatar Oct 14 '19 17:10 LWSS

I'm using the pre-compiled exes, i'm not a coder so I don't know how to compile them.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Sem vírus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

LWSS [email protected] escreveu no dia segunda, 14/10/2019 à(s) 18:28:

while ur compiling it, there's a definition to use the amd allocator

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DustinHLand/vkDOOM3/issues/22?email_source=notifications&email_token=ALMJ2GM7ZBVENUIIXJINRDDQOST3HA5CNFSM4GX4CAG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBFWAKY#issuecomment-541810731, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALMJ2GPMXR5R7MUB477ODJDQOST3HANCNFSM4GX4CAGQ .

HMart81 avatar Oct 17 '19 20:10 HMart81

Wait fellas, just use the amd allocator and it works.

Can you expand on this a bit please?

VVSRwastaken avatar Mar 08 '20 10:03 VVSRwastaken

@HMart81 @VVSRwastaken compiling should be pretty straightforward if you follow "Building" instructions on the readme.md of this. in visual studio community you can then select the configuration for using amd allocator during before compile starts.

Redundanz avatar Mar 08 '20 16:03 Redundanz

@HMart81 @VVSRwastaken compiling should be pretty straightforward if you follow "Building" instructions on the readme.md of this. in visual studio community you can then select the configuration for using amd allocator during before compile starts.

Thank you for reminding me to read the instructions but the problem is not about building the solution; it's the "select the configuration for using amd allocator during before compile starts" part that I need clarification on, because I see nothing regarding this in my configuration manager and there's no "allocator" mentioned the readme. If I take a look at the "Allocator_VK.cpp" code I see something related to "ID_USE_AMD_ALLOCATOR" but I have no clue what to do about it and since you haven't mentioned anything about the code I guess I'm looking at the wrong way

VVSRwastaken avatar Mar 08 '20 21:03 VVSRwastaken

if you look at the VStudio project files in ..vkDOOM3/blob/master/neo/ *.vcxproj the "Engine.vcxproj" has a conditional configuration property for including amd-memory-allocator vma.cpp (which then will include vma.h for the declarations) , somewhere in lines 140+. this configuration should be exposed in the project's property pages in VS. if not, you may have to manually set the property: https://docs.microsoft.com/en-ie/cpp/build/reference/vcxproj-file-structure?view=vs-2019 https://docs.microsoft.com/en-ie/cpp/build/reference/property-pages-visual-cpp?view=vs-2019

Redundanz avatar Mar 11 '20 21:03 Redundanz

if you look at the VStudio project files in ..vkDOOM3/blob/master/neo/ *.vcxproj the "Engine.vcxproj" has a conditional configuration property for including amd-memory-allocator vma.cpp (which then will include vma.h for the declarations) , somewhere in lines 140+. this configuration should be exposed in the project's property pages in VS. if not, you may have to manually set the property: https://docs.microsoft.com/en-ie/cpp/build/reference/vcxproj-file-structure?view=vs-2019 https://docs.microsoft.com/en-ie/cpp/build/reference/property-pages-visual-cpp?view=vs-2019

Is this the line you're referring to?

<ClCompile Include="renderer\Vulkan\vma.cpp"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader> </ClCompile>

Looking at your first reference this should be set correctly but I dont get the other part; how is this vma.cpp a configuration file? I'm looking through the engine property pages but nothing points at a .cpp file being some sort of configuration

By the way I'm using VS2019 (with 2015 assets to load the project) so maybe there's something different that I can't figure out

VVSRwastaken avatar Mar 13 '20 21:03 VVSRwastaken

Uncommenting #define ID_USE_AMD_ALLOCATOR in qvk.h solved the problem, I had the suspect you had no clue what you were talking about and I guess I was right

VVSRwastaken avatar Mar 28 '20 20:03 VVSRwastaken