DiligentCore icon indicating copy to clipboard operation
DiligentCore copied to clipboard

[bug] :windows 10 : vulkan: release build: dynamic heap exhausted

Open WangHoi opened this issue 1 year ago • 9 comments

😂 I'm so sorry, found another bug.

Steps to re-produce

  1. In code: Make use of SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC
  2. Run the program in Release build on Windows with Vulkan backend.
  3. Click the taskbar app icon, to minimize the rendering window.

Problem

Diligent Engine: Warning: Space in dynamic heap is almost exhausted. Allocation forced wait time of 2.0 ms. Increase the size of the heap by setting EngineVkCreateInfo::DynamicHeapSize to a greater value or optimize dynamic resource usage

I can also re-produce this issue with builtin sample: `GLTFViewer` and `Tutorial27_PostProcessing`.

WangHoi avatar Aug 07 '24 07:08 WangHoi

My guess is vulkan swapchain's present somehow not happen with minimized window. Assosiated dynamic heap recycle code, not running.

WangHoi avatar Aug 07 '24 07:08 WangHoi

What is you Windows version? GPU? Driver version?

TheMostDiligent avatar Aug 07 '24 08:08 TheMostDiligent

Win10 Professional x64 - 22H2 19045.4651 GPU: GTX1070 v556.12 Vulkan: v1.3.224.1

WangHoi avatar Aug 07 '24 08:08 WangHoi

When play with and tracking down this bug with sample Tutorial27_PostProcessing, I may found another small bug in that sample.

around Tutorial27_PostProcessing.cpp, line 303:

CurrCamAttribs.f4ViewportSize = float4{Resolution.x, Resolution.y, 1.f / Resolution.x, 1.f / Resolution.y};

After window resize, it is using previous window size. Should update viewport size first:

Resolution.x = m_PostFXFrameDesc.Width;
Resolution.y = m_PostFXFrameDesc.Height;
CurrCamAttribs.f4ViewportSize = float4{Resolution.x, Resolution.y, 1.f / Resolution.x, 1.f / Resolution.y};

WangHoi avatar Aug 08 '24 02:08 WangHoi

When play with and tracking down this bug with sample Tutorial27_PostProcessing, I may found another small bug in that sample.

around Tutorial27_PostProcessing.cpp, line 303:

CurrCamAttribs.f4ViewportSize = float4{Resolution.x, Resolution.y, 1.f / Resolution.x, 1.f / Resolution.y};

After window resize, it is using previous window size. Should update viewport size first:

Resolution.x = m_PostFXFrameDesc.Width;
Resolution.y = m_PostFXFrameDesc.Height;
CurrCamAttribs.f4ViewportSize = float4{Resolution.x, Resolution.y, 1.f / Resolution.x, 1.f / Resolution.y};

Everything is correct here; we have Source Size and Output Size. The first value determines the size of the render targets, and the second one determines the window size. They should differ because we are using FSR in this tutorial

MikhailGorobets avatar Aug 08 '24 03:08 MikhailGorobets

Got it, I understand what you mean. We just need to move SetupUpsamplingSettings before setting the resolution.

MikhailGorobets avatar Aug 08 '24 03:08 MikhailGorobets

https://github.com/DiligentGraphics/DiligentSamples/pull/188

MikhailGorobets avatar Aug 08 '24 04:08 MikhailGorobets

Does this reproduce in Debug build?

TheMostDiligent avatar Aug 08 '24 21:08 TheMostDiligent

Only reproduce in Release build. And must click the taskbar icon to minimize.

I found that click window's top right minimize button, no warning, strange.

WangHoi avatar Aug 09 '24 15:08 WangHoi