Skip to content

[Bug / Interop Contradiction] Vulkan-HIP External Timeline Semaphore Export Succeeds but HIP Runtime Rejects Import on Windows RDNA3 (gfx1102) #3909

Description

@timiburya

Problem Description

Environment

Vulkan: apiVersion=1.4.349 driverVersion(raw)=8389003 vendorID=0x1002 deviceID=0x7480
HIP: runtime version=70260201 (7.2.60201) driver version=70260201
Device: AMD Radeon RX 7600S gcnArch=gfx1102 PCI bus=3 dev=0
OS: Windows 11
Driver: AMD Software: Adrenalin Edition 26.7.1
Summary & Core Contradiction

On Windows RDNA3 hardware, HIP's own API surface contradicts itself for the exact same handle type (OPAQUE_WIN32 timeline) on the exact same GPU:

HIP declares support, then denies it at two separate layers. hip_runtime_api.h declares hipExternalSemaphoreHandleTypeTimelineSemaphoreWin32 as a valid import target for hipImportExternalSemaphore — i.e. HIP's own public API claims to support importing a Windows timeline semaphore handle. But hipGetDeviceProperties self-reports timelineSemaphoreInteropSupported = 0 for this device, and calling hipImportExternalSemaphore with that exact declared handle type fails with hipErrorInvalidValue. The enum exists; the capability flag and the runtime both say it doesn't.

Vulkan's side of the handoff works correctly, ruling out a Vulkan-side or driver-export defect as the cause: vkGetPhysicalDeviceExternalSemaphoreProperties reports exportable=1, importable=1 for VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT with VK_SEMAPHORE_TYPE_TIMELINE, and creating + exporting the Windows handle via vkGetSemaphoreWin32HandleKHR succeeds completely. The handle HIP receives is valid and well-formed.

The result is a dead end for any application trying to coordinate HIP and Vulkan work via a wait-capable (non-binary) semaphore on this hardware: the export side works, HIP's API declares an import path for exactly that handle type, and the import is rejected anyway — by both the documented capability flag and the runtime call itself, consistently.

Questions

Why does Vulkan advertise exportable=1, importable=1 for timeline handles on Windows RDNA3 when the matching HIP runtime self-reports timelineSemaphoreInteropSupported = 0?
Is matching support for hipExternalSemaphoreHandleTypeTimelineSemaphoreWin32 planned to align the HIP runtime on Windows RDNA3 with Vulkan's export capabilities?

Operating System

Windows 11 10.0.26200

CPU

AMD Ryzen 7 7435HS

GPU

AMD Radeon RX 7600S (gfx1102)

ROCm Version

ROCm 7.2.6

ROCm Component

No response

Steps to Reproduce

#include <hip/hip_runtime.h>
#include

int main() {
hipDeviceProp_t prop{};
hipGetDeviceProperties(&prop, 0);
printf("Device: %s\n", prop.name);
printf("timelineSemaphoreInteropSupported = %d\n", prop.timelineSemaphoreInteropSupported);
return 0;
}

// --- Vulkan side: create + export a real timeline semaphore ---
VkExportSemaphoreCreateInfo exportCI{VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO};
exportCI.handleTypes = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT;

VkSemaphoreTypeCreateInfo typeCI{VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO};
typeCI.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE;
typeCI.initialValue = 0;
typeCI.pNext = &exportCI;

VkSemaphoreCreateInfo semCI{VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO};
semCI.pNext = &typeCI;
VkSemaphore vkSem;
vkCreateSemaphore(device, &semCI, nullptr, &vkSem); // SUCCEEDS

VkSemaphoreGetWin32HandleInfoKHR getHandle{VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR};
getHandle.semaphore = vkSem;
getHandle.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT;
HANDLE h = nullptr;
vkGetSemaphoreWin32HandleKHR_(device, &getHandle, &h); // SUCCEEDS

// --- HIP side: import the handle Vulkan just exported ---
hipExternalSemaphoreHandleDesc semDesc{};
semDesc.type = hipExternalSemaphoreHandleTypeTimelineSemaphoreWin32;
semDesc.handle.win32.handle = h;
semDesc.flags = 0;

hipExternalSemaphore_t hipSem;
hipError_t err = hipImportExternalSemaphore(&hipSem, &semDesc);

// Expected: hipSuccess (HIP declares TimelineSemaphoreWin32 as a valid import type)
// Actual: err == hipErrorInvalidValue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions