createBufferFromD3D11Resource cause a strange exception!

First, I create a ID3D11buffer m_pDisplayFromOptiXCopy sucessually.
then, I create a redundant optix::Buffer use this d3d buffer as follows:

optixbuffer =  rtContext->createBufferFromD3D11Resource(RT_BUFFER_OUTPUT, m_pDisplayFromOptiXCopy);//RT_FORMAT_FLOAT4, WIDTH, HEIGHT);
optixbuffer ->setFormat(RT_FORMAT_FLOAT4);
optixbuffer ->setSize(m_Width,m_Height);

but, this optixbuffer is not used anywhere.
Last, when the code “rtContext->launch()” is executed, the above code will cause an uncertain exception, and when I comment out above code, the exception disappear.
I wonder to know how the redundant buffer from d3d11 affect the optix kernel?

Could you be more specific about what exception is thrown when you launch? Could you try calling rtContext->validate() before launch() and confirm that the error is thrown be validate?

It could be that the D3D buffer is not fully set up, or some similar config error.