Use Vulkan image to share data between processes for CUDA NvEnc in Linux

I’m trying to encode YUV images using CUDA NvEnc.

Here’s my case. I have two processes, one is a game, and the other is a NvEnc encoder. The game is a Vulkan application generating RGBA images in every frame. The game then converts the RGBA image (VkImage) to a YUV image (VkImage, linear format, not optimal).

I want to share the GPU memory the YUV image is mapped to with the other process, which is the NvEnc encoder process. In the NvEnc encoder process, I’d like to map a CUmipmappedArray to the shared VkImage(YUV) to be used as input without copying.

Is this use case supported in Linux at the moment?
Thanks in advance.

NVIDIA has a few CUDA/vulkan interop sample codes here: cuda-samples/README.md at master · NVIDIA/cuda-samples · GitHub

I haven’t looked at your specific case. I’m fairly confident it should be possible share an image buffer between Vulkan and CUDA.

This particular forum isn’t focused on NVENC, which isn’t a CUDA technology per se. (Yes, you can use CUDA to provide buffer management for NVENC, but NVENC doesn’t use CUDA for encoding.) The forum most focused on NVENC is here