interprocess communication on single GPU ?

Hi,

I’m trying to share a buffer between 2 processes on a single GPU.
Therefore, I use the IPC functions: cudaIpcGetMemHandle in one process, sending it over using Unix domain sockets to the other process, and cudaIpcOpenMemHandle to get the pointer in the second process.
However, I always get an “Runtime API error 30: unknown error.”.
My question is: is this scenario supposed to work, as the flag “cudaIpcMemLazyEnablePeerAccess” seems to suggest the requirement for 2 GPUs ?

For events (i.e. cudaIpcGetEventHandle resp. cudaIpcOpenEventHandle) using the same approach, I do not have any problem.

Even when I use the commands in a single process, I get the error: e.g.

char *d_buffer;
char *d_ret_buffer;
cudaIpcMemHandle_t handle;

cutilSafeCall(cudaMalloc((void **)&d_buffer, 5005004));
cutilSafeCall(cudaIpcGetMemHandle(&handle, d_buffer));
cutilSafeCall(cudaIpcOpenMemHandle((void **)&d_ret_buffer, handle, 0)); => cudaSafeCall() Runtime API error 30: unknown error.

Am I missing something ?

Are you on Linux with device supporting unified addressing?

From CUDA Toolkit Documentation

“IPC functionality is restricted to devices with support for unified addressing on Linux operating systems.”