OutOfVramException

Started by SQron188, November 19, 2017, 05:50:35 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.


Simon

#1
Thanks!

This happens when your graphics card can't offer more video memory for internal savestates. Lix is really VRAM-hungry on these large maps. The workaround is to stick to smaller maps. At least you crashed only on this huge map, and not otherwise.

I know of a better algorithm that the Clones developers had for the exact same problem, but it's hard to implement.

If you update to 0.9.2 or 0.9.3, at least you shouldn't crash easily, instead the game will become slower when it can't savestate.

-- Simon

Forestidia86

#2
Only out of curiosity: Does multiplayer need significantly more VRAM than single-player?
The highest VRAM-usage I got shown on Infinitus (8p) (modified to have 999 lix and SI 31) by the program was 250 MB.
For my old outdated integrated laptop graphics card that is in some sense too much to handle but is it for a normal not too outdated graphics card? 

Edit: Just for clarification: It didn't crash for me (in singleplayer where I tested) but I only had 2-4 FPS in the end.
Edit: Tested roughly the same with newer laptop (graphics card from 2013: AMD Radeon HD 8400): maximum VRAM-usage about 203 MB, FPS drops down to about 10.

SQron188

Quote from: Simon on November 19, 2017, 06:06:42 PM
If you update to 0.9.2 or 0.9.3, at least you shouldn't crash easily, instead the game will become slower when it can't savestate.

BTW I think most of us crashed at that exact point then.

Forestidia86

Sorry that I'm pushing that, especially since I have not much knowledge of such things:

Is it definite that not enough VRAM was available locally if this crash message appears or is it only definite that the game wasn't able to create an internal savestate?
Could other things like disruption/disconnection/overload at the time the savestate should be done or while the savestate is done play a role?

Simon

#5
It is definite that the al_create_bitmap call to the Allegro 5 library wasn't able to return the desired VRAM bitmap. Allegro 5 calls OpenGL or DirectX behind the scenes and thereby allocates VRAM for us. Allegro 5 doesn't know about savestates, it merely knows about bitmaps. If this call fails, my code throws an exception.

Until 0.9.1, this exception flew out of the program unhandled, terminating the program and displaying the error message. On 0.9.2 and newer, I catch this exception during savestate construction, do not savestate instead, and continue the program.

-- Simon

ccexplore

Quote from: Forestidia86 on November 19, 2017, 10:33:12 PMOnly out of curiosity: Does multiplayer need significantly more VRAM than single-player?

I think it's primarily just the size (width x height) of the level?  Definitely the specific error message in your screenshot would suggest that to be the case, as it specifically calls out a 2560x1280 bitmap, and the level itself is the only thing I can think of that can be that large.  Singleplayer levels may tend to be smaller on average because larger levels tend to be more tedious to create and play.  Multiplayer levels often needs to make copies of the same part for all players, thus the resulting level may tend to be larger.  That said, I don't know what the actual data shows.

mobius

I crashed on this level too. My crash is different however: I got no message; the game froze. I had to force close it manually.

My game often crashes on big maps with lots of activity like this. But I also am using a 7+ year old computer. I can't run most modern 3D games well at all.
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


SQron188

Quote from: mobius on November 21, 2017, 01:05:57 AM
I crashed on this level too. My crash is different however: I got no message; the game froze. I had to force close it manually.

My game often crashes on big maps with lots of activity like this. But I also am using a 7+ year old computer. I can't run most modern 3D games well at all.

I initially got no message either, but I saw it when I Alt-Tabbed to Desktop to close it.

And my computer is also around 7 years old.

Forestidia86

Just an addition:

I tried Lix on the very old family computer (about 15 y/o; graphics card: NVIDIA GeForce4 MX 440 with AGP8X with 128 MB VRAM) and if I wanted to open/if I clicked on a bigger map like "Any Way You Want" then:

0.6.36 gave me following error message:

13.37 :0:
13.37 Access Violation
13.37 0x67301E04 in al_get_bitmap_flags
0x004A6FCB

0.9.3 gave me:

8.28 src\basics\alleg5.d:26:
8.28 Out of video memory. Can't create bitmap of size 3200x400 with flags 5120.
8.28 0x00404361
0x004C3CF6
0x004DE3D3
0x00427F5A

Smaller maps like "Canadian Glade" seem to load.

Simon

Graphics cards have a maximum texture length. For very old cards, 2048 can be the maximum size. Levels are rendered as a single VRAM bitmap. I accept that "out of VRAM" is the wrong error message here.

I try to support everything that has 4096 as a maximum length, and have rearranged very wide gadgets (NaOH's tar and tentacle hatch) to stay within 4096 width and height.

-- Simon

Forestidia86

Just for clarification:

I didn't intend to play Lix on that computer. I only wanted to test things out out of curiosity.

Quote from: Simon on November 27, 2017, 06:34:01 PM
I try to support everything that has 4096 as a maximum length, and have rearranged very wide gadgets (NaOH's tar and tentacle hatch) to stay within 4096 width and height.

Yeah, that's actually quite nice of you. It makes it possible that I can play certain levels on my old laptop at all.