[1.0.0] OpenGL Out of Memory - Crashes repeatedly

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
Sevans7
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Mar 13, 2019 1:09 am
Contact:

[1.0.0] OpenGL Out of Memory - Crashes repeatedly

Post by Sevans7 »

What happened?
- Game Crashes with OpenGL error: GL_OUT_OF_MEMORY, and:
- Game will then crash every single time I open it, giving same error. Sometimes I can get past the main screen, to launch the world, but then it crashes again each time. This continues to occur indefinitely; the only fix I found is to restart my computer entirely.
- Restarting my computer seems to fix the error for a while, but is only a temporary fix until the error occurs again and I cannot play factorio unless I restart again.
- This has happened to me more than three times since 1.0.0. (Meanwhile I had not played for months before 1.0.0)

What did you do?
- Play the game for a while.
- Also possibly relevant: my most recent endless chain of OpenGL error: GL_OUT_OF_MEMORY crashes occurred immediately upon opening the application Zoom and joining a video call, while trying to run factorio in the background.

What did you expect to happen?
(1) the game to not crash.
(2) some of the OpenGL memory allocation to reset when the game is closed, so that when I re-open the game it does not crash with the same exact error message, repeatedly, unless I restart my computer.


Honestly, I am much more concerned about (2); the initial crash happens rarely enough, maybe once every 10 hours of playtime or something like that. The real bother here is that even after closing then re-opening the game, closing then re-opening steam, and closing (putting to sleep mode) then re-opening my mac, the crash will still occur every time I open the game, either at loading screen or when I try to launch a game world.

Further details that may help:
- force-opengl is false in my config.ini
- other things I do sometimes which might eat openGL memory over time (honestly, I don't know much about openGL, so these may be irrelevant): use Jupyter Lab, use python to make plots with matplotlib, use python to make movies with openCV, watch shows on my computer.
- the crash seems to be unrelated to the world I play in, or actions take in the world. At least, I have not noticed a pattern with these things. The most recent crash chain occurred for a very new world with only an hour of playtime, in single player mode. The crash has happened other times in a multiplayer world with an advanced factory (many flying robots) as well.

I am also attaching a log file. I did not save the log from the first time the crash occurred, this time around. The attached log file corresponds to me trying to start the game, after restarting steam and closing and re-opening my computer, but not doing a full computer restart yet.
Attachments
factorio-OPEN_GL_CRASH.log
(4.69 KiB) Downloaded 150 times

ospis12
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sat Oct 17, 2015 12:07 pm
Contact:

Re: [1.0.0] OpenGL Out of Memory - Crashes repeatedly

Post by ospis12 »

Hi,
I looked how much VRAM does factorio use to lunch on windows machine (I know it's not apple, but still some data point).
And on max settings I was using over 1.5 GB, so to much for your system, I was able to drop it significantly by changing video memory usage setting to medium, then game was using less then 1GB.
I think you can edit your config file, search for it. Guide is here https://wiki.factorio.com/Application_directory,
when found edit value from:
video-memory-usage=all
to:
video-memory-usage=medium

I hope this will help you.

Sevans7
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Mar 13, 2019 1:09 am
Contact:

Re: [1.0.0] OpenGL Out of Memory - Crashes repeatedly

Post by Sevans7 »

Thank you for the initial reply. I will try that video-memory-usage change for the future. That seems like it might help prevent the initial crash (1) in the first place.

I am curious, why this post was moved to Support/Technical help? Since to me it still seems the repeated crashing (2) is a bug, which would not be fixed by changing technical settings alone. To clarify, I can run the game normally, for a long time, before the crash (1) happens. So I would expect to be able to run the game for a long time again after the crash, once I fully exit factorio and steam, and restart the application.

I expect there is some sort of memory leak, or failure to properly empty the VRAM (or OpenGL memory?) somewhere in the code, which is causing the crash to force me to restart my computer if I want to play more factorio. (I would hope to be able to just restart factorio, not my whole computer...)

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [1.0.0] OpenGL Out of Memory - Crashes repeatedly

Post by posila »

Hello, you have disabled texture compression, probably back in a version that allowed disabling it in the graphics options. You should enable it (low quality option is appropriate for integrated GPUs), as it will reduce VRAM usage by factor of 3.

As to why it was moved to technical support: when OpenGL says it's out of memory (GL_OUT_OF_MEMORY doesn't necesserily mean out of VRAM, it could have also failed to allocate memory it needed from RAM), the entire OpenGL context is in some undefined state and we can't do anything but to throw away all OpenGL resources and start over (reload the sprites, etc.) ... so we just exit.

How OpenGL manages its memory on your computer is out of our control. When an application exits, OS will release all its resources (allocated memory, opened file handles, GPU resources, ...), if the application didn't already do it (but we do.)

What I am trying to get to is that, if the game runs for 10 hours and then crashes on GL_OUT_OF_MEMORY, then starting it again is expected to crash on GL_OUT_OF_MEMORY almost immediatelly, as why would restarting the game magically give OpenGL more memory to work with? If you play it for 10 hours, it crashes on GL_OUT_OF_MEMORY, you then start it again and it again runs for 10 hours before it crashes ... then we might be not releasing something properly.

Sevans7
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Mar 13, 2019 1:09 am
Contact:

Re: [1.0.0] OpenGL Out of Memory - Crashes repeatedly

Post by Sevans7 »

Ah, I think I understand now what you are saying. The biggest issue for my understanding was previously just not really knowing what OpenGL was. Since OpenGL errors have never made an application crash for me before, I figured maybe there was something going strangely in how you managed the OpenGL memory. But if my system is what is mismanaging the memory (which, honestly, I can't say I'm confident about one way or another, I just have no idea so I'll take your word for it!), then I can see how that's not something you could fix.

Thanks for the other advice as well. Today, the OpenGL error appeared again, and I figured I might have to restart my computer. But I decided to first try to change the texture compression setting to low-quality (via editing config.ini) and launch factorio again just to see if it helped. Turns out, I was able to play again without a restart! This seems to have fixed the issue. Thanks again! :)

Post Reply

Return to “Technical Help”