Crash when out of video memory

Moderator: GZDoom Developers

User avatar
theleo_ua
Posts: 165
Joined: Sun Feb 07, 2016 11:38 am
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Ukraine

Crash when out of video memory

Post by theleo_ua »

Crash when out of video memory

Software:
GZDoom 4.11.1 x64
Win10 Professional with latest updates on 1 OCT 2023
AMD Software: Adrenain Edition v2022.1130.1413.1936

Hardware:
Laptop ASUS ROG Strix GL702ZC-GC189R (90NB0FV1-M02740) Black
AMD Ryzen 7 1700 (3.0 - 3.7 GHz)
RAM 24 GB
AMD Radeon RX 580, 4 GB
(please tell what other details you need about hardware, for example I'm using external 32 inch 2k monitor, but gzdoom is in windowed mode with 1280x960 resolution)

Mods:
Hexen - Rebirth of Cronos v1.0
https://www.moddb.com/mods/hexen-rebirt ... cronos-v10


Steps:
1) Run GZDoom with hexen iwad and Rebirth of Cronos pwads:
gzdoom.exe -config gzdoom-testmod.ini -iwad hexen.wad -file RoCMaps.wad RebirthOfCronos_1.pk3 RebirthOfCronos_2.pk3 +set sv_cheats 1
2) Type in console:
skill 4
hxvisit 01
3) wait for map load
4) Type in console:
god
noclip
5) walk in map01 with noclip to see every area in it (to load most of the textures to memory)
6) Type in console:
hxvisit 02
7) wait for map load

Actual result: Error message: Could not create vulkan image: out of device memory
https://i.ibb.co/Jdz6kq9/out-of-memory.png

Expected result: no errors, map is playable

NOTE: if, for some reason, you cannot reproduce it with current steps (for example you have 6 or more GB of VRAM), try next:
1) repeat steps 2-7 for hxvisit 03, 04, 05 and till 31, and for you it will crash for example on map05
2) if this still doesnt work, try to turn on xBRZ6x and other options which will increase memory usage, so it will be easier to reproduce

NOTE2: my gzdoom INI config file: https://u.pcloud.link/publink/show?code ... VVxXTS9R3X
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: Crash when out of video memory

Post by dpJudas »

I'm afraid there isn't much that can be done here. GZDoom (and its vulkan backend) is built around an assumption that there is memory enough to load its textures. While that could be addressed, it isn't exactly a 5 minute thing to do. If you are getting this due to using an upscaler, you'll have to choose one that upscales less.
User avatar
theleo_ua
Posts: 165
Joined: Sun Feb 07, 2016 11:38 am
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Ukraine

Re: Crash when out of video memory

Post by theleo_ua »

dpJudas wrote: Mon Oct 16, 2023 6:43 pm I'm afraid there isn't much that can be done here. GZDoom (and its vulkan backend) is built around an assumption that there is memory enough to load its textures. While that could be addressed, it isn't exactly a 5 minute thing to do. If you are getting this due to using an upscaler, you'll have to choose one that upscales less.
No, I reproduced this will all upscalers turned off (you can check my INI config from description). I wrote about upscaler only for situation, when gzdoom devs cannot reproduce it because they have a lot of memory on their hardware

About "there isn't much that can be done here" - please check my conversation with Rachael there: viewtopic.php?p=1246185#p1246185

I saw, that starting from 4.11.1, GZDoom dev team decided to pay less attention to opengl, considering that users will use vulkan instead. So I asked, what to do in situations like my, when I used opengl instead of vulkan - just to workaround "out of memory" error and play mods like Rebirth or HHMIX without any problem
User avatar
Rachael
Posts: 13716
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Crash when out of video memory

Post by Rachael »

Yes I did say report it because - ultimately this is an issue that is on the hit list, but as dpJudas said it's not a 5 minute job, and I am pretty sure we don't have anyone right now who is willing to address it. But having an open thread on the issue gives attention to the issue for other potential API programmers who may become interested in the project, however unlikely that may be. But - having the report does not guarantee a resolution, I am sorry. In this case, it's a wish list item.

One of the things we've been needing in GZDoom is a proper threaded texture fetching and eviction system, something that can help keep GZDoom's RAM and VRAM usage somewhat low as textures leave the scene - but again, that's also a wish list item, and not something we have the people who can implement it right now.
User avatar
theleo_ua
Posts: 165
Joined: Sun Feb 07, 2016 11:38 am
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Ukraine

Re: Crash when out of video memory

Post by theleo_ua »

Rachael wrote: Mon Oct 16, 2023 8:24 pm Yes I did say report it because - ultimately this is an issue that is on the hit list, but as dpJudas said it's not a 5 minute job, and I am pretty sure we don't have anyone right now who is willing to address it. But having an open thread on the issue gives attention to the issue for other potential API programmers who may become interested in the project, however unlikely that may be. But - having the report does not guarantee a resolution, I am sorry. In this case, it's a wish list item.

One of the things we've been needing in GZDoom is a proper threaded texture fetching and eviction system, something that can help keep GZDoom's RAM and VRAM usage somewhat low as textures leave the scene - but again, that's also a wish list item, and not something we have the people who can implement it right now.
Yes, I understand that this is not an easy task and require people with wish and knowledge. My initial point was, that for now I already have an easy workaround: I just turn on OpenGL and problem automatically solved for me. The bad thing is that this will not be good workaround for future versions of GZDoom, because some features will become deprecated for OpenGL, as I understand
Professor Hastig
Posts: 248
Joined: Mon Jan 09, 2023 2:02 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Crash when out of video memory

Post by Professor Hastig »

Rachael wrote: Mon Oct 16, 2023 8:24 pm One of the things we've been needing in GZDoom is a proper threaded texture fetching and eviction system, something that can help keep GZDoom's RAM and VRAM usage somewhat low as textures leave the scene - but again, that's also a wish list item, and not something we have the people who can implement it right now.

It isn't really helped by the lack of availability of some pre-made library for this stuff, so it all has t be implemented from scratch. Either I'm too dumb to look for the right keywords or no such thing exists on Github.
There's tons of cache libraries but all I found make the same mistake and do not allow adding some weight property to an item, so a 1024x1024 texture would have the same impact on the decision making than a 16x16 texture, which is quite useless for any sort of caching, actually.

I'm a bit surprised, though. How can a 4GB card run out of memory with Doom, unless using hi-res textures?
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: Crash when out of video memory

Post by dpJudas »

I assume that RebirthOfCronos uses a lot of textures or other assets that consumed the memory.

The vulkan backend in some situations uses a bit more memory than OpenGL does due to its way of keeping resources in memory until a rendered frame has completed. If it finished all work on the GPU and flushes the deleted resources before filling the cache on map load then maybe this situation would not happen for this particular map and GPU. Ultimately though, that just raises the limit for when it will happen.

OpenGL generally doesn't crash here because it swaps textures out to CPU memory in situations like this.
User avatar
theleo_ua
Posts: 165
Joined: Sun Feb 07, 2016 11:38 am
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Ukraine

Re: Crash when out of video memory

Post by theleo_ua »

Professor Hastig wrote: Mon Oct 16, 2023 11:49 pm I'm a bit surprised, though. How can a 4GB card run out of memory with Doom, unless using hi-res textures?
Hi-res textures, yes. Same for my HHMIX mod, it has a lot of hi-res content. And sometimes, when out of memory, it will not crash GZDoom, but will create video artifacts, here is an example: https://www.youtube.com/watch?v=ETYcL9Q ... t=2h21m53s (watch at 2:21:53)

Please note, that on that video I had GZDoom 4.5.0 x64, Windows 7 Ultimate, AMD Phenom 2 x4 3000 MHz,16 GB RAM, Geforce GTX 770 2GB (latest windows and driver updates for 30 JAN 2021). And yes, sometimes GZDoom crashed on that PC with that mod, and sometimes created video artifacts
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Crash when out of video memory

Post by Major Cooke »

I noticed recently this bug returned as well. I don't play with any extra upscaling or additional textures, it's just standard gameplay.
Kedman
Posts: 1
Joined: Tue Jul 09, 2024 8:58 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Crash when out of video memory

Post by Kedman »

Hello Doom enjoyers!

I know this topic is a little dated, but I have come to solve this problem. I also use an upscaler, and zDoom crashed all the time, so just disable the texture preload option in the display options, so that the game starts. The only problem is that you may have microfreeze. The solution is to then lower your upscale slightly, so you enjoy Doom in HQ. I hope it can be useful ! :D

For information, my current configuration :
Ryzen 5 2600X
Nvidia GeForce 1660 Ti
16Go RAM (2x8Go)
Screen in 1920x1080 100Hz
Professor Hastig
Posts: 248
Joined: Mon Jan 09, 2023 2:02 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Crash when out of video memory

Post by Professor Hastig »

This won't really do much good, ultimately. It only delays the crash. The precacher loads all textures being used in the map, so as you continue playing, more and more textures will be loaded until eventually the RAM gets filled and you get a seemingly random crash somewhere in the map.
d64
Posts: 3
Joined: Thu Jan 06, 2022 2:32 pm

Re: Crash when out of video memory

Post by d64 »

This problem was quite persistent for me when trying to play practically any wad with Project Brutality. I have 32gb of ram and RTX 4070 super with 12gb vram. Still, loading a saved game almost always failed with just 2x upscaling. Problem is solved by disabling upscaling entirely.

Does not add much but just noting issue does not only impact older gpus with less vram.
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: Crash when out of video memory

Post by dpJudas »

There must be more to this crash than simply the upscaler. There's just no way a 2x upscaler would run out of memory with 12 gb vram unless the mod itself is using very very large textures.
d64
Posts: 3
Joined: Thu Jan 06, 2022 2:32 pm

Re: Crash when out of video memory

Post by d64 »

dpJudas wrote:
> There must be more to this crash than simply the upscaler. There's just no
> way a 2x upscaler would run out of memory with 12 gb vram unless the mod
> itself is using very very large textures.

How can I get more info on the crash? The console shows nothing before the error message, and the debug logging options I tried didn't add anything relevant.
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: Crash when out of video memory

Post by dpJudas »

I guess if you give me the complete list of mods you played with and upload a save game I can load (or some instructions on how to end up in the same situation) then maybe I'd be able to see on my computer what GZDoom is using all the memory on. I unfortunately don't think there's any additional info in the crash itself you can give me.

Return to “Vulkan Renderer Bugs”