CUDA-Vulkan image interop broken on Windows

Hi,

I created a reproducer app for issues with CUDA-Vulkan image interop on Windows. The reproducer can be found at GitHub - chrismile/TestCudaVulkanImageInterop: Test app for CUDA-Vulkan image interop..

In this test app, CUDA writes linearly increasing values to a shared RGBA 32-bit float image of size 1024 x 1024 (via a surface object). Vulkan then copies this to a device local buffer, and from there to a host visible buffer.

While the test works normally on an Ubuntu 24.04 system (no matter how often the test is run), on Windows the read back memory is sometimes all zeros. Synchronization can be either done by syncing between CUDA and Vulkan on the CPU or using shared semaphores. Both cases fail.

Tested system configurations:

  • RTX 3090, Ubuntu 24.04, CUDA 12.6, driver 580.126.09, GCC 13.3 (works)
  • RTX 3090, Windows 11, CUDA 12.8, driver 591.86 & 591.74 & 582.30, MSVC 2022 (fails)

I have created a comparable CUDA-D3D12 test case, but it does not fail. When not sharing images, but buffers between CUDA and Vulkan, that also does not fail.

Seems like the issue is related to not using a dedicated memory allocation.

When I add VkMemoryDedicatedAllocateInfoKHR to the pNext chain of the Vulkan-side allocation, everything suddenly works correctly. But if I don’t use it, the reproducer fails even when not setting CUDA_EXTERNAL_MEMORY_DEDICATED / cudaExternalMemoryDedicated.

According to CUDA C++ Programming Guide (Legacy) — CUDA C++ Programming Guide , Windows 11 should support non-dedicated memory objects. Is this a driver issue or am I doing something wrong?

Uninstall KB5074109 and you’ll find that Microsoft regressed this behavior in their update. We really need Microsoft to fix this regression as the impact is far wider than just occasional black shared resources.

1 Like

Thanks for the explanation, that also explains why I did not see the issue on my laptop before installing Windows updates.

1 Like