_rtBufferGetDevicePointer caught exception: Assertion failed

Hello,

I want to modify an OptiX buffer within a CUDA kernel, but getting the device pointer somehow fails in certain cases.

Please have a look at the following (simplified, yet working or crashing) examples:

This one works:

optix::Buffer buffer = context->createBuffer(RT_BUFFER_INPUT, RT_FORMAT_FLOAT, 100);
CUdeviceptr ptr;
buffer->setSize(1000);
buffer->getDevicePointer(0, &ptr);

This one crashes:

optix::Buffer buffer = context->createBuffer(RT_BUFFER_INPUT, RT_FORMAT_FLOAT, 100);
CUdeviceptr ptr;
buffer->getDevicePointer(0, &ptr);
buffer->setSize(1000);
buffer->getDevicePointer(0, &ptr);

Unknown error (Details: Function “RTresult _rtBufferGetDevicePointer(RTbuffer_api*, unsigned int, void**)” caught exception: Assertion failed: [2097357])

Can you tell me why?

I’m taking a deep look at this. I think you got a bug…

I’ll let you know (and possibly fix) as soon as possible.

The bug has been fixed and it will be shipped into next OptiX release.

Thanks m_sch, we really appreciate your help! :)

Great, I am looking forward to the next OptiX release. Will this happen before GTC2014? I submitted a talk proposal and (depending on the new features of) OptiX 4.0 (?) might be interesting to evaluate before that.

The next version of OptiX will contain support for CUDA 5.5 as well as numerous bug fixes and new features (no spoilers :). Unfortunately I can’t commit on a firm release date, but we hope to get it out shortly.