We have seen this error with 4.0 in another case and are looking into it. It is likely happening when you assign a Material over another Material, both of which share a common optix::Program (eg, closest hit). Does this sound familiar? If you can provide more details on the operation which is causing the failure I can help you find a workaround.
Also, if possible can you provide us with an API trace to help us better understand the problem? You can send it to email@example.com (details on creating a trace below).
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 upload location.
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.