Skip to content

Add the VK_EXT_external_semaphore_drm_syncobj extension#2692

Open
mahkoh wants to merge 1 commit intoKhronosGroup:mainfrom
mahkoh:jorth/syncobj
Open

Add the VK_EXT_external_semaphore_drm_syncobj extension#2692
mahkoh wants to merge 1 commit intoKhronosGroup:mainfrom
mahkoh:jorth/syncobj

Conversation

@mahkoh
Copy link
Copy Markdown
Contributor

@mahkoh mahkoh commented Mar 2, 2026

This extension enables interop between timeline semaphores and Linux DRM synchronization objects (syncobj).

Closes #2473

@mahkoh
Copy link
Copy Markdown
Contributor Author

mahkoh commented Mar 2, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the VK_EXT_external_semaphore_drm_syncobj Vulkan extension to enable import/export interop between Vulkan timeline semaphores and Linux DRM syncobj file descriptors, addressing issue #2473.

Changes:

  • Registers the new extension and external semaphore handle type bit in vk.xml.
  • Adds spec language/valid usage for the new handle type in the synchronization and capabilities chapters.
  • Introduces the extension appendix page.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
xml/vk.xml Adds the new extension definition and extends VkExternalSemaphoreHandleTypeFlagBits with VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_DRM_SYNCOBJ_BIT_EXT.
chapters/synchronization.adoc Adds handle type table entry and new Valid Usage statements tying the handle type to timeline semaphores.
chapters/capabilities.adoc Documents the handle type as a Linux DRM syncobj FD and updates the handle-type compatibility table.
appendices/VK_EXT_external_semaphore_drm_syncobj.adoc New appendix page for the extension metadata and interfaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread xml/vk.xml Outdated
Comment thread xml/vk.xml Outdated
Comment thread chapters/synchronization.adoc Outdated
Comment thread chapters/synchronization.adoc Outdated
mahkoh added a commit to mahkoh/Vulkan-Docs that referenced this pull request Mar 2, 2026
mahkoh added a commit to mahkoh/Vulkan-Docs that referenced this pull request Mar 2, 2026
@mahkoh mahkoh mentioned this pull request Mar 2, 2026
mahkoh added a commit to mahkoh/Vulkan-Docs that referenced this pull request Mar 2, 2026
oddhack pushed a commit that referenced this pull request Mar 2, 2026
Copy link
Copy Markdown
Contributor

@cubanismo cubanismo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to move this extension forward @mahkoh! I've made a quick pass through and left some feedback, but this is looking pretty good. I'll ask the SI TSG to review as well. Please keep us updated on implementation progress.

Note this will also need CTS test coverage (https://github.com/KhronosGroup/VK-GL-CTS/tree/main/external/vulkancts) and validation layer coverage (https://github.com/KhronosGroup/Vulkan-ValidationLayers) to be merged. Let us know if you plan on working on those as well. Extending the existing timeline semaphore opaque FD coverage to run on DRM syncobj handle types would likely be sufficient for CTS.

Comment thread xml/vk.xml Outdated
</require>
</extension>
<extension name="VK_EXT_extension_678" number="678" author="EXT" contact="Julian Orth @mahkoh" supported="disabled">
<extension name="VK_EXT_external_semaphore_drm_syncobj" number="678" type="device" depends="VK_VERSION_1_2" author="EXT" contact="Julian Orth @mahkoh" supported="vulkan" nofeatures="true">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extension will have to have a feature bit. This is a newer requirement that most of the other external object specs predate. You can look at the VK_NV_external_memory_rdma spec for an example of a single-feature XML and spec update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done now.

endif::VK_NV_external_sci_sync[]
ifdef::VK_EXT_external_semaphore_drm_syncobj[]
* ename:VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_DRM_SYNCOBJ_BIT_EXT specifies a
file descriptor handle to a Linux DRM synchronization object (syncobj).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this extension specifically assumes DRM timeline synchronization objects, but binary syncobjs are a thing too, so the spec should probably be specific here and elsewhere. You may want to consider including that in the name as well, but it might also be considered overly verbose. I could go either way personally.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe the kernel distinguishes between binary and timeline syncobjs. The ioctl to create a syncobj does not have a way to allocate one or the other:

struct drm_syncobj_create {
	__u32 handle;
#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0)
	__u32 flags;
};

The kernel warns against using both binary and timeline ioctls on the same syncobj but I believe the following sentence from this PR already covers this:

                                                            Vulkan timeline
    semaphore values correspond to syncobj points.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I can confirm that the kernel makes no difference between binary and timeline syncobjs. A binary syncobj is a timeline syncobj with only point 0 being used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it's reasonable to have a Vulkan VU or at least a note that says that it should only be imported as the same timeline type it was exported as. That won't cover every case since the client can go call DRM ioctls itself, but if someone is, for instance, using this to share semaphores between two different Vulkan devices, they're going to run into trouble if they mix and match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extension only supports import to/export from timeline semaphores.

@mahkoh mahkoh force-pushed the jorth/syncobj branch 2 times, most recently from fe71466 to f5054cd Compare March 4, 2026 14:23
@r-potter
Copy link
Copy Markdown
Contributor

r-potter commented Mar 4, 2026

@gfxstrand cc to provide feedback

@mahkoh
Copy link
Copy Markdown
Contributor Author

mahkoh commented Mar 4, 2026

Note this will also need CTS test coverage (KhronosGroup/VK-GL-CTS@main/external/vulkancts) and validation layer coverage (KhronosGroup/Vulkan-ValidationLayers) to be merged. Let us know if you plan on working on those as well. Extending the existing timeline semaphore opaque FD coverage to run on DRM syncobj handle types would likely be sufficient for CTS.

They are linked above this comment now.

Comment thread chapters/capabilities.adoc Outdated
Comment thread chapters/capabilities.adoc Outdated
This extension enables interop between timeline semaphores and Linux DRM
synchronization objects (syncobj).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for DRM syncobj FDs in vkGetSemaphoreKHR/vkImportSemaphoreFdKHR

9 participants