Engine crashes whenever I render. Something to do with scratch buffer???

I started getting this issue after converting my project from 5.2 to 5.4. Some levels with lots of high poly assets were crashing on load but only if ray tracing was enabled. Disabling ray tracing fixed it, but obviously not a great solution since I needed it for pathtracing. Also all of my meshes are already Nanite, so it didn’t have to do with having too many non-nanite Static Meshes.

Setting the CVar r.RayTracing.Geometry.MaxBuiltPrimitivesPerFrame 100000 fixed it, since I think this staggers the loading of geometry data into the BLAS buffer, which prevents it from overloading all at once. By default it’s -1, which builds the ray tracing acceleration structure immediately. Not sure why this was suddenly an issue with 5.4, but Epic said they changed the RHI rendering pipeline (Unreal Engine 5.4 Release Notes | Unreal Engine 5.4 Documentation | Epic Developer Community), so maybe they added additional buffers or acceleration structures which now caused the BLAS buffer to overload when trying to load geometry data all at once

From what I can tell (at least with Pathtracing), the scene looks exactly the same as before, but doesn’t crash on load!

5 Likes