How to debug: OptiX result code: -1, Unknown error

While developing and testing my OptiX application, I sometimes encounter error messages like this:

Mapping buffer: OptiX result code: -1, Unknown error 
(Details: Function "RTresult _rtBufferMap(RTbuffer, void**)" caught exception:
Encountered a CUDA error
driver().cuMemcpyDtoH(static_cast<char *>(dst) + dstOffset, src + srcOffset, bytes) returned (700):
Unknown, [6750375])

Is there any way to get a more specific and helpful description of what went wrong?

How often is “sometimes”?

With CUDA 5.5 that is a generic “launch failed” error inside CUDA which can be many things, in this case the copy from device to host for the buffer mapping failed, so anything around that specific buffer should be checked for consistency. Alignment and out of bounds access would have their own error codes but should be checked as well.

You could try to run it under Nsight and see if that gives more information while the error happens.

I take errors like these as an indicator to update to the newest driver, then to the newest OptiX version when available.
If it stills fails afterwards, you could contact the OptiX team via the support e-mail address you’ll find inside the release notes to exchange a reproducer and exact system configuration information.

This and similar errors occur when playing around with ray tracing parameters, e.g. number of rays, number of reflections, …
I already updated to CUDA 6, OptiX 3.6 and the latest Linux driver.

I will try Nsight.

I just thought that maybe it is possible to get a more detailed error description to find out which buffer caused the problem and why.

With CUDA 6.0 that error 700 is an illegal address. (The defines in cuda.h changed. Don’t know why.)

I’ve seen one of these in the past related to acceleration structures (which is fixed), so maybe try different acceleration structure builders if possible.

Thanks for pointing out the meaning of the error code, I found out what caused the error: It was an out-of-bounds access of a local array within the ray-generation-program.
Confusingly, this error was reported when mapping a buffer after the context launch.