[4.7.1] Vulkan Buffer: Out of Device Memory
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Ghost Prototype
- Posts: 185
- Joined: Sun May 19, 2013 12:22 pm
- Location: Philadelphia
[4.7.1] Vulkan Buffer: Out of Device Memory
I used Nash's PDA starter kit for replicating this crash.
viewtopic.php?f=105&t=65849
Opening the PDA and leaving it open for about 30 seconds will cause GZD to crash with this error "Could not allocate memory for vulkan buffer: out of device memory crash". Is this related to GPU by any mean?
viewtopic.php?f=105&t=65849
Opening the PDA and leaving it open for about 30 seconds will cause GZD to crash with this error "Could not allocate memory for vulkan buffer: out of device memory crash". Is this related to GPU by any mean?
- Attachments
-
- CrashReport.zip
- (40.93 KiB) Downloaded 60 times
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
This sounds very much like a problem that I had with 4.7.0 but I have not seen it since the dev builds were changed to fix it and I can't make it happen with 4.7.1 either.
Using my own test files and Nash's kit, I can have the PDAs open for several minutes and not experience a crash. I've ran it with the garbage collector stats on screen it there doesn't seem to be a problem there.
So I'm not sure why this is crashing for you. I was going to suggest that you'd inadvertently run it with 4.7.0 but I see from your crash report that isn't the case.
Using my own test files and Nash's kit, I can have the PDAs open for several minutes and not experience a crash. I've ran it with the garbage collector stats on screen it there doesn't seem to be a problem there.
So I'm not sure why this is crashing for you. I was going to suggest that you'd inadvertently run it with 4.7.0 but I see from your crash report that isn't the case.
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Seems to be an AMD-only thing. I am also unable to repro it with PDA Kit 1.2 and GZDoom 4.7.1.
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Perhaps AMD cards have less memory available for vertex buffers?
Edit: looking at the memory stats at gpuinfo.org for that particular GPU makes it a bit more mysterious. It reports 3 different vulkan heaps: two that are 8 gigs in size and one that is 256 megabytes.
F2DVertexBuffer specifies that the memory is not static, which makes VKBuffer::SetData require a memory heap that is both host visible and device local. That means heap #2 that is only 256 MB in size. Now the question is, does the GC kick in before that?
Edit: looking at the memory stats at gpuinfo.org for that particular GPU makes it a bit more mysterious. It reports 3 different vulkan heaps: two that are 8 gigs in size and one that is 256 megabytes.
F2DVertexBuffer specifies that the memory is not static, which makes VKBuffer::SetData require a memory heap that is both host visible and device local. That means heap #2 that is only 256 MB in size. Now the question is, does the GC kick in before that?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
AMD does indeed provide only 256 MB of host visible memory. They surely know how to cripple their cards.
The main question should be whether it is necessary to use host visible memory for these static 2D vertex buffers or if the code can be rewritten to use another type of memory.
A large portion of this heap is already used for the persistently mapped buffers so using it for convenience for all buffers may not be such a good idea.
The main question should be whether it is necessary to use host visible memory for these static 2D vertex buffers or if the code can be rewritten to use another type of memory.
A large portion of this heap is already used for the persistently mapped buffers so using it for convenience for all buffers may not be such a good idea.
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Unless I am missing something, those vertex buffers used by this feature does not have to pass in false when calling SetData. If the hardware layer tells the vulkan backend the buffer is static then it will create a transfer buffer in system memory (heap #1 for this card) and then transfer it to a vertex buffer in video memory (heap #0).
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Correct. These buffers are supposed to be static. Considering that they can be longer lived they really should not occupy such a limited resource as host visible memory.
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
I created a PR fix for this: https://github.com/coelckers/gzdoom/pull/1497. Note that since I don't own an AMD card I can't actually confirm it fixed it. It should though, as this will make it use a different heap for the 2D drawer.
- Ghost Prototype
- Posts: 185
- Joined: Sun May 19, 2013 12:22 pm
- Location: Philadelphia
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Tested with the latest dev build. Can confirm it's fixed. I left the menu opened for 5+ min and no crash. Things will occasionally lag when the GC starts doing its cleaning (I don't actually know what is going on but i'm assuming it's that) but definitely no crash. Thank you so much for fixing this.
Last edited by Ghost Prototype on Wed Oct 27, 2021 12:47 pm, edited 1 time in total.
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Huh, strange... I thought that was already fixed...Ghost Prototype wrote:Things will occasionally lag when the GC starts doing its cleaning
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
You cannot really fix that. When the GC starts its cleanup it needs to free a lot of objects and that costs time. Depending on the type of objects it can indeed cause some lag if taking them down is a non-trivial affair.
- marco.nadal.75
- Posts: 32
- Joined: Sat Oct 14, 2017 6:24 am
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
I'm using 4.7.1 dev build and this bug crashes the game
https://devbuilds.drdteam.org/gzdoom/gz ... 49a0d8f.7z
I'm using Project Brutality Custom Build from this link:
https://telegra.ph/Project-Brutality-Custom-Build-03-05
When I am running PBCB with OpenGL API, the .m3D and voxel models are rendered incorrectly. This is due to AMD no longer fixing OpenGL bugs or paying any attention to it, since OpenGL is obsolete and is being supplanted by Vulkan.
Has a novel look because of the reshade.me filters that were chosen. Plays well, has some screen tearing.
When I run PBCB with Vulkan API, the 3D and voxel models are rendered correctly. The reshade.me filters are disabled, but framerate is good and it plays great, until it crashes with the Vulkan Buffer: Out of Device Memory.
I thought the Vulkan bug was fixed in the 4.7.1 dev builds?
Any suggestions what I could try?
I'm updating my AMD drivers from 22.2.3 to 22.3.1. ATM
PBCB is a really nice mod pack, I don't mind spending some time to troubleshoot it.
Thanks for your time reading this, and I look forward to your input!
https://devbuilds.drdteam.org/gzdoom/gz ... 49a0d8f.7z
I'm using Project Brutality Custom Build from this link:
https://telegra.ph/Project-Brutality-Custom-Build-03-05
When I am running PBCB with OpenGL API, the .m3D and voxel models are rendered incorrectly. This is due to AMD no longer fixing OpenGL bugs or paying any attention to it, since OpenGL is obsolete and is being supplanted by Vulkan.
Has a novel look because of the reshade.me filters that were chosen. Plays well, has some screen tearing.
When I run PBCB with Vulkan API, the 3D and voxel models are rendered correctly. The reshade.me filters are disabled, but framerate is good and it plays great, until it crashes with the Vulkan Buffer: Out of Device Memory.
I thought the Vulkan bug was fixed in the 4.7.1 dev builds?
Any suggestions what I could try?
I'm updating my AMD drivers from 22.2.3 to 22.3.1. ATM
PBCB is a really nice mod pack, I don't mind spending some time to troubleshoot it.
Thanks for your time reading this, and I look forward to your input!
- Attachments
-
- CrashReport.zip
- (128.33 KiB) Downloaded 21 times
- Major Cooke
- Posts: 8175
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Please make a new thread.
- Ghost Prototype
- Posts: 185
- Joined: Sun May 19, 2013 12:22 pm
- Location: Philadelphia
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
As of using the 4.8 dev build. I no longer have this crash.
- marco.nadal.75
- Posts: 32
- Joined: Sat Oct 14, 2017 6:24 am
Re: [4.7.1] Vulkan Buffer: Out of Device Memory
Because of Necroposting or because dev builds have reached version 4.8.1?Major Cooke wrote:Please make a new thread.