Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

VK_ERROR_OUT_OF_DEVICE_MEMORY when starting #22

Open
wodim opened this issue Feb 16, 2019 · 16 comments
Open

VK_ERROR_OUT_OF_DEVICE_MEMORY when starting #22

wodim opened this issue Feb 16, 2019 · 16 comments

Comments

@wodim
Copy link

wodim commented Feb 16, 2019

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?

@HMart81
Copy link

HMart81 commented Feb 18, 2019

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.

@gwizdz
Copy link
Contributor

gwizdz commented Mar 7, 2019

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.

@HMart81
Copy link

HMart81 commented Mar 15, 2019

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

@Redundanz
Copy link

Redundanz commented Apr 17, 2019

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

@toehead2001
Copy link

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

@LWSS
Copy link

LWSS commented Sep 28, 2019

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

@LWSS
Copy link

LWSS commented Sep 28, 2019

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

@kleinermob
Copy link

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

@LWSS
Copy link

LWSS commented Oct 14, 2019

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

@HMart81
Copy link

HMart81 commented Oct 17, 2019 via email

@VVSRwastaken
Copy link

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

Can you expand on this a bit please?

@Redundanz
Copy link

@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.

@VVSRwastaken
Copy link

@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

@Redundanz
Copy link

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

@VVSRwastaken
Copy link

VVSRwastaken commented Mar 13, 2020

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants