I have no experience with CUDA inter-process communication. That’s only available under Linux.
Excerpt from the CUDA Programming Guide on IPC:
Using this API, an application can get the IPC handle for a given device memory pointer using cudaIpcGetMemHandle(), pass it to another process using standard IPC mechanisms (e.g., interprocess shared memory or files), and use cudaIpcOpenMemHandle() to retrieve a device pointer from the IPC handle that is a valid pointer within this other process. Event handles can be shared using similar entry points.
This would make me nervous about the CUdeviceptr in both processes, and rightfully so.
Reading the cudaIpcOpenMemHandle() manual it says:
No guarantees are made about the address returned in
*devPtr
. In particular, multiple processes may not receive the same address for the same handle.
If it’s not the same address it wouldn’t be usable without relocation and optixAccelRelocate() works in-place, which in turn would break the original data in the source process, so that would require a copy anyways.
What would be the real-world use case requiring this?