Fix Hogwarts Legacy DirectX Error: Step-by-Step Guide
In this article
Hogwarts Legacy can crash or fail to launch with a DirectX error, often due to outdated graphics drivers, corrupted shader cache, or incompatible graphics settings. Here's the direct fix: update your GPU drivers, clear the DirectX shader cache, and verify game files — that resolves most cases. If not, follow the full steps below.
What You'll Need
- A Windows PC (the steps below are for Windows 10/11)
- Administrator access to your computer
- An internet connection to download driver updates
- Your GPU brand: NVIDIA, AMD, or Intel (to find the right driver update)
Step-by-Step
- Update your graphics driver. This is the #1 cause of DirectX errors in Hogwarts Legacy. Go to your GPU maker's official website (NVIDIA, AMD, or Intel) and download the latest driver for your exact model. Alternatively, use the built-in updater: for NVIDIA, open GeForce Experience and click "Drivers" then "Download"; for AMD, open AMD Software and go to "Check for Updates". If you're unsure of your GPU, press Windows + R, type
dxdiag, and look under the "Display" tab. - Restart your PC after the driver update. This ensures the new driver is fully loaded.
- Clear the DirectX shader cache. Corrupted shader cache files are a common trigger. Open the Run dialog (Windows + R), type
%LOCALAPPDATA%\Hogwarts Legacy, and press Enter. In the folder that opens, delete the folder namedSaved(this contains shader cache and settings — you'll lose in-game graphics settings, but not your save game). If you can't find that folder, also check%LOCALAPPDATA%\Hogwarts Legacy\Saved\Configand delete theDirectXsubfolder if present. - Verify game files. This repairs any corrupted game files. In Steam, right-click Hogwarts Legacy in your library, select "Properties", go to "Installed Files", and click "Verify integrity of game files". In Epic Games Launcher, click the three dots on the game tile, select "Manage", then "Verify". Wait for the process to finish.
- Run the game as administrator. Right-click the game's executable (usually in
Steam\steamapps\common\Hogwarts LegacyorEpic Games\HogwartsLegacy), select "Properties", go to the "Compatibility" tab, check "Run this program as an administrator", and click OK. Then launch the game from Steam/Epic again. - Lower in-game graphics settings. If the game launches but crashes with a DirectX error during play, the issue may be a specific setting. Start the game, go to Settings > Graphics, and set the following: Ray Tracing: Off, Upscaling: Off (or set to TAA), Effects Quality: Medium, and View Distance: Medium. Then test the game. If it works, gradually raise settings one at a time to find the culprit.
- Disable DirectX 12 and force DirectX 11. Hogwarts Legacy has a known issue with DirectX 12 on some systems. In Steam, right-click the game, select "Properties", then "General", and add
-dx11to the "Launch Options" text box. In Epic, click the three dots on the game tile, select "Manage", then "Launch Options", and type-dx11. Launch the game. If it still crashes, remove that and try-dx12instead (if you were already on DX11). - Update Windows. Go to Settings > Windows Update and install any pending updates. DirectX components are updated via Windows Update, so an outdated OS can cause errors.
- Reinstall the game. If nothing else works, uninstall Hogwarts Legacy completely (via Steam/Epic), then reinstall. This is a last resort but often clears stubborn file corruption. Your save games are stored in the cloud, so you won't lose progress.
Common Mistakes
- Skipping the driver restart. Updating a driver without restarting can leave old files in memory, causing the same error.
- Deleting the wrong folder. Be careful: the
Savedfolder inside%LOCALAPPDATA%\Hogwarts Legacycontains settings, but your actual save games are inDocuments\Hogwarts Legacy. Do not delete that Documents folder. - Using third-party driver updaters. These often install wrong or outdated drivers. Always use the official NVIDIA/AMD/Intel sites or their official apps.
- Assuming it's a game bug. Many players blame the game, but it's almost always a driver or system issue. Try the steps in order.
Tips
- Check your GPU temperature. If the error happens after 10-20 minutes of play, overheating can cause DirectX crashes. Use a free tool like MSI Afterburner to monitor temps; if above 85°C, clean your PC's fans or improve airflow.
- Close background apps. Overlays from Discord, GeForce Experience, or MSI Afterburner can interfere with DirectX. Close them before launching the game.
- Set a frame rate cap. In the game's graphics settings, cap the frame rate to 60 FPS. This reduces load on the GPU and can prevent crashes.
- Keep your GPU drivers clean. Use the "Clean Install" option in the driver installer (NVIDIA) or "Factory Reset" (AMD) to remove old driver remnants.
Troubleshooting
If you've followed all steps and still get the DirectX error:
- Check for Windows corruption. Open Command Prompt as administrator and run
sfc /scannow. If it finds errors, restart and try again. - Test with a different GPU. If you have a second GPU (e.g., integrated graphics), try launching the game with that. This isolates whether your main GPU is failing.
- Check the game's official support page. Search for "Hogwarts Legacy DirectX error" on WB Games Support. They may have a specific patch or known issue for your hardware.
- Try a clean boot. Disable all non-Microsoft startup programs via Task Manager > Startup, then restart and launch the game. This rules out software conflicts.
- If the game crashes immediately on launch, check the Windows Event Viewer. Open Event Viewer, go to Windows Logs > Application, and look for errors with source "Application Error" or "HogwartsLegacy". The error code may point to a specific DLL file — search that DLL name online for a fix.
Frequently Asked Questions
Will this delete my save game?
No. The steps above only delete shader cache and settings folders, not your save files. Your saves are stored separately in Documents\Hogwarts Legacy.
Is this error more common on NVIDIA or AMD?
Both, but NVIDIA users often see it after driver updates that introduce bugs. Rolling back to a previous driver version (via NVIDIA's website) can help if the latest driver is problematic.
Can I play on DirectX 11 permanently?
Yes, but the game may look slightly worse and lack some ray-tracing features. However, many players report better stability on DX11.
Why does the error happen only in certain areas?
That's often due to heavy shader compilation in areas with lots of effects (like Hogsmeade). Clearing the shader cache and lowering effects quality usually fixes it.
Does this error occur on PS5 or Xbox?
No, DirectX is Windows-only. Console versions have their own graphics APIs and don't get this error.
Should I reinstall Windows?
Only as a last resort after trying everything else. It's rarely needed — the steps above resolve the vast majority of cases.