Author Topic: OutOfVramException  (Read 4464 times)

0 Members and 1 Guest are viewing this topic.

Offline SQron188

  • Posts: 176
    • View Profile
OutOfVramException
« on: November 19, 2017, 05:50:35 PM »
This is the crash message from yesterday's session:


Offline Simon

  • Administrator
  • Posts: 3954
    • View Profile
    • Lix
Re: OutOfVramException
« Reply #1 on: November 19, 2017, 06:06:42 PM »
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
« Last Edit: November 19, 2017, 07:16:52 PM by Simon »

Offline Forestidia86

  • Posts: 731
  • inactive
    • View Profile
Re: OutOfVramException
« Reply #2 on: November 19, 2017, 10:33:12 PM »
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.
« Last Edit: November 20, 2017, 12:27:59 AM by Forestidia86 »

Offline SQron188

  • Posts: 176
    • View Profile
Re: OutOfVramException
« Reply #3 on: November 20, 2017, 02:51:24 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.

Offline Forestidia86

  • Posts: 731
  • inactive
    • View Profile
Re: OutOfVramException
« Reply #4 on: November 20, 2017, 06:06:45 PM »
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?

Offline Simon

  • Administrator
  • Posts: 3954
    • View Profile
    • Lix
Re: OutOfVramException
« Reply #5 on: November 21, 2017, 12:36:28 AM »
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
« Last Edit: November 21, 2017, 03:07:48 AM by Simon »

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: OutOfVramException
« Reply #6 on: November 21, 2017, 12:45:15 AM »
Only 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.

Offline mobius

  • Posts: 2761
  • relax.
    • View Profile
Re: OutOfVramException
« Reply #7 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.
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


Offline SQron188

  • Posts: 176
    • View Profile
Re: OutOfVramException
« Reply #8 on: November 24, 2017, 08:14:53 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.

Offline Forestidia86

  • Posts: 731
  • inactive
    • View Profile
Re: OutOfVramException
« Reply #9 on: November 27, 2017, 06:17:29 PM »
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.

Offline Simon

  • Administrator
  • Posts: 3954
    • View Profile
    • Lix
Re: OutOfVramException
« Reply #10 on: November 27, 2017, 06:34:01 PM »
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

Offline Forestidia86

  • Posts: 731
  • inactive
    • View Profile
Re: OutOfVramException
« Reply #11 on: November 27, 2017, 06:42:16 PM »
Just for clarification:

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

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.