Debugging in OptiX 7.5

Thanks for the update!. I’m really looking forward to the new debugging tools.

  • Preview of symbolic debugging, including breakpoint, virtual call stack, and variable inspection support

By Preview, do you mean that this release is not fully ready for use? I’ve had success stepping through some of the simpler SDK samples like optixHello and optixTriangle but I’m not seeing a values for symbols when stepping through optixPathTracer

OptiX 7.5.0 / CUDA 11.7
Driver: 516.40
Visual Studio 2022 17.2.4
Windows 10
RTX 2070 SUPER

Hi @Bird33!

Yes good question. We are calling this a “preview” because indeed it is not fully functional yet, it works well in certain cases and not well in other cases, and we wanted to make sure users understand that this isn’t completely production ready. I’m putting together a video to explain in more detail what currently works.

As of right now, functions that have continuations in them can confuse the debugger. This means any call with optixTrace() or with a continuation callable call. I’m guessing your closest hit shader in this screenshot has one of those things. (If your virtual call stack is correct, I assume you have a trace call and that you’re stopped on a recursive invocation of closest hit.) You can try commenting the call and then seeing how your local variable inspection changes. Another thing that can cause issues is C structs, sometimes they aren’t displayed correctly or at all, whereas POD types (plain ol’ data like int/float) should appear correct. Knowing these limitations might in some cases allow you to write code that is slightly more debugger friendly, just be aware that we will be fixing these temporary limitations as soon as we can.

The virtual call stack can also get a little confused by continuations at the moment, but you may notice how useful the virtual callstack can be. It will show inlined function calls as if they are on the stack. This is a big improvement over not being able to see where an inlined function was called from. We are working toward exposing the virtual call stacks in Nsight Compute as well.

Breakpoints at the moment should work quite well, and crashes on memory access errors are also quite often helpful even when local variable inspection doesn’t work. We thought there was enough working in the debugger that it was worth “previewing” the progress and getting some feedback. The good news is that debugging will improve from here with driver updates, and won’t require an SDK upgrade.


David.

Thanks for the info and I’m looking forward to seeing the video. I’m very happy to step through variables once again in OptiX instead of having to use a lot of printf’s :)