DirectXTK12
DirectXTK12 copied to clipboard
GenerateMips is causing TDR
When using GenerateMips API, driver is resulting in TDR. Not sure of what is actually causing this problem.
Debug layers were enabled, following is the output which was received:
D3D12 ERROR: ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #232: DEVICE_REMOVAL_PROCESS_AT_FAULT]
Any idea on how to proceed further?
To provide more details:
- Format is DXGI_FORMAT_R8G8B8A8_UNORM
- Image size is 640x360
- Number of mips to be generated is 4
- TypedUAVLoadAdditionalFormats is supported and StandardSwizzle64KBSupported is not supported
Sometime mipmap generation works and sometimes it doesn't
What GPU are you using?
DxDiag output:
[DxDiag.txt](https://github.com/microsoft/DirectXTK12/files/8896869/DxDiag.txt)
Another observation, I have 2 monitor setup:
Primary monitor: 3840x2400 Secondary monitor: 1920x1080
Issue is seem when application window is moved to secondary monitor, whereas not observed when application window is in primary monitor.
Application architecture:
- WinUI3, rendering using D3D11 integrated using composition
- Camera capture using D3D11 device manager -> background blur using WinML (D3D12) -> Mipmap generation -> merge of camera output + WinML output + mipmap blur
We have other blur algorithms, which works perfectly fine.
Sorry, the attachment is missing.
It's likely a driver bug, but you could try D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT
.
Added D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT, since all processing is happening using D3D12. With this change, MipMap generation is working, also I had to wait for execution completion after ExecuteCommandLists API is called.
Any concerns with respect to using the timeout flag?
Upon further testing, I see that sometimes, MipMap generation works and sometimes it doesn't work, but TDR is gone. Also when debug is enabled, then it seems to work consistently.
Any further ideas?
I suggest reporting this as a driver bug to Intel.