GPU Compute Software
Ask questions about Intel® Graphics Compute software technologies, such as OpenCL* GPU driver and oneAPI Level Zero
358 Discussions

Sharing SYCL buffers accross processes with Unified Memory Framework IPC in SYCL?

atol
Beginner
1,417 Views

Just out of curiosity, I was wondering whether it is possible to implement a sort of unix-like pipeline with 2 SYCL programs? I.e. launch 2 separate processes with SYCL runtimes, allocate a buffer (possibly on a device), and pass some kind of handle/URL/UUID of the buffer to both processes, like in a shell pipeline:

sycl1 | sycl2

My guess, it is not possible. At least not in the current SYCL spec. I think you cannot share a runtime between processes. Neither buffers. Because, for example, how would SYCL runtimes of separate processes figure out data dependencies between buffer accessors that are created in these separate processes? And there are probably no persistent buffers, which could outlive runtimes.

I tried to just fork() a SYCL program on Tiber Cloud, and it crashed with UR_RESULT_ERROR_OUT_OF_RESOURCES error. For completeness, launching sycl::queue submit() inside a thread is fine. I suppose, you only have to make sure the order of submit() calls is correct, since they are made in concurrent threads.

Probably, it should be possible to use MPI for this sort of IPC between SYCL processes. Although, that's probably more overhead than just (somehow) share a buffer between them.

But then I stumbled on Intel Unified Memory Framework, which says the following about its IPC API:

The IPC API allows sharing of memory objects, allocated from UMF memory pools, across different processes. Since each process has its own virtual address space, there is no guarantee that the same virtual address will be available when the memory object is shared in a new process. There is a set of UMF APIs that makes it easier to share the memory objects with ease.

Does Intel's SYCL implementation (DPC++) use the Unified Memory Framework? And is it possible to somehow use the UMF IPC API in SYCL to connect two processes over one memory buffer, as if they were sharing the same SYCL runtime? Maybe, you could instantiate a SYCL buffer with a UMF memory pool allocator or something like that?

I am quite new to SYCL. Sorry for possible misunderstandings on my part!

0 Kudos
0 Replies
Reply