DirectX encountered an unrecoverable error

Fix "DirectX encountered an unrecoverable error" in seconds

Software – Games & Drivers Intermediate 👁 12 views 📅 Jun 16, 2026

Stop reinstalling DirectX—the fix is often simpler. Here's why the error happens and exactly what to do.

DirectX just crashed your game. Here's the fix.

You're mid-match in Battlefield 2042 or flying through Night City in Cyberpunk 2077, and suddenly the screen freezes. Then the error: "DirectX encountered an unrecoverable error." It's infuriating. But here's the thing—reinstalling DirectX or your GPU driver almost never fixes it. The real culprit is usually a corrupted shader cache or an unstable GPU overclock.

Step 1: Delete the DirectX Shader Cache (This is the real fix)

The most common cause is a corrupted shader cache. DirectX stores compiled shaders on disk so the game doesn't have to recompile them every time. But if your GPU driver crashed, or you force-closed the game during a shader loading screen, that cache gets corrupted. Next launch, DirectX tries to load the broken data, panics, and bails.

  1. Press Win + R, type cleanmgr, hit Enter.
  2. Select the drive where your game is installed (usually C:).
  3. Click Clean up system files (you need admin rights).
  4. Scroll down, check DirectX Shader Cache.
  5. Click OK, then Delete Files.

That's it. The cache is now empty. The next time you launch the game, DirectX will recompile shaders fresh. It'll take a minute or two—let it finish. Don't alt-tab, don't force-close.

Step 2: Disable any GPU overclock (yes, even factory OCs)

If step 1 didn't work, the issue is likely an unstable GPU clock. This is especially common with cards that have a factory overclock—NVIDIA's "OC Edition" cards, AMD's "Gaming X" variants. They push the silicon right to the edge, and some games (especially Unreal Engine 4 and 5 titles) trigger voltage drops that cause the GPU to crash mid-frame.

  1. Open your GPU tuning software (MSI Afterburner, EVGA Precision X1, or AMD Adrenalin).
  2. Lower the core clock by -100 MHz.
  3. Lower the memory clock by -200 MHz.
  4. Apply and test the game for 15 minutes.

No crash? Great. Now you can slowly creep the clocks back up. But honestly, for some games, the stock clocks are the only stable ones.

Why this works: the technical bit

What's actually happening here is that DirectX 12 hands a lot of control to the game engine. The engine manages its own command buffers and resource transitions. When the shader cache holds a corrupted bytecode chunk, the GPU tries to execute it, hits an invalid instruction, and the driver resets the device. That reset triggers the DXGI_ERROR_DEVICE_REMOVED or DXGI_ERROR_DEVICE_HUNG error—both reported as "unrecoverable error" in the game's UI.

Deleting the cache removes the corrupted data. Lowering the GPU clock reduces the chance of the driver hitting a timing wall that causes a TDR (Timeout Detection and Recovery) reset.

Less common variations of the same issue

DirectX runtime files are actually broken

Rare, but possible. Use the DirectX End-User Runtime Web Installer from Microsoft. Run it—it'll add any missing DLLs. Don't download from third-party sites.

Windows 11 23H2 and Nvidia driver bug

Some users on Windows 11 23H2 with Nvidia drivers 551.86 to 552.44 reported this error specifically when alt-tabbing from fullscreen games. The fix: install driver 552.55 (hotfix) or later. The bug was in the driver's handling of fullscreen transitions.

Game-specific workarounds

For Halo Infinite: switch from High-Res Textures pack to standard. The ultra texture pack causes memory allocation failures on 6 GB cards.
For Fortnite: disable DirectX 12 in the launcher settings and go back to DirectX 11. Epic hasn't fixed a memory leak in their D3D12 implementation since Chapter 4.

Prevention: keep your card cool and your drivers clean

Two things going forward:

  • Use DDU (Display Driver Uninstaller) when switching driver versions. Don't just install over the top—old registry keys can cause conflicts.
  • Monitor GPU temps. If your card runs above 85°C during gaming, improve case airflow or undervolt the GPU. Heat amplifies instability.

And one last thing: if you're using MSI Afterburner's "Auto Scan" feature to find your max overclock, stop. It often sets voltages too aggressive for sustained gaming workloads. Manual undervolting is safer.

Was this solution helpful?