Why I always show up this error??

Unknown error (Details: Function “_rtContextLaunch2D” caught exception: Encountered a CUDA error: driver().cuMemcpyDtoHAsync( dstHost, srcDevice, byteCount, hStream.get() ) returned (716): Misaligned address)

This error bothers me for a couple of weeks, I find it much harder to resolve, and I’v no idea on how to debug. I can’t reproduce it with a new project except my solution which is a big cake. Anyone encountered with it? any hints will be appreciated.

Not always but sometimes.

The given information aren’t sufficient to tell what goes wrong, so I’m taking some guesses here:

I’ve recently seen this in a reproducer using OptiX 4.1.0 where the same Acceleration object was used for nodes of different types, in that case the root Group node and the GeometryGroup holding the scene’s geometry data underneath. That would be wrong and you’d need to use different Acceleration objects for these nodes.
Mind that OptiX allows you to share Acceleration structures among GeometryGroups when the underlying Geometry is exactly the same.

If that’s not it, there could still be something wrong with how you built the OptiX scene graph which could lead to such an error. Please verify all your OptiX scene graph nodes for consistency and correctness of the sizes and number of children, etc.

Other than that, make sure that all your own data structures adhere to the CUDA alignment requirements for all data types.
Complete table here: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#vector-types

That great of you guys answering my question. Thanks a lot.

I’v checked my node graph along with acc objects and I found it all setted right. And I will check data structure alignment error.

I have a strong sense of figuring out the enssential of my problem,or at least writing a demo of that. And if that were done I would write the detail here.

See ya :)

I’ve encountered this error before and ended up getting around it by not setting the “refine” and “refit” acceleration properties in my graph node.