I’m trying to pass Optix a pointer to device memory created in prior running CUDA code, to act as an input buffer (density values for a voxel grid).
A piece of the code:
rtBufferCreateForCUDA(context, RT_BUFFER_INPUT, &inputBuffer) // Setup the input buffer rtBufferSetFormat(inputBuffer, RT_FORMAT_FLOAT) rtBufferSetSize1D(inputBuffer, tsdf->bufferSize) rtBufferSetDevicePointer(inputBuffer, 0, (CUdeviceptr)tsdf->bufferPtr)
I’ve removed the error checks to make it easier to read.
The bufferPtr has previously been cudaMalloc’d and then cudaMemcpy’d in the previously mentioned CUDA code.
Upon running this code, rtBufferSetDevicePointer causes 2 first-chance exceptions:
- Microsoft C++ exception: optix::GLContextCreateError at memory location
- Microsoft C++ exception: cudaError at memory location
however this does not cause the function call to return an error (or halt my program).
This later upon the rtContextLaunch call causes another exception, and returns an error
- Microsoft C++ exception: optix::CudaError at memory location
The error text returned is:
Unknown error (Details: Function “_rtContextLaunch2D” caught exception: Encountered a CUDA error: cuGLGetDevices() returned (999): Unknown, )HELP
Any help would be greatly appreciated!