# RHI flush resources costly

**URL:** <https://forums.unrealengine.com/t/rhi-flush-resources-costly/1750272>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** profiling, Insights, unreal-engine, Performance, editor, question\
**Created:** [March 13, 2024, 9:03pm UTC](https://forums.unrealengine.com/t/rhi-flush-resources-costly/1750272 "2024-03-13T21:03:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZaneJensen013](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZaneJensen013](https://forums.unrealengine.com/u/ZaneJensen013)\
**Post date:** [March 13, 2024, 9:03pm UTC](https://forums.unrealengine.com/t/rhi-flush-resources-costly/1750272/1 "2024-03-13T21:03:19Z")

</div>

I am optimizing a scene in my game, and I’m currently getting stuck on my rendering thread. I am seeing large costs appearing in the FRDGBuilder, specifically EndFlushResourcesRHI, which sometimes spikes up to 11-14ms for a few frames.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/5/7a56e1d198d5fd9a6bf6409bdec2afbc78c9c695.png)

What would be the reason for such a high amount of resources flushing? Is there a way to profile further? or is there an overarching reason for this?

---

<div class="post-metadata">

**Author:** ![SpauldingTrader](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SpauldingTrader](https://forums.unrealengine.com/u/SpauldingTrader)\
**Post date:** [May 9, 2024, 3:24am UTC](https://forums.unrealengine.com/t/rhi-flush-resources-costly/1750272/2 "2024-05-09T03:24:32Z")

</div>

Did you happen to ever figure out the issue? I am currently very stuck on this problem myself. Pretty much the same exact thing.

---

<div class="post-metadata">

**Author:** ![hkkmlz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hkkmlz](https://forums.unrealengine.com/u/hkkmlz)\
**Post date:** [July 1, 2024, 6:57pm UTC](https://forums.unrealengine.com/t/rhi-flush-resources-costly/1750272/3 "2024-07-01T18:57:38Z")

</div>

I am also having this issue, since 5.3. Sometimes `EndFlushResources` will take less than 0.5 ms, other times it will take 5ms and remain that way for the duration of the game. The only thing I found during testing to reliably trigger it is executing more than 1 task on the task graph from the game thread.

Here’s a picture of my profiling and annotations.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/6/fd67ac602218fbf4d2ded8f16e3b679128ed53fe.png)

I’ve seen some other plausible explanations such as losing and regaining window focus and vsync/other sync configurations-- though I have not found any success looking into these.

---

<div class="post-metadata">

**Author:** ![Razdraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Razdraz](https://forums.unrealengine.com/u/Razdraz)\
**Post date:** [April 14, 2025, 8:33am UTC](https://forums.unrealengine.com/t/rhi-flush-resources-costly/1750272/4 "2025-04-14T08:33:28Z")

</div>

Very interested in this problem. I am optimizing my game and started having this issue with large EndFlushResourcesRHI times like two days ago. I get up to 20ms for this which drops fps down to like 30. Didn’t dig deep yet but figured out that it appears in every dev-build. Packaged for shipping is just fine. It’s almost impossible to continue work like this.

Did anyone figure this out yet?

(Working on UE 5.4.4)

---

<div class="post-metadata">

**Author:** ![Razdraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Razdraz](https://forums.unrealengine.com/u/Razdraz)\
**Post date:** [April 16, 2025, 4:04pm UTC](https://forums.unrealengine.com/t/rhi-flush-resources-costly/1750272/5 "2025-04-16T16:04:37Z")

</div>

okay, after days of frustration I figured it out. I started to inspect every warning in the Output Log and tried to get rid of it. One warning was: “LogD3D12RHI: Warning: Failed to query NVIDIA driver version”.  
I then searched in source code to find the code and reproduced the call to `NvAPI_SYS_GetDriverAndBranchVersion(&DriverVersion, BranchString);` and found that the return value was `NVAPI_NO_IMPLEMENTATION ` which sounded strange. I googled a bit and found something connected to RenderDoc (totally different problem) and I remembered that I had installed RenderDoc-Plugin a few days ago to investigate some rendering stuff. Uninstalling RenderDoc solved it for me, yay.
