[posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED (MR)

Bugs that are actually features.
posila
Factorio Staff
Factorio Staff
Posts: 5350
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED

Post by posila »

Thanks for all the reports.

By now, I am 99% sure it is not caused by a bug in the game and it is rather just another error that just happens on some computers due to some instabilities.
It could unstable graphics driver, other software messing up GPU state, or HW being unstable for some reason - overclocking, overheating, power issues, manufacturing defect, you name it. Updating graphics driver while the game is running would cause this error also. If you try to lookup the error in context of other games, you find the wierdest advices that people say helped them to fix the problem - for example disabling all HDMI Audio devices.

Anyway, if the error occurs, you should try to just reboot your PC first; If that doesn't help, try to update your graphics driver, and if that still doesn't fix it, switch try to switch to OpenGL renderer.

I also gave up on trying to recover from the error for time being, so when the error occurs, a better error message will be shown with an option to switch to OpenGL as a workaround.
tfh
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Feb 25, 2020 12:06 am
Contact:

Re: [posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED

Post by tfh »

Hi,

New player here, got the game at the weekend and firstly I'd just like to say how brilliant Factorio is and how much I'm enjoying the game.

I've been reading this thread because after playing without any issues for about 9 hours I suddenly ran into this crash last night. I've attached the log file here.

Admittedly I don't play a lot of games but when I have been playing recently I've experienced crashes across different games using DirectX APIs (Football Manager in the 3D match engine (this one is particularly crushing), The Long Dark, very occasionally Elite Dangerous locks up, experienced once or twice in Kenshi). They all seem to come out of nowhere and inspecting the log files (when they're available!) it always relates to the same error, namely 0x887a0005, where the "device" has been "removed".

I'm using an i7 2600, a GTX 1650 4GB and have 16GB RAM. Running Windows 10 Pro 1809. Perhaps my hardware is a little unusual, as it's a fairly old CPU and an unpopular GPU, but it's more than capable and I see that this issue crops up quite frequently across applications.
posila wrote: Thu Jun 06, 2019 1:34 pm Thank you. It didn't uncover any bug, it just says Windows killed the graphics driver because GPU took too long to process a command.

You can remove --debug-graphics and try to use --gfx-safe-mode, I think that should allow the game load for you.
What's really interesting here is what you say about Windows stopping the graphics driver because the GPU took too long to process a command. It reminded me of something I came across a while ago when I was troubleshooting this error, though at the time I did not look further into it. That is that Windows has a mechanism it calls Timeout Detection and Recovery for killing processes when it believes the graphics driver has become unresponsive https://docs.microsoft.com/en-us/window ... istry-keys. By default the values for timeout are quite low at 2 seconds and 5 seconds and some intensive applications even recommend editing these values https://docs.substance3d.com/spdoc/gpu- ... 45489.html. It's beyond the realms of my knowledge, but perhaps some interaction/process between the graphics driver, Windows and DirectX is appearing to Windows as taking longer than these timeout values?

I believe that this may be what is happening with these errors and I've edited my own registry keys accordingly, so I'm looking forward to playing Factorio further and will of course report back if I come across this crash again, as it would mean that I am mistaken!

Thanks a lot,

Tom
Attachments
factorio-current.log
(125.3 KiB) Downloaded 102 times
posila
Factorio Staff
Factorio Staff
Posts: 5350
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED

Post by posila »

Hello and welcome!

There is also this old thread on nVidia forums that might be related to your situation https://www.nvidia.com/en-us/geforce/fo ... his-issue/

In my opinion, there is something wrong with your HW. It might by insufficient (or bad) PSU, bad RAM, or defective GPU itself (I don't know if CPU could or could not be causing this), and I would be careful with editing TDR settings. Your computer might hang or BSOD instead of just crashing applications.

There is definitelly not single cause of this issue, what I think usually happens with Factorio, is GPU hangs when it is trying to transition between power states.
For example see following from ~1.2 seconds before the crash:

Code: Select all

1502.924 Graphics GraphicsInterfaceDX11.cpp:341: DrawCalls: 79 Sq:3703 Pv:38 Fv:522 Tq:176; 0> 16.67ms, 1> 3.91ms, 2> 4.84ms, 3> 0.00ms, (1,0,F) #tex:0/0B, #cb:9/1360B, #map:61/3/851968B; IA>24392:8146 VS>16448 R>8146:6276 PS>18003340 (0)
1502.941 Graphics GraphicsInterfaceDX11.cpp:341: DrawCalls: 79 Sq:3703 Pv:38 Fv:522 Tq:150; 0> 17.14ms, 1> 0.29ms, 2> 0.48ms, 3> 0.00ms, (1,0,F) #tex:0/0B, #cb:9/1360B, #map:61/3/851968B; IA>24392:8146 VS>16448 R>8146:6276 PS>18022556 (0)
Time "0>" is not interesing (it is frame time present-to-present, so it's expected to be around 16.6 ms), time "1>" is tile render time, "2>" is game view rendering time. All other metrics are essentially the same, so workload between the two frames was essentially the same. But timings are 10x different. That says to me, GPU was in low power state (possibly even idle, given the very high times) and transitioned to higher power state (so it ran 10 times faster).

So it is possible, that after another second GPU realized it has very low workload and tried to transition back to the lower power state and hang. (But it shouldn't have hang, it should be able to transition between power states without issues.)

HOWEVER, it is beyond my abilities to test this hypothesis in any way, so take it with huge grain of salt.
tfh
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Feb 25, 2020 12:06 am
Contact:

Re: [posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED

Post by tfh »

Hi posila,

Thanks a lot for the response and shedding more light on what the log file might indicate, this is really helpful. What you say is very interesting and does make me wonder if my PSU is insufficient - it's an old OEM module and only has an output rating of 240W. The CPU (95W) and GPU (75W) together have a combined TDP of 170W, so it doesn't leave a lot of room for fluctuations. From your analysis I might then draw the conclusion that the GPU ran into problems when it couldn't draw the necessary power whilst switching between power states, or something similar :)

So this seems like it might be the culprit in my case then, as I have said already I've experienced crashes in lots of different games, seemingly at random. Thankfully this doesn't happen during my usual workload and only once in a blue moon when playing games, but it's still a good excuse to bring forward that new build I've been thinking about :lol:

I think given your advice I'll also reset my TDR settings to avoid any serious system hangups.

Thanks for your help,

Tom
User avatar
StoneLegion
Filter Inserter
Filter Inserter
Posts: 687
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED (MR)

Post by StoneLegion »

Hope it's fine to Necro this with a Solution that worked for a friend and Not might not work for most. So be warned when making such changes and that I nor the Factorio Devs take any responsibility for someone editing their Registry.


Just posting this for people who search DXGI_ERROR_DEVICE_REMOVED
So the solution I found to work for my friend is related to a time out issue between the video card and windows that hangs. This is super rare but does happen to some games and people having this issue. Overall if rebooting the PC fixes it you are good to go as well of course latest windows updates, drivers, etc.

That being said if you still have issues you can regedit and remove the timeout TDRLevel with Windows. What this will do is if your Video Card Really legit Crashes Windows will not reboot it meaning you would need to hard reboot your PC... So if you really have Video Card issues this could have negative Impacts.

**WARNING YOU SHOULD NEVER USE RANDOM REGEDIT FIXES UNLESS YOU KNOW WHAT YOUR DOING**

1) Go To Windows Search
2) Search Regedit
3) Right click and select run as administrator
4) Opne HKEY_LOCAL_MACHINE
5) Open SYSTEM
6) Open CurrentControlSet
7) Open Control
8) Click GraphicsDrivers
9) Right Click And Select New In Windows Registry
10) Select DWORD (32-bit) Value
11) Type TdrLevel (Write it exactly T and L should be capital)
12) Double click on TdrLevel
13) Make sure value data is 0
14) Now restart your pc
Done! problem solved
Chaos234
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Sat Jun 27, 2015 10:45 pm
Contact:

Re: [posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED (MR)

Post by Chaos234 »

Would this also solve my problem posted here: viewtopic.php?f=47&t=98339 ?

Version 1.1.13
Drivers up to date

Only Factorio is affected and only while I am in the main menu. I must admit that it is a bit modded, incl. HD Graphics Mods
User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: [posila] [0.17.1] Crash on load, DXGI_ERROR_DEVICE_REMOVED

Post by ptx0 »

tfh wrote: Tue Feb 25, 2020 3:06 pm it's an old OEM module and only has an output rating of 240W. The CPU (95W) and GPU (75W) together have a combined TDP of 170W
:shock:
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 275
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: [posila][2.0] Crash on load, DXGI_ERROR_DEVICE_REMOVED (MR)

Post by BraveCaperCat »

Still happening in space age.
Creator of multiple mods, including Quality Assurance - My most popular one. Expect multiple modding-related questions, answers and other posts.
Post Reply

Return to “Not a bug”