level-zero icon indicating copy to clipboard operation
level-zero copied to clipboard

why no semaphores? events are a bit fine grained

Open airlied opened this issue 4 years ago • 3 comments

While level 0 has fences and events it doesn't appear to have any semaphore support.

Events can be a messy solution from a scheduler point of view, as they pretty much block the GPU command processing hard at a point in time, some GPUs can reschedule other command streams, some can't. So while useful events can be a bit of a large hammer to hit a system with from a user application. Also GPU selected events invariably mean the CPU side is spinning on some memory location polling the event, again not really a great thing to have to depend on.

Vulkan recently added timeline semaphores and perhaps there should be some consideration of adding them to Level 0 as a better scheduling mechanism.

airlied avatar May 05 '20 21:05 airlied

We had early drafts of the spec that did include the concept of timeline semaphores, but we have decided to pursue a different solution. We’re not quite ready to provide details but stay tuned.

I will respond to this issue again once we are ready to release the specification and we can discuss whether this addresses your concerns.

gatorfax avatar May 08 '20 17:05 gatorfax

I'd just like to note that vulkan spec has removed the ability for a device to wait on an event and the host to signal it later. I'm not sure if doing in that in level 0 is allowed, but it might be good to explicitly call it as acceptable, since vulkan has gone the other way.

airlied avatar Jun 10 '20 03:06 airlied

https://www.khronos.org/registry/vulkan/specs/1.2/html/chap6.html#commandbuffers-submission-progress for vulkan wording.

airlied avatar Jul 06 '20 07:07 airlied