Seemingly random launch error using optix 4

Hi all,

I have my optix based vertex AO solution running pretty well, except for a seemingly random launch error.
The error occurs at different times during the multi-launch (the level I am testing has 1531 launches) bake.
Previously when I encountered this error I was able to relaunch the editor and bake again successfully without running into the problem, but this one level seems to always hit the error sometime during the bake.

Here’s the error messsage:

Unknown error (Details: Function "_rtContextLaunch1D" caught exception: Assertion failed: "it != m_idMap.end() : id not found", file:C:\u\workspace\goldenrod-win64-build\sw\wsapps\raytracing\rtsdk\playpen\goldenrod\shared/Util/ReusableIDMap.h, line: 112)


I figured out what was causing this, but not why it was causing it.

Basically each mesh has multiple launches for it to keep the number of rays-in-flight sane. Basically I allow 512x512 launches, each of which cause 16 AO rays to be generated.

The problem was that, due to a bad sort predicate in my code, it was possible to start a new mesh’s AO bake in the middle of another mesh’s. Now this shouldn’t be a big deal because each mesh has its own sample and output buffers, but something about deleting one mesh’s buffers while another mesh was still “active” randomly caused this error to appear.

To clarify, a mesh being “active” means it has more launches to do, not that it has currrently active launches. No buffers are created or destroyed in any way while a launch is in process.

– Martin

Does this only happen with OptiX 4.0 beta 1 (according to your title)?
Have you tried this with the stable OptiX 3.9.0 release as well?

This could just be a bug in OptiX 4.0 beta 1 when updating scene nodes.

Independent of the outcome of OptiX 3.9.0 tests, it would be highly appreciated if you could capture an API trace and provide this as reproducer to check if the current OptiX 4.0 development branch fixes this issue internally.

Search for “OptiX API Capture” or “OAC” on this OptiX forum for a description how to enable that.