[OptiX 7.5] Debuggable OptiX-IR makes isnan() not working

Hello, I’m testing OptiX-IR instead of PTX input.
I have found that kernels compiled as OptiX-IR for debugging make the isnan() function in kernels not working.

“Debuggable” here means the pipeline and the module are compiled/linked with OPTIX_COMPILE_OPTIMIZATION_LEVEL_0 / OPTIX_COMPILE_DEBUG_LEVEL_FULL, and OptiX-IR uses -G -O0 and PTX uses -lineinfo as compile options.

I made a very simple reproducer.

This repro runs the same kernel with 4 configurations (Release ptx, Release optix-ir, Debuggable ptx, Debuggable optix-ir).
The kernel simply print a NaN:

float v = 0.0f / 0.0f;
printf("%f, (isnan: %u, 0x%08x)\n",
       v, isnan(v), __float_as_uint(v));

All the configurations but Debuggable OptiX-IR print:
-nan(ind), (isnan: 1, 0xffc00000)
Debuggable OptiX-IR prints:
-nan(ind), (isnan: 0, 0xffc00000)


My Environment:
OptiX 7.5.0 / CUDA 11.7
Driver: 516.94
Visual Studio 2022 17.3.3
Windows 10 21H2
RTX 3080 10GB

This reproduces for me in an unreleased driver, so I’ve filed a bug report. Thank you for taking the time to make such a nice reproducer!!


Hey BTW I completely forgot to ask about workarounds.

Are you unblocked and able to continue working by using the test (v != v) in place of isnan(v)? I tried this on your reproducer, and it reports a correct “1” for all cases including the OptiX-IR+Debug config. I just wanted to make sure there isn’t more to it, and that this bug isn’t blocking your development.


Thanks for letting me know.

OptiX-IR bug is not the blocker for me since we can still use ptx as the input. However OptiX-IR seems not ready as the default input because this bug made me feel there are other potential weird behaviors with other things than isnan() and it also has another bug I reported as you know … :(

Well, debugging with OptiX-IR seems still beta according to the release note though.

I can wait for now for the fixed driver and/or the next OptiX update (and I’m looking forward to see how OptiX API looks like to support OMM and DMM for Ada-Lovelace :) )

1 Like