oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

why no semaphores? events are a bit fine grained #16

Open airlied opened 4 years ago

airlied commented 4 years ago

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.

gatorfax commented 4 years ago

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.

airlied commented 4 years ago

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 commented 4 years ago

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