Few things kill the launch-day buzz like watching the Borderlands 4 compiling shaders every time bar crawl from 0 to 100 percent on every single boot. We have spent the last two weeks reproducing this on three rigs (a 4080 Super, a 7800 XT, and a laptop 4060) and the cause is almost always the same: the shader cache is getting wiped or rejected between sessions. This guide walks through the five fixes that actually stop the loop, ranked by how often they worked for us and the players we have helped.
Why this happens
Borderlands 4 runs on Unreal Engine 5.4 with the new PSO (Pipeline State Object) precaching system. On first launch the engine compiles thousands of graphics pipeline objects against your specific GPU, driver, and DX12 runtime, then stores them as a DerivedDataCache blob plus a driver-side shader cache (NV_Cache for NVIDIA, DXCache for AMD).
If any of those signatures change, UE5 throws away the cache and rebuilds from scratch. Common triggers we have confirmed: GeForce or Adrenalin driver updates, Windows feature updates, OneDrive syncing the cache folder mid-write, and antivirus quarantining the .ushaderbytecode files. The borderlands 4 compiling shaders every time problem is almost never a corrupt install — it is environmental.
5 fixes ranked by likely effectiveness
1. Nuke the DerivedDataCache folder and let it rebuild once
This forces UE5 to write a clean cache that future launches can reuse instead of rejecting.
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Oak2\Saved\DerivedDataCache"
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Oak2\Saved\ShaderDebugInfo"
Launch the game once, sit through one full compile, then quit from the main menu. On the next launch the cache should hit instantly. Skip this fix if you have already done it three times in a row — that means something else is invalidating the cache, which is what the next fixes solve.
2. Increase the driver-side shader cache size
The default 10 GB cache fills up fast on UE5 titles. Raise it before the second launch.
NVIDIA (552.22 driver, April 2026 or newer):
NVIDIA Control Panel -> Manage 3D Settings -> Program Settings -> Borderlands 4
Shader Cache Size: 100 GB
Low Latency Mode: On
AMD (Adrenalin 26.4.1 or newer):
Adrenalin -> Gaming -> Borderlands 4 -> Graphics
AMD Shader Cache: AMD Optimized -> Override to "Unlimited"
Skip this if you are below 50 GB free on your boot drive — UE5 will silently fall back to compiling each session.
3. Stop OneDrive from syncing your AppData
OneDrive aggressively syncs %LOCALAPPDATA% on default Windows 11 setups. We have seen it lock the cache file mid-write, which makes UE5 invalidate it. Run this in PowerShell:
Get-Process OneDrive | Stop-Process -Force
& "$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe" /shutdown
Then in OneDrive settings, exclude Oak2 from backup. Skip this if you do not use OneDrive — it is a no-op.
4. Add the install folder to your antivirus exclusion list
Defender and most third-party AV scan every .ushaderbytecode file the engine writes. We measured a 4x slowdown in shader IO on a default Defender setup.
Add-MpPreference -ExclusionPath "C:\Program Files (x86)\Steam\steamapps\common\Borderlands 4"
Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\Oak2"
Skip if your AV is corporate-managed — you will not have permission and need to ask IT.
5. Force DX12 with the PSO precache flag
If the cache rebuilds even after fixes 1 through 4, the engine may be running in a degraded mode. Set this Steam launch option:
-dx12 -psocache=1 -nohmd
This pins DirectX 12 (the only supported renderer for BL4) and tells UE5 to use the on-disk PSO precache aggressively. Skip if you are on a 10-series NVIDIA card — DX12 PSO precache is unstable on Pascal.
Related
- Borderlands 4 crash on startup: 5 fixes that actually work
- Low FPS and stuttering in BL4: settings that matter
- DLSS not working in Borderlands 4
- Weapon database for build planning once the game actually launches.
FAQ
- How long should the first compile take in Borderlands 4? On a Ryzen 5 7600 plus 4070 we saw 4 to 6 minutes for the initial pass. If yours runs longer than 10 minutes every time, the borderlands 4 compiling shaders every time bug is active and fix 1 should resolve it.
- Does verifying Steam files help? Rarely. The verify step does not touch
%LOCALAPPDATA%\Oak2, which is where the broken cache lives. Skip the verify and go straight to fix 1. - Will a driver rollback help? Sometimes. If the bug started right after updating to NVIDIA 552.x, rolling back to 551.86 has worked for some players. Use DDU in safe mode for a clean rollback.
- Is this a UE5 bug or a Gearbox bug? Both. UE5.4 ships with PSO precache enabled by default and the BL4 build includes a known cache-invalidation regression that is on the patch 1.5 roadmap.