cuExternalMemoryGetMappedMipmappedArray memory footprint

Hi,

I’ve implemented a video streaming library that captures/encodes/streams the output of our Vulkan-based renderer. The implementation relies on nvenc for the H.265 encoding part and is heavily based on the SDK sample.

It works perfectly, however, while investigating the memory consumption overhead, I’ve noticed that cuExternalMemoryGetMappedMipmappedArray() calls basically increases the VRAM usage by 25MB for each call, which is basically the size of the render target.

I don’t fully understand that, as I thought the cuImportExternalMemory/cuExternalMemoryGetMappedMipmappedArray/cuMipmappedArrayGetLevel chain would simply reuse the already allocated memory (used for my mapped vkImage2D), would basically “alias” the memory allocated for the vkImage2D, while it rather seems to allocate another memory block.

Did I miss anything ?

Thanks a lot !