Civilization – Blue Screen of Death (BSOD) STOP code 0x00000116 on game close

civilization-5technical-issues

I encountered a strange crash on closing Civilization V. Usually the game closes fine, but on occasion the crash presents as follows:

  1. I click "Exit to Windows"
  2. Game closes, desktop shows, but begins flickering
  3. After a few seconds of flickering, blue screen of death

I did find a workaround and will post as an answer, as I think this issue could potentially affect other DirectX games. For Civ5 specifically, I did come across a compilation thread for troubleshooting other types of crashes.

To verify symptoms, I used BlueScreenView, a visualizer for windows dump files. After running it and selecting Options->Lower Pane Mode->Blue Screen in XP Style, my crash dump looks like this:enter image description here

Best Answer

The error suggests it's a DirectX crash, but it is not enough to update graphics drivers or confirm that DirectX is up to date. The breakthrough moment came for me when I found this Windows this Windows post explaining the error. The important part is:

Andre.Ziegler replied on July 12, 2010
Bug Check 0x116: VIDEO_TDR_ERROR This indicates that an attempt to reset the display driver and recover from a timeout [failure]

And then I remembered that during those occasional crashes, I had walked away from the game. My monitor was set to turn off after 10 minutes, though when I came back the game seemed fine and I continued to play without issues. Later when I exited, the crash occurred.

My workaround is to use a script to set the timeout to "Never" (can also be manually done through Control Panel->Power Options->Turn off the display->Never), and when the game finished, to set it back to 10 minutes:

CivilizationV_DX11_nosleep.bat

@echo off
REM The purpose of this script is to prevent a possible BSOD crash on 
REM   Civ5 closing if at one point the monitor went to sleep
REM Place this script in same folder as CivilizationV_DX11 executable
REM Optionally, make a shortcut to it on your desktop

REM sets the monitor to never timeout
powercfg -change -monitor-timeout-ac 0

REM open civ5
call CivilizationV_DX11.exe

REM revert to preferred setting (e.g. 10 minutes)
powercfg -change -monitor-timeout-ac 10