Is it possible to share CUDA memory between processes on the Jetson Nano? I’m using Cuda 10.2. I was hoping I could call cudaMalloc, fill it with some data with cudaMemcpy and then make this allocation available in another process using cuMemExportToShareableHandle and cuMemImportFromShareableHandle.
When I try this I get CUDA_ERROR_NOT_SUPPORTED as an error code. I’m not sure if that means I’ve set something up incorrectly, or if the operation is completely not supported in any way.
Since CUDA 11.5, only events-sharing IPC APIs are supported on L4T and embedded Linux Tegra devices with compute capability 7.x and higher. The memory-sharing IPC APIs are still not supported on Tegra platforms. EGLStream, NvSci, or the cuMemExportToShareableHandle() / cuMemImportFromShareableHandle() APIs can be used to communicate between CUDA contexts in two processes.
But I’m having trouble interpreting this note. It seems to say that cuMemExportToShareableHandlecan be used to communicate between CUDA contexts in two processes.
So can cuMemExportToShareableHandle be used on the Nano with Cuda 10.2 or not?
(Please note that the below comment is for Jetson Nano. Other platforms may be different.)
Unfortunately, Jetson’s CUDA buffer cannot be shared between processes.
This is because the CUDA context on Jetson is created per process.
So it is not possible for different processes to share the context.
So the part where it says “cuMemExportToShareableHandle() / cuMemImportFromShareableHandle() APIs can be used to communicate between CUDA contexts in two processes.” is that an error? I feel like it’s the exact opposite of what you just said. Does the documentation need to be corrected?