jrouwe/JoltPhysics

DirectX Error

Closed this issue · 5 comments

Hi there,

I just got windows to test out the Jolt Samples, I'm compiling with msys2 using the urct profile. I followed the steps in the Build directory and everything compiled correctly and all tests pass.

When I try to run Samples.exe I get the following error:

image

I tried looking up this error but I haven't been able to find the cause, the computer is a lenovo thinkpad T470:
image
image

The error is:

DXGI_ERROR_DEVICE_REMOVED
0x887A0005

which is a very generic error that doesn't say much.

First thing to check is if your graphics drivers are up to date.

Next thing would be to run Samples in Debug mode and look at the debugger output (usually it traces a meaningful message because the DirectX debug layer is active in debug mode). Easiest way to get to the debugger output is to compile and run everything using Visual Studio 2022 (free to download). In MSYS2 it is probably also possible but you'll need an external tool like DebugView++ to view the debug output.

Perhaps you can also break the application when the error message triggers to get the callstack (and line number) where the problem happens.

Ok, so I was able to get some more info through the CLion IDE which gives me some easy debugging utilities. I chose to use CLion because it seems more similar to my linux experience.

It comes bundled with a toolchain, which is as follows: (if that info is useful)

image

Here I'm attempting to run Samples with debugging.

image

[New Thread 2412.0xcc0]
warning: D3D Error 887e0003: (2504@14664953) at 00007FFC02F8F985 - Using the Redistributable D3D12 SDKLayers dll also requires that the latest SDKLayers for Windows 10 is installed.
warning: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.
warning: Created font "Arial" with height 24 in a 512x256 surface
warning: D3D12: Removing Device.
warning: Fatal Error: DirectX error returned: -2005270523 (The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action)
[Thread 2412.0x296c exited with code 1]

I managed to solve the above problem by enabling "Graphics Tools" which is an optional windows settings. To enable it you have to press the windows key, search for manage optional features, and then click add a features, and install Graphics Tools. This probably automatically happens with VS so might not have been noted down in the build guide for windows.


Now building and attempting to run Samples gives the following feedback:

image

[New Thread 7636.0x2ce4]
warning: Created font "Arial" with height 24 in a 512x256 surface
warning: D3D12 ERROR: ID3D12Device::CreateShaderResourceView: The Format (0x29, R32_FLOAT) is invalid when creating a View; the Resource was already created with a fully qualified Format, which is not castable (0x28, D32_FLOAT). [ STATE_CREATION ERROR #28: CREATESHADERRESOURCEVIEW_INVALIDFORMAT]
warning: D3D12: **BREAK** enabled for the previous message, which was: [ ERROR STATE_CREATION #28: CREATESHADERRESOURCEVIEW_INVALIDFORMAT ]
gdb: unknown target exception 0x0000087a at 0x7ffc1578cf19

image

Specifically this error is eminating from this line

I believe the problem here is that on line 179 we are giving a specific format: srv_desc.Format = DXGI_FORMAT_R32_FLOAT;, and for some reason that type is not allowed, I'm not exactly sure...

I don't know why that's not allowed on your machine, on my machine that's the only value that is allowed.

You can work around this by commenting out the shadow rendering code:

https://github.com/jrouwe/JoltPhysics/tree/test/no_shadows

Hey @jrouwe I just tested on the test/no-shadow branch, on this branch when I compile and run the Samples target I get everything running just without shadows.

Adding the patch for future reference before deleting the branch:

no_shadows.patch