Crash when Monitor off While Lix Plays Level, Error Box: "Out of VRAM"

Started by Silken Healer, December 03, 2024, 12:17:51 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Silken Healer

Lix Version: Lix 0.10.27
Operating System Version: Windows 10 LTSC 2021 64-bit English-United Kingdom, Version 21H2 OS Build 19044.5131
Description: After opening a level, if your monitor turns off, you will hear an operating system-dependent error message sound. Then, it will display an error message on your operating system (on windows it's with a red X) saying:

QuoteOut of video memory. Can't create bitmap size of 1280x400 with flags 5120.

Lix has crashed at:
src\basics\alleg5.d:26

Details are in the logfile:
user/log.txt

You can then see a portion of the level on the screen with nothing moving, no Lix moving, level not animating, etc. The music will continue to play. Pressing "OK," the X button or ALT+F4 will then close Lix and the error.

(the resolution in the error message will not be the same each time)
Steps to reproduce:
  • Open Lix
  • Open a level
  • Turn off monitor

Screenshots/Recordings: (Attached to forum post)
Expected behaviour: Lix continues to play like normal, ready for when you turn your monitor back on again. If someone in multi-player accidently turns off their monitor, they have to restart the whole game, even if they could turn their monitor on again in 2 secs

Forestidia86

Might be related to Laptop sleep may affect VRAM drawing #416

Stack trace from log.txt for Silken Healer's bug:

Lix version:  0.10.27
Session date: 2024-12-03 01:37:49
   128.24 src\basics\alleg5.d:26:
   128.25 Out of video memory. Can't create bitmap of size 1024x160 with flags 5120.
   128.43 0x0000000140363C77 in d_throwc
0x0000000140002EB9 in basics.alleg5.albitCreateWithFlags at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\basics\alleg5.d(292)
0x00000001400027B7 in basics.alleg5.albitCreate at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\basics\alleg5.d(83)
0x0000000140282FA2 in graphic.torbit.torbit.Torbit.this at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\graphic\torbit\torbit.d(54)
0x0000000140283051 in graphic.torbit.torbit.Torbit.clone at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\graphic\torbit\torbit.d(59)
0x000000014031DFA8 in physics.world.world.MutableHalfOfWorld.copyLandFrom at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\physics\world\world.d(245)
0x000000014031DB43 in physics.world.world.MutableHalfOfWorld.clone at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\physics\world\world.d(188)
0x000000014031A45C in physics.world.cache.LeapfrogPair.saveIntoSpecificFrog at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\physics\world\cache.d(279)
0x000000014031A2BA in physics.world.cache.PhysicsCache.saveIntoPair0ButMaybeBorrowSpaceFromHighestPair at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\physics\world\cache.d(232)
0x0000000140319D7F in physics.world.cache.PhysicsCache.autoSave at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\physics\world\cache.d(178)
0x0000000140269251 in game.nurse.savestat.SaveStatingNurse.considerAutoSavestateIfCloseTo at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\game\nurse\savestat.d(147)
0x0000000140268729 in game.nurse.interact.InteractiveNurse.updateTo at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\game\nurse\interact.d(23)
0x000000014025BD6A in game.core.speed.upd at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\game\core\speed.d(169)
0x000000014025B9F6 in game.core.speed.updatePhysicsAccordingToSpeedButtons at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\game\core\speed.d(84)
0x0000000140254867 in game.core.calc.noninputCalc at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\game\core\calc.d(55)
0x000000014025480B in game.core.calc.implGameCalc at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\game\core\calc.d(44)
0x0000000140258465 in game.core.game.Game.work at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\game\core\game.d(200)
0x00000001402A7BF6 in gui.root.calc at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\gui\root.d(98)
0x00000001402C5095 in mainloop.mainloop.MainLoop.calc_returnsTrueIfWeShouldExitApp at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\mainloop\mainloop.d(87)
0x00000001402C4EA5 in mainloop.mainloop.MainLoop.mainLoop at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\mainloop\mainloop.d(48)
0x00000001402C4DB3 in main.main.__lambda3 at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\main.d(38)
0x000000014034668B in allegro5.system.al_run_allegro.main_runner at C:\Users\....\AppData\Local\dub\packages\allegro\4.0.7+5.2.0\allegro\allegro5\system.d(26)
0x0000000140346655 in allegro5.system.al_run_allegro at C:\Users\....\AppData\Local\dub\packages\allegro\4.0.7+5.2.0\allegro\allegro5\system.d(37)
0x00000001402C4CF9 in D main at C:\Users\....\Downloads\lix-unstable-master011224\lix-unstable-master\src\main.d(35)
0x000000014037FB73 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda2()
0x000000014037F9CF in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014037FACF in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014037F9CF in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014037F8DA in d_run_main2
0x0000000140363BB9 in d_run_main
0x00000001402C4E02 in main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x00000001404260EE in mainCRTStartup
0x00007FF8B3047374 in BaseThreadInitThunk
0x00007FF8B3E5CC91 in RtlUserThreadStart

Blitz

That Bug happens to me to somtimes my Problem is mostly when my RAM or Arbeitsspeicher reaches its max but it schould fix after you reopen lix
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel

Forestidia86

Quote from: Blitz on December 04, 2024, 07:14:10 AMThat Bug happens to me to somtimes my Problem is mostly when my RAM or Arbeitsspeicher reaches its max but it schould fix after you reopen lix

Which version of Lix do you use 32bit or 64bit?

Blitz

I use 64bit but it depends on my version
It happens more if you use 32bit

But did you say that your screen turns off?
It's weird because that shouldn't happen on Windows. But I know Windows well. What I think is do both programs have the same Hz? Because my monitor goes black if I have to separate Hz. It doesn't happen in Windows 11. Windows 10? I still have to look.
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel

Simon

Thanks!

I'll have to ask in the Allegro 5 community if it's even sensible to create video bitmaps while the screen is off. Video bitmaps are attached to Allegro displays, and Allegro displays rely on Windows's screen handling. I create new video bitmaps during play for the internal savestating, to support rewinding in singleplayer and physics recomputation in networked matches.

Blitz, if you get the crash (Lix thinks it's out of VRAM) without turning off the screen, it'll be a separate bug.

-- Simon

Blitz

Have it! so if you open lix and a level now I tried to compare it with an old version I have lix on (new) and then I open a very old lix version from 2014 and because there is no software screen it opens in the hardware screen and then the screen goes black I noticed this because my sound is connected to the screen and then lix (new) crashes my question to you is is your lix screen different to windows? try setting both to the same resolution
Edit: Not only 0.10.27 0.10.26 too
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel

Blitz

Quote from: Simon on December 05, 2024, 06:05:36 PMBlitz, if you get the crash (Lix thinks it's out of VRAM) without turning off the screen, it'll be a separate bug.

--Simon
No it has to do with Hardware and Software screen and Resolution its Hard to explain 
Its a windows 10 thing that your screen goes black its really weird but I can confirm silkens bug and I see why its annoying I personally use this (feature) really often and I think its going to be very annoying if you have two screens with two different resolution and Hz 
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel

Simon

All right, thanks for confirming that you see a bug like Silken sees.

"Its a windows 10 thing that your screen goes black its really weird": I don't know what exactly happens to you. I only know that Windows 10 turns off laptop screens to save power, but that's not what hits you; you're talking about resolution changes and refresh rate changes.

Workaround: Run Lix windowed, not in fullscreen. Or prefer software fullscreen over hardware fullscreen. But you've probably tried this already.

Will it be easier for you to explain it in German?

I haven't yet asked the Allegro 5 devs about a bug like this in Windows 10, or about Allegro 5's behavior (if it's even allowed to allocate new VRAM bitmaps when the screen is off).

-- Simon

Simon

For how long is the monitor off when this bug hits?

If it's for a few seconds, let's say 1-5 seconds, I'll catch the failure and skip the internal savestating. Afterward, the first rewinding will be more expensive, but not overly much so. It would be only a small price to pay.

If it's longer than 10 seconds, I should consider allocating all the VRAM bitmaps for savestating ahead of time.

-- Simon

Silken Healer

Why did you change the title? It's worth me knowing in case it wasn't descriptive enough for future bug reports?

Simon

Added enough text from the error message so that I know which error it is. Sorted the words in order of importance: 1. Crash, 2. Monitor, 3. during play, 4. error text.

Another good sorting is all causes first in chronological order, then all effects.

Another good sorting is all causes first in order of importance, then all effects. ("Monitor off while Lix plays level: Lix crashes with error: Out of VRAM") This is probably even better than what I wrote. The unique feature of this bug is that the monitor turns off. It makes a lot of sense to put that first.



For how long is the monitor off when the bug hits you?

-- Simon

Silken Healer

It's the turning the monitor off that causes the bug, not the length of time. Normally I want to turn it back on as soon as possible

Simon

Right, I expect the crash to happen within a second after the monitor turns off. Lix savestates internally every 10 ticks, which take a total of 2/3 of a second at normal speed.

Sorry, I didn't phrase the question clearly. I meant:

When the monitor turns off and Lix crashes, how long does it take until the monitor is back on? Do you have to switch on the monitor by hand? Does Windows 10 turn the monitor back on?

-- Simon

Simon

Download: Lix executable that can skip automatic savestates

Does this help?

This executable is based on the current 0.10.27. It's a Windows 64-bit executable in release mode. This helps to judge framestepping performance after the monitor is back on.

The idea here is: We skip automatic savestates if you'd get the out-of-VRAM exception. The code is in branch vram-savestates part of master in my unstable repo.

-- Simon