• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 GMS2 crashes when Windows sleeps

csanyk

Member
When I sleep my laptop, after waking up again I find that GMS2 has crashed.

I can file a bug report, but before doing so I thought I'd ask if there's any log file somewhere that would be useful to grab and upload.
 

Jobo

Member
GMC Elder
File a bug, but be sure to include %programdata%\GameMakerStudio2\ui.log... It is a good idea to include this file with any bug report, I'd say.
 

Mike

nobody important
GMC Elder
This is graphics driver specific. We've had bugs with this before, and it's all about how the graphics driver restores things. On the laptops/desktops I've tried it's worked fine. Only way I could get it to crash was by updating the graphics card driver, and then - even Visual Studio crashed!

If you went to sleep playing Call Of Duty (or other big game), do they crash when it wakes up?
 

csanyk

Member
This is graphics driver specific. We've had bugs with this before, and it's all about how the graphics driver restores things. On the laptops/desktops I've tried it's worked fine. Only way I could get it to crash was by updating the graphics card driver, and then - even Visual Studio crashed!

If you went to sleep playing Call Of Duty (or other big game), do they crash when it wakes up?
I can't say I've ever slept my system while running a game, but this really sounds like you're just trying to make excuses for the crash.

It's certainly not desirable behavior for a system sleep event to result in application instability. If any application crashes due to a sleep/wakeup cycle, I cannot consider it to be anything but a defect in the application.

I have had things like downloads/uploads become interrupted, and therefore fail, due to a sleep/wakeup cycle. That's a bit more understandable since it's a transactions between two machines, and when one of them sleeps the other machine has no way of knowing what happened or what it should do, so it makes sense in such a situation to abort the file transfer and close the connection.

That said, I've seen apps that support pausing/resuming a file transfer handle sleep/wakeup elegantly, resuming the file transfer when the system wakes up, re-establishing a connection to the server and resuming the transfer, without a hitch.

I can also sleep my machine while a YouTube video is streaming in a browser, and upon waking up it will resume playing the video. It may run out of buffered video, and then stutter when it resumes the stream, but apart from that it works flawlessly.

Maybe this is something difficult to troubleshoot for you guys, but you should definitely be treating it like a defect and try to fix it; don't try to tell me that it's normal or something I should expect. I won't be convinced of that!
 

rwkay

GameMaker Staff
GameMaker Dev.
We do treat it like a defect, but the problem is if we cannot replicate it here then it is very difficult to fix... We have had this issue before and it was always a graphics driver issue (crash deep in the driver) then driver update fixes it.

Without the ability to replicate it here our hands are basically tied - you may consider it how you want, but our experience with this is OpenGL drivers not restoring from sleep correctly.

Out of interest can you test using the software driver that we supply and put your system to sleep and see if GMS2 survives... to do this go to your installation directory and copy the opengl32.dll from the mesa directory to the main directory and restart GMS2 (you should be able to tell from Help -> About box as it should mention MESA in the Graphics Vendor line) ... once you have tested remember to delete (or move back) the opengl32.dll or it will be using the software driver all the time.

Russell
 

csanyk

Member
We do treat it like a defect, but the problem is if we cannot replicate it here then it is very difficult to fix... We have had this issue before and it was always a graphics driver issue (crash deep in the driver) then driver update fixes it.

Without the ability to replicate it here our hands are basically tied - you may consider it how you want, but our experience with this is OpenGL drivers not restoring from sleep correctly.
Understood.

Out of interest can you test using the software driver that we supply and put your system to sleep and see if GMS2 survives... to do this go to your installation directory and copy the opengl32.dll from the mesa directory to the main directory and restart GMS2 (you should be able to tell from Help -> About box as it should mention MESA in the Graphics Vendor line) ... once you have tested remember to delete (or move back) the opengl32.dll or it will be using the software driver all the time.

Russell
Thanks, I will give that a try this evening.

Is there anything else I can do to provide useful data to you in the bug report when I submit it?
 

Mike

nobody important
GMC Elder
We might be able to tell the system not to sleep while we're running (like a video).... unlike a normal desktop app (which uses standard windows GUI elements), we are like a game that draws everything its self in a graphics context (which is why I was wondering if you ever had the same issue with a game).

As Russ has said, so far it's always been the graphics driver that's been to blame - or windows itself. When doing a driver upgrade, I was debugging the IDE, and the debugger itself (VisualStudio) crashed due to he graphics driver update. The OS will be resetting and throwing lots away during that, and it makes it impossible to debug, let alone see what odd state a program is in mid-execution when it happens. Obviously, you wouldn't update a graphics driver while playing a game, and if you did....you wouldn't be shocked if it crashed. Although we are a tool, we are in a similar boat.

That said.... if we can get a reproducible, non-driver related crash we can look at, we'll try and fix it - or at the very least, exit gracefully.

Also...Photoshop I believe can suffer from the same issue, as it uses OpenGL for lots of rendering as well, and if drivers go "funny" on them they will crash too. (i.e. if you update a driver while running PS)
 

csanyk

Member
We might be able to tell the system not to sleep while we're running (like a video).... unlike a normal desktop app (which uses standard windows GUI elements), we are like a game that draws everything its self in a graphics context (which is why I was wondering if you ever had the same issue with a game).
Blocking the system from sleeping is an idea... it's workaround rather than a fix, and not a good one. For a couple of reasons:
  1. If I issue a sleep instruction, I want my machine to go to sleep.
  2. If I'm on battery power, my system needs to go to sleep/hibernate when it's low on power, or when my power saving settings say it should.

When the system is playing a video or displaying a presentation, such that it's not being used interactively and it makes sense to disable screen saver activation, that's a completely different type of scenario.

As Russ has said, so far it's always been the graphics driver that's been to blame - or windows itself.
Can you get any support from Microsoft, or Nvidia, or ATI?

If it's a matter of not being able to replicate the problem on your hardware, or only being able to fix the problem on hardware that you can test on, and it being unfeasible to test on every single hardware variation in the PC world, then... how on earth does anyone write stable application software?

If it helps any, I'm experiencing this problem on a Lenovo P50 purchased in March of this year. It has:
  • CPU: Intel Xeon E3-1505M v5 @2.80Ghz
  • 64GB of non-ECC RAM
  • Video: Intel HD Graphics P530 + NVIDIA Quadro M2000M
  • Windows 7 Professional x64 SP1

When doing a driver upgrade, I was debugging the IDE, and the debugger itself (VisualStudio) crashed due to he graphics driver update. The OS will be resetting and throwing lots away during that, and it makes it impossible to debug, let alone see what odd state a program is in mid-execution when it happens. Obviously, you wouldn't update a graphics driver while playing a game, and if you did....you wouldn't be shocked if it crashed. Although we are a tool, we are in a similar boat.
OK but what does a driver upgrade have to do with my problem?

If I was upgrading the graphics driver, then sure, I'd expect there might well be problems with application stability. What does that have to do with the system going to sleep?

That said.... if we can get a reproducible, non-driver related crash we can look at, we'll try and fix it - or at the very least, exit gracefully.
Fair enough.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Also...Photoshop I believe can suffer from the same issue, as it uses OpenGL for lots of rendering as well, and if drivers go "funny" on them they will crash too. (i.e. if you update a driver while running PS)
I cannot update the GFX driver with photoshop open without it crashing, but I can sleep the PC fine.
 

Mike

nobody important
GMC Elder
  1. If I'm on battery power, my system needs to go to sleep/hibernate when it's low on power, or when my power saving settings say it should.
Can you get any support from Microsoft, or Nvidia, or ATI?

OK but what does a driver upgrade have to do with my problem?
If I was upgrading the graphics driver, then sure, I'd expect there might well be problems with application stability. What does that have to do with the system going to sleep?
Fair enough.
Yeah... you need to be able to close the lid on a laptop and have it sleep. This is one of the ways we were testing and it was working fine here.

Well,in your case it's probably the INTEL drivers that are nasty. Intel do turn out some shoddy drivers now and then, and on top of that, machine manufacturers sometimes mess with them as well.

A driver update does the same as a sleep (more or less). The graphics card context is reset and restored, so the program has an old context that is totally invalid for all the views, textures, primitives, surfaces etc. You are basically having to reload everything and start again. But...if I could detect that, I'd force a save and quit so at least it's clean.
 

csanyk

Member
A driver update does the same as a sleep (more or less). The graphics card context is reset and restored, so the program has an old context that is totally invalid for all the views, textures, primitives, surfaces etc. You are basically having to reload everything and start again. But...if I could detect that, I'd force a save and quit so at least it's clean.
Ah, thanks for explaining that. I hope you guys can figure out a way to make it work.
 
C

cvnk

Guest
Hmm. I guess this explains why my computer won't automatically sleep while GMS2 is running. I noticed (using powercfg /requests) that it's holding an audio stream open which I thought odd.

Well, I suppose if this is the only way to avoid crashes. I'll just have to learn to shut down GMS2 every night.
 
Top