Optix programming guide described two context sharing ways. My program uses optix to update a device array and will take the first way: CUDA creates context before Optix initialization.
According to programming guide, " The application has created a CUDA context (by performing some CUDA runtime operations) prior to OptiX initialization. OptiX will latch on to the existing CUDA context owned by the runtime API instead of creating its own."
In this case, am I allowed to call
rtContextCreate( context ); rtContextLaunch1D( context, ...)
? If not, what should I do to launch the optix programs?
Currently, I called these functions in optix. The device array created in CUDA can be passed to optix and read normally. But after optix hands the array(pointer) back to cuda, the pointer never works well.
- If the pointer handed back from optix is passed to a device function, the function seems to be skipped and my program ends normally.
- If the pointer handed back from optix is passed back to optix again, the ray tracing program works well again and my program ends normally.
- If the pointer handed back from optix is passed to a device function before passed to optix, optix exits due to error before launching programs.
OptiX Error: Unknown error (Details: Function “RTresult _rtBufferSetDevicePointer(RTbuffer, unsigned int, CUdeviceptr)” caught exception: Encountered a CUDA error: result returned (700): Unknown, )