Battlefield 6 - DirectX Crash Fix
Recently I purchased Battlefield 6. The game is actually really fun and refreshing. Only one issue though, my game crashes after ~20 minutes of gameplay.
This has been incredibly frustrating for me, and I have spent the past few days looking for a fix, couldnt find one. Even the game devs were clueless. So many people online were experiencing this same issue.
Here was the issue:
1
DirectX function "GetDeviceRemovedReason" failed with DXGI_ERROR_DEVICE_HUNG (The GPU will not respond to more commands").
You might think: “Oh must just be an issue with your drivers or your GPU” NO! People with all kinds of GPUs were getting this same error. I saw people try everything, from a fresh install, to changing BIOS settings, but no solution was found. Until… I found one.
The following is the post I made on the r/Battlefield subreddit:
I tried this and it worked for me, I haven’t experienced a crash since, and I haven’t seen this method anywhere else.
https://www.reddit.com/r/ARK/comments/17plsn4/possible_fix_for_dxgi_error_device_removed_with/
I know the solution is from the ARK subreddit (and 2 years old) but the logic behind what is happening actually makes sense once you think about how Windows and DirectX handle GPU timeouts.
What seems to be happening here is (atleast for the DXGI_ERROR_DEVICE_HUNG):
precondit: Some video memory is leaked or a GPU task hangs briefly, which triggers an alert to Windows.
1
2
3
4
5
6
7
Windows detects that the GPU has stopped responding (a "hang") and assume a fault has occured.
Windows sends lock signal to DirectX as part of the Timeout Detection and Recovery (Windows TDR) process.
DirectX, after receiving the signal, suspends the GPU context or resource allocations for the game.
BF6 loses its active GPU context, resulting in a crash, even though the GPU might have simply been overloaded or delayed, not actually frozen.
It seems as if this is more of a Windows issue, specifically how it handles GPU stalls.
IMPORTANT: If your GPU temps are SUPER high before crash, DO NOT TRY THIS!!! Also before trying this, remove any UV or OC you have on your GPU or CPU.
Someone else try this (if you will), and see if it works. Be forewarned, editing your registry can cause system instability if not done carefully, I recommend a backup before you go and mess with it.
Steps from the post: (ty: u/rtuite81)
1
2
3
4
5
6
7
8
9
10
11
Click your start menu and type "regedit" and click on "Registry Editor"
Copy this text and paste it into the "address bar" at the top: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers
Right click the white space in the right hand pane and select "New" -> "DWORD (32-bit) Value"
You will get a new item called "New Value #1" - Rename this to TdrDdiDelay and hit "enter"
Double click the new entry and make sure "Hexadecimal" is selected for "Base" and set the "Value data:" field to 3c
Repeat step 3 - 5, but this rename this entry to TdrDelay and use the same values. Only the name should be different.
If you’re curious why this works:
Windows includes a safety system called Timeout Detection and Recovery (TDR) (what I mentioned above), It watches for unresponsive GPUs and resets them if they don’t respond within a short time (usually ~1-2 seconds) -> this is why if when your game crashes, the screen may turn temporarily black.
When heavy graphic load causes a delay, Windows can falsely assume the GPU is dead and resets it, which kills the game’s rendering context and causes the DXGI_ERROR_DEVICE_HUNG crash.
By adjusting or disabling the TDR values in the registry, you’re essentially telling Windows: “Give the GPU more time to finish work before lock & signal”.
If you have ever taken an OS class in university, this is a pretty simple lock & signal problem.
Let me know if this helps! I’m curious if others can reproduce the same stability improvement
END POST
As you can see, the issue wasn’t my drivers or the game, but instead Windows’s poor TDR management system.