DXR and Device Hung Error

Started by
7 comments, last by _void_ 4 years, 7 months ago

Hey guys,

 

I am working on my very first DXR "hello triangle" and hitting "DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung" in Present call.

My program consists of ray generation, closest hit and miss shaders.

I noticed that if I remove TraceRay call and write the result to output texture it works OK.

I have checked twice all the setup and everything seems to be OK and debug layer does not complain.

I have no more ideas what I could check. I am on GTX 1070 with the latest driver version.

 

Any suggestions? Thanks!

Advertisement

The list of ways to hang the GPU when using DXR is as long as my arm.

Have you considered:

  1. Setting the recursion level too low when creating your RTPSO?
  2. Setting the payload size too low when creating your RTPSO?
  3. Setting the attribute size too low when creating your RTPSO?
  4. Forgetting to bind the Top Level Acceleration Structure?
  5. Forgetting to initialise the shader identifier for your hit group?
  6. Forgetting to initialise the shader identifier for your miss shader?
  7. Using unbound resources in the global root signature?
  8. Using unbound resources in the local root signature?
  9. Using a TLAS or BLAS before it has completed building?

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

@Adam Miles Thank you for the input!

1.I have only one triangle and set max recursion depth to 1.

4.I setup TLAS to be visibile only to the ray generation shader, using a local root signature. Local root signatures for the closet hit and miss shaders are empty. I bind TLAS and OutputTexture to root arguments on shader record when populating the ray generation shader table. Writing to OuputTexture without doing TraceRay works fine.

Rest of the points seem to be alright.

You're going to need to simplify what you've got as much as possible (or post something someone can run).

Try calling TraceRay with the "SKIP_CLOSEST_HIT_SHADER" flag to eliminate that as a cause of the hang. Try setting the miss shader Shader Identifier to null so it never gets executed. Remove all code from Closest Hit / Miss Shader etc.

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

@_void_ Using the project you linked in a PM I can see the GPU hang you report.

When trying to view the Acceleration Structure in PIX it was clear you'd created the TLAS SRV as a StructuredBuffer which is not what you're supposed to do. This StructuredBuffer was created with NumElements = 1, StructureByteStride = which isn't going to work.

According to the DXR spec you're supposed to create TLAS SRVs as 'Raw' SRVs. I've never actually tried creating a Raw SRV of a TLAS and then putting it inside the shader binding table / ray gen shader's local root signature. When I tried it, the hang continued...

As a 'fix' (and this is what I do normally anyway), I put the TLAS as a Root SRV in the Global Root Signature instead and this works.

image.thumb.png.526d97113623be8d626699bcbadef5f1.png

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

@Adam Miles Thank you for the help and swift response!

I have switched to raw SRVs to represent BLAS and TLAS and moved all the resources to SRV table on global root signature but I am still hitting the hang ? Was there something more you forgot to mention? I uploaded my latest changes.

I checked your latest changes and the one thing you didn't do was make the TLAS a 'Root' Shader Resource View. I'm just about to jump on a plane, so I've attached a modified RayTracingPass.cpp you can diff with yours and see the 4 changes I made.

It should be possible to have a TLAS be inside a Descriptor Table, but I would need to debug it further when I get home to figure out why a RootSRV works but an SRV in a Descriptor Table doesn't.

RayTracingPass.cpp

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

@Adam Miles It does work with RootSRV! Thanks!

This topic is closed to new replies.

Advertisement