Access Unified Memory location from two different application

How can I use a managed memory location allocated with cudaMallocManaged in C++ program from another application of Python? I have tried to use
(ctypes.c_char*size).from_address(pointerFromCplusplus) i.e pointerFromCplusplus = 0x7fdfcaf5f8
But this gives me segmentation fault!

Basically, what I want is to use a unified memory location from two different application which are running in C++ (manages the memory) and Python (uses the data for processing in GPU). Thanks for the help.

The segmentation fault is expected. In general, an address that has “meaning” in one process does not necessarily have meaning in another process. Even if it does have meaning the general concepts of process isolation in most modern operating systems preclude this kind of idea (naively passing a numerical pointer value from one process to another).

You may wish to investigate IPC methods. (IPC = inter-process communication)

CUDA provides an IPC subsystem for device memory, i.e. memory allocated with cudaMalloc, not cudaMallocManaged. Otherwise there are host-based IPC methods, which are not unique or specific to CUDA.

Thank you for your quick response! Does that mean I can not use the benefit of Unified memory (accessed by both CPU and GPU, I can use from a single process) between two different applications running on same host machine?

I will say this: I personally don’t know how to do IPC with managed memory. It seems that I am not alone.