I can’t make that code snippet fail. I don’t think we’ll be able to track this down without a complete reproducer (all your source code and data). It could be something data dependent, so we’re not likely to be able to guess at a reproducer.
You could also rocord an OAC trace from your application and mail it to us. Here’s the info on that:
An OptiX API Capture (OAC) trace contains all OptiX and OptiX Prime API calls made by the application, across the whole run of the application, together with their input data and return values. Traces are most often used for sending bug reproducers to Nvidia, but can also be used to make application benchmarks and for developers to analyze and debug their applications.
To create a trace, set the environment variable OPTIX_API_CAPTURE to 1 and run the application. A directory called oac00000 will be created within the current working directory. If that directory already exists, the number will be incremented to avoid overwriting an existing trace.
Zip the trace directory and send it to Nvidia. We can only receive 10MB files by email, and the extension must be renamed to not be .zip. For larger files, use a file sharing service. We recommend contacting us and we will set up a temporary, secure FTP account for you to upload to.
When sending a trace to Nvidia, please put some effort into keeping it small. If the trace is for debugging, use the smallest effective dataset and shortest number of frames necessary to reproduce the bug. If the trace is to become an OptiX benchmark, the dataset will be larger, but be very precise in the number of frames recorded.
The OAC trace directory contains a trace.oac file, which is a text file containing information about your platform, followed by all OptiX API calls, with their parameters and return values. You can, for example, search for occurrences of “rtContextLaunch” in this file to see all OptiX calls that are made per frame to make sure you’re not doing redundant setup work. The “oac.buf." files in the trace directory contain binary buffer contents, both input and output. Each time a buffer is mapped its contents are stored to a new file. The "oac.ptx.” files contain PTX text of application-provided program code.
Since OAC traces contain contents of all OptiX buffers, they contain the PTX form of the application’s shaders and other user program code, as well as the geometry and texture maps given to OptiX. While Nvidia will keep these secure and never share them, you will want to make sure that sharing a trace with Nvidia meets your institution’s policies.