Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Crash: Warning or error detected by ID3D12InfoQueue #160

Open
hawkerm opened this issue Nov 12, 2021 · 3 comments
Open

Random Crash: Warning or error detected by ID3D12InfoQueue #160

hawkerm opened this issue Nov 12, 2021 · 3 comments
Labels
bug 🐛 Something isn't working need more info 🔍 An issue that needs more info to be investigated

Comments

@hawkerm
Copy link
Sponsor Contributor

hawkerm commented Nov 12, 2021

Description (optional)

Happened when I tried to change shader examples, but noticed another time my shader may be doing something weird, so not too sure what happened here... This may just be a weird state of a lot of different things happening at once on my fraken-branch. At least wanted to log the stack trace here as it may have seemed by the comment that the GPU was overloaded by the number of shaders being processed with the sample app, so could be good not to crash at least?

Reproduction Steps

🤷‍♂️

Expected Behavior

This section should contain a description of the behavior that is expected.

Actual Behavior

This section should contain a description of the actual behavior being observed.

System info

This section should contain useful info such as:

  • ComputeSharp NuGet version (or branch/commit, if building from source)
  • Operating system version
  • CPU/GPU model (the latter is especially useful for shader issues)
  • Visual Studio version, or .NET SDK/runtime version

Additional context (optional)

System.ComponentModel.Win32Exception
  HResult=0x80004005
  Message=Warning or error detected by ID3D12InfoQueue
  Source=Microsoft.Toolkit.Diagnostics
  StackTrace:
   at Microsoft.Toolkit.Diagnostics.ThrowHelper.ThrowWin32Exception(String message)
   at ComputeSharp.Graphics.Commands.Interop.ID3D12CommandListPool.Rent(ID3D12Device* d3D12Device, ID3D12PipelineState* d3D12PipelineState, ID3D12GraphicsCommandList*& d3D12CommandList, ID3D12CommandAllocator*& d3D12CommandAllocator) in I:\code\ComputeSharp\src\ComputeSharp\Graphics\Commands\Interop\ID3D12CommandListPool.cs:line 64
   at ComputeSharp.Graphics.Commands.CommandList..ctor(GraphicsDevice device, ID3D12PipelineState* d3D12PipelineState) in I:\code\ComputeSharp\src\ComputeSharp\Graphics\Commands\CommandList.cs:line 78
   at ComputeSharp.Shaders.ShaderRunner`1.Run[TPixel](GraphicsDevice device, IReadWriteTexture2D`1 texture, T& shader) in I:\code\ComputeSharp\src\ComputeSharp\Shaders\ShaderRunner{T}.cs:line 200
   at ComputeSharp.GraphicsDeviceExtensions.ForEach[T,TPixel](GraphicsDevice device, IReadWriteTexture2D`1 texture, T& shader) in I:\code\ComputeSharp\src\ComputeSharp\Graphics\Extensions\GraphicsDeviceExtensions.Dispatching.cs:line 97
   at ComputeSharp.WinUI.ShaderRunner`1.Execute(ReadWriteTexture2D`2 texture, TimeSpan time) in I:\code\ComputeSharp\src\ComputeSharp.WinUI\ShaderRunner{T}.cs:line 39
   at ComputeSharp.WinUI.ComputeShaderPanel.OnUpdate(TimeSpan time) in I:\code\ComputeSharp\src\ComputeSharp.WinUI\Controls\ComputeShaderPanel.Rendering.cs:line 351
   at ComputeSharp.WinUI.ComputeShaderPanel.<OnStartRenderLoop>g__ExecuteRenderLoop|55_0(ComputeShaderPanel this) in I:\code\ComputeSharp\src\ComputeSharp.WinUI\Controls\ComputeShaderPanel.Rendering.cs:line 484
   at ComputeSharp.WinUI.ComputeShaderPanel.<>c.<OnStartRenderLoop>b__55_1(Object args) in I:\code\ComputeSharp\src\ComputeSharp.WinUI\Controls\ComputeShaderPanel.Rendering.cs:line 491
   at System.Threading.Thread.StartCallback()
@hawkerm hawkerm added bug 🐛 Something isn't working untriaged 🧰 A new issue that needs initial triage labels Nov 12, 2021
@Sergio0694 Sergio0694 removed the untriaged 🧰 A new issue that needs initial triage label Nov 12, 2021
@Sergio0694
Copy link
Owner

I really wish you had also included the actual debug info 😅
When something like this happens again, check the debug console, there will be a whole lot of debug statements there with useful information on why the crash happened. Please include them too if you can repro this, as they help a lot! 😄

@Sergio0694 Sergio0694 added the need more info 🔍 An issue that needs more info to be investigated label Nov 12, 2021
@hawkerm
Copy link
Sponsor Contributor Author

hawkerm commented Nov 13, 2021

Got another weird exception (though in my weird branch):

Exception thrown at 0x00007FFAC4BDDF3B (d3d12SDKLayers.dll) in ComputeSharp.SwapChain.WinUI.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
 	d3d12SDKLayers.dll!NDebug::CCommandAllocator::Reset(void)	Unknown
 	[External Code]	
>	ComputeSharp.dll!ComputeSharp.Graphics.Commands.Interop.ID3D12CommandListPool.Rent(TerraFX.Interop.ID3D12Device* d3D12Device, TerraFX.Interop.ID3D12PipelineState* d3D12PipelineState, out TerraFX.Interop.ID3D12GraphicsCommandList* d3D12CommandList, out TerraFX.Interop.ID3D12CommandAllocator* d3D12CommandAllocator) Line 63	C#
 	ComputeSharp.dll!ComputeSharp.Graphics.Commands.CommandList.CommandList(ComputeSharp.GraphicsDevice device, TerraFX.Interop.ID3D12PipelineState* d3D12PipelineState) Line 78	C#
 	ComputeSharp.dll!ComputeSharp.Shaders.ShaderRunner<ComputeSharp.SwapChain.Shaders.MengerJourney>.Run<ComputeSharp.Float4>(ComputeSharp.GraphicsDevice device, ComputeSharp.IReadWriteTexture2D<ComputeSharp.Float4> texture, ref ComputeSharp.SwapChain.Shaders.MengerJourney shader) Line 200	C#
 	ComputeSharp.dll!ComputeSharp.GraphicsDeviceExtensions.ForEach<ComputeSharp.SwapChain.Shaders.MengerJourney, ComputeSharp.Float4>(ComputeSharp.GraphicsDevice device, ComputeSharp.IReadWriteTexture2D<ComputeSharp.Float4> texture, ComputeSharp.SwapChain.Shaders.MengerJourney shader) Line 97	C#
 	ComputeSharp.WinUI.dll!ComputeSharp.WinUI.ShaderRunner<ComputeSharp.SwapChain.Shaders.MengerJourney>.Execute(ComputeSharp.ReadWriteTexture2D<ComputeSharp.Rgba32, ComputeSharp.Float4> texture, System.TimeSpan time) Line 39	C#
 	ComputeSharp.WinUI.dll!ComputeSharp.WinUI.ComputeShaderPanel.OnUpdate(System.TimeSpan time) Line 351	C#
 	ComputeSharp.WinUI.dll!ComputeSharp.WinUI.ComputeShaderPanel.OnStartRenderLoop.__ExecuteRenderLoop|55_0(ComputeSharp.WinUI.ComputeShaderPanel this) Line 471	C#
 	ComputeSharp.WinUI.dll!ComputeSharp.WinUI.ComputeShaderPanel.OnStartRenderLoop.AnonymousMethod__55_1(object args) Line 478	C#

First hit a weird breakpoint exception message, in the debug log here:

Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577CF0.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577B50.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577B50.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C825779B0.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577950.
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Program Files\NVIDIA Corporation\Ansel\NvCameraAllowlisting64.dll'. 
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Unloaded 'C:\Program Files\NVIDIA Corporation\Ansel\NvCameraAllowlisting64.dll'
Exception thrown at 0x00007FFBA7374F99 (KernelBase.dll) in ComputeSharp.SwapChain.WinUI.exe: 0x40080202: WinRT transform error (parameters: 0x000000008000000B, 0x0000000080070490, 0x0000000000000014, 0x0000001C82579F40).
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Energy.dll'. 
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Windows\System32\rmclient.dll'. 
Exception thrown at 0x00007FFBA7374F99 (KernelBase.dll) in ComputeSharp.SwapChain.WinUI.exe: 0x40080202: WinRT transform error (parameters: 0x000000008000000B, 0x0000000080070490, 0x0000000000000014, 0x0000001C8257CEB0).
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C8257CEE0.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C8257CEE0.
onecoreuap\windows\frameworkudk\dxprivatescommon.cpp(53)\Microsoft.Internal.FrameworkUdk.dll!00007FFAF51698A5: (caller: 00007FFAF51A966D) ReturnHr(5) tid(b48) 80004002 No such interface supported
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Windows\System32\UIAnimation.dll'. 
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Windows\System32\Windows.FileExplorer.Common.dll'. 
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Windows\System32\mssprxy.dll'. 
The thread 0x45a4 has exited with code 0 (0x0).
The thread 0x7694 has exited with code 0 (0x0).
The thread 0x3adc has exited with code 0 (0x0).
The thread 0x3c28 has exited with code 0 (0x0).
The thread 0x66b8 has exited with code 0 (0x0).
The thread 0x1a24 has exited with code 0 (0x0).
The thread 0x60d8 has exited with code 0 (0x0).
The thread 0x6c64 has exited with code 0 (0x0).
The thread 0x4688 has exited with code 0 (0x0).
The thread 0x2248 has exited with code 0 (0x0).
The thread 0x4858 has exited with code 0 (0x0).
The thread 0x1b84 has exited with code 0 (0x0).
The thread 0x2ea8 has exited with code 0 (0x0).
The thread 0x693c has exited with code 0 (0x0).
The thread 0x3384 has exited with code 0 (0x0).
The thread 0x23f0 has exited with code 0 (0x0).
The thread 0x2f6c has exited with code 0 (0x0).
The thread 0x11c4 has exited with code 0 (0x0).
Critical error detected c0000374
ComputeSharp.SwapChain.WinUI.exe has triggered a breakpoint.

Exception thrown at 0x00007FFBA976F199 (ntdll.dll) in ComputeSharp.SwapChain.WinUI.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FFBA97D77F0).
Unhandled exception at 0x00007FFBA976F199 (ntdll.dll) in ComputeSharp.SwapChain.WinUI.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FFBA97D77F0).

The thread 0x34f4 has exited with code 0 (0x0).
The thread 0x6f80 has exited with code 0 (0x0).
The thread 0x58fc has exited with code 0 (0x0).
The thread 0x64fc has exited with code 0 (0x0).
The thread 0x34ec has exited with code 0 (0x0).
The thread 0x358c has exited with code 0 (0x0).
The thread 0x3d48 has exited with code 0 (0x0).
The thread 0x8d0 has exited with code 0 (0x0).
The thread 0x3b08 has exited with code 0 (0x0).
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577D60.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577BC0.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577BC0.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577A20.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C825779C0.
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Program Files\NVIDIA Corporation\Ansel\NvCameraAllowlisting64.dll'. 
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Unloaded 'C:\Program Files\NVIDIA Corporation\Ansel\NvCameraAllowlisting64.dll'
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C8257D020.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C8257D020.
onecoreuap\windows\frameworkudk\dxprivatescommon.cpp(53)\Microsoft.Internal.FrameworkUdk.dll!00007FFAF51698A5: (caller: 00007FFAF51A966D) ReturnHr(6) tid(b48) 80004002 No such interface supported
The thread 0x6b98 has exited with code 0 (0x0).
The thread 0x22b4 has exited with code 0 (0x0).
The thread 0x45ac has exited with code 0 (0x0).
The thread 0x71fc has exited with code 0 (0x0).
The thread 0x3430 has exited with code 0 (0x0).
The thread 0x28e8 has exited with code 0 (0x0).
The thread 0x3570 has exited with code 0 (0x0).
The thread 0x5f9c has exited with code 0 (0x0).
The thread 0x6b9c has exited with code 0 (0x0).
The thread 0x6e14 has exited with code 0 (0x0).
The thread 0x7734 has exited with code 0 (0x0).
The thread 0x64d8 has exited with code 0 (0x0).
The thread 0x70fc has exited with code 0 (0x0).
The thread 0x71b8 has exited with code 0 (0x0).
The thread 0x3ba4 has exited with code 0 (0x0).
The thread 0x6e00 has exited with code 0 (0x0).
The thread 0x2e14 has exited with code 0 (0x0).
The thread 0x1590 has exited with code 0 (0x0).
The thread 0x5c4c has exited with code 0 (0x0).
The thread 0x2890 has exited with code 0 (0x0).
The thread 0x4324 has exited with code 0 (0x0).
The thread 0xbc4 has exited with code 0 (0x0).
The thread 0x1d0c has exited with code 0 (0x0).
The thread 0x3a4 has exited with code 0 (0x0).
The thread 0x6344 has exited with code 0 (0x0).
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577D70.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577BD0.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577BD0.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577A70.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C82577A10.
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Loaded 'C:\Program Files\NVIDIA Corporation\Ansel\NvCameraAllowlisting64.dll'. 
'ComputeSharp.SwapChain.WinUI.exe' (Win32): Unloaded 'C:\Program Files\NVIDIA Corporation\Ansel\NvCameraAllowlisting64.dll'
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C8257CF30.
Exception thrown at 0x00007FFBA7374F99 in ComputeSharp.SwapChain.WinUI.exe: Microsoft C++ exception: EEMessageException at memory location 0x0000001C8257CF30.
onecoreuap\windows\frameworkudk\dxprivatescommon.cpp(53)\Microsoft.Internal.FrameworkUdk.dll!00007FFAF51698A5: (caller: 00007FFAF51A966D) ReturnHr(7) tid(b48) 80004002 No such interface supported
Exception thrown at 0x00007FFAC4BDDF3B (d3d12SDKLayers.dll) in ComputeSharp.SwapChain.WinUI.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

@Sergio0694
Copy link
Owner

Possibly related, I just got a random error as well in the Win32 sample:

[D3D12 message #0 for "[53104] NVIDIA GeForce GTX 1050" (HW: True, UMA: False)]
[Category]: D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION
[Severity]: D3D12_MESSAGE_SEVERITY_ERROR
[ID]: D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE
[Description]: "ID3D12CommandQueue::Present: Resource state (0x800: D3D12_RESOURCE_STATE_COPY_SOURCE) (promoted from COMMON state) of resource (0x000001A547D6FA70:'Unnamed ID3D12Resource Object') (subresource: 0) must be in COMMON state when transitioning to use in a different Command List type, because resource state on previous Command List type : D3D12_COMMAND_LIST_TYPE_COPY, is actually incompatible and different from that on the next Command List type : D3D12_COMMAND_LIST_TYPE_DIRECT."
Exception thrown: 'System.ComponentModel.Win32Exception' in CommunityToolkit.Diagnostics.dll
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in CommunityToolkit.Diagnostics.dll
Warning or error detected by ID3D12InfoQueue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working need more info 🔍 An issue that needs more info to be investigated
Projects
None yet
Development

No branches or pull requests

2 participants