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 1 Guest 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

Silken Healer

Yeah I turn the monitor on manually with a button on the back I dont time it but I wanna get back to Lix ASAP so I assume its only 2 secs or so

Silken Healer

Quote from: Simon on December 10, 2024, 06:12:01 PMDownload: 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 in my unstable repo.

-- Simon

When I open that I get a bunch of red X errors

"The code execution cannot proceed because allegro something.dll was not found. Reinstalling the program may solve the problem"

btw do I need to put that in a folder? I know Lix is self-contained. It's not gonna create a bunch of folders in a directory that already has stuff in it on the first time I run it right?

Forestidia86

Quote from: Silken Healer on December 11, 2024, 03:59:19 PMbtw do I need to put that in a folder? I know Lix is self-contained. It's not gonna create a bunch of folders in a directory that already has stuff in it on the first time I run it right?

You have to put it in your Lix folder where the other lix.exe is. Lix is dependant on Allegro5 dlls which are part of the Lix distribution (and needs other files of the distro as well).

Silken Healer


Simon


Silken Healer


Simon

Thanks for testing!

All right, I'll earmark this for the next release 0.10.28.

-- Simon

Blitz

#22
The Monitor Turns back on instanly but Lix Just Crashes it also immediately Crashes Lix seams to hate every program itsept it self and the hz change with the ticks so Lix crashes randomly when it hits an other hz programm
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel

Simon

Sorry, I have no idea what you're saying.

Please terminate your sentences with a period.

Too many things are "it". Please replace the many "it"/"IT" with "Lix", or with the name of your other program.

Did you run the experimental version of Lix (that I attached in reply #14), or did you run the stable version of Lix?

What exactly changes refresh rates ("Hz")? Monitors? Lix? Other applications?

-- Simon

Blitz

Sorry
Quote from: Simon on December 19, 2024, 11:30:43 AMWhat exactly changes refresh rates ("Hz")? Monitors? Lix? Other applications? I mean everything as long as the fps or ticks drops Lix crashes

-- Simon
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel

Blitz

and the version... yeah no...



this is the full message:Lix version:  0.10.27
Session date: 2024-12-19 17:51:00
    49.73 Skipping automatic savestate at 40 ticks.
    49.74     -> Out of video memory. Can't create bitmap of size 672x400 with flags 5120.
    50.41 Skipping automatic savestate at 50 ticks.
    50.41     -> Out of video memory. Can't create bitmap of size 672x400 with flags 5120.
    51.12 src\graphic\internal\getters.d:49:
    51.12 Can't find unrecolored spritesheet at: data/images/lixsprites.png. The spritesheet is required for physics because the number of sprites per row affect worker cycles. Is your Lix installation broken?
    51.16 0x00007FF71772D264
0x00007FF71772CFA4
0x00007FF71772886D
0x00007FF71771D5F1
0x00007FF7176EE804
0x00007FF71762C37C
0x00007FF7175E9F43
0x00007FF71758C234
0x00007FF71758237A
0x00007FF717582744
0x00007FF7175828EC
0x00007FF7175FB379
0x00007FF7175FC396
0x00007FF7176025B3
0x00007FF717603A04
0x00007FF7175C331A
0x00007FF7175C2B39
0x00007FF7175C1CEB
0x00007FF7175C4674
0x00007FF7175C3E49
0x00007FF7176F3C45
0x00007FF7176F38D1
0x00007FF7176F3BA3
0x00007FF71773B07A
0x00007FFA9BED7374 in BaseThreadInitThunk
0x00007FFA9DAFCC91 in RtlUserThreadStart
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel

Forestidia86

This happens for me if I Win+L (equivalent to monitor turn off) immediately after starting the first level after opening Lix (with exp. version).

Simon

Blitz, thanks for the logs and the screenshot! I know exactly what's going on now. Forestidia, thanks for the straightforward reproduction.

Lix recolors the spritesheets only on demand (lazy loading). And it looks like Lix crashes consistently when the monitor is off while Lix wants an image file from disk for the first time. Both a savestate and a loaded image allocate a new VRAM bitmap.

The obvious situation for new VRAM bitmaps during play was the automatic savestate. The expiremental version skips this savestating when the VRAM allocation fails, and this looks good, and I'll release this in 0.10.28.

I can also look into changing the times when Lix loads new files from disk. E.g., I can anticipate what will be needed (spritesheets mostly), and move this loading to the start of the level, or even earlier. But I'll release 0.10.28 today without this.

-- Simon

Blitz

In the middle of this year I sent you Simon a crash report could it be that this problem caused this on because before I had the blue screen there was a crash report in Lix and then it closed and I guess that the mouse cursor clicked which crashed Lix but it couldn't create a report because I didn't have another program open and Windows hates something like that when it has its head is not enforced, so there was a critical error that caused the Blue screen and no crash report Silken would it Make sense if it did that?
Tom Wolf :lix-evil:
 https://youtube.com/@blitzlix?si=EE0pCPusomuqjkRp. My Youtube channel