Use VK_KHR_timeline_semaphore to reduce cvk_command_batch submit latency#808
Open
Use VK_KHR_timeline_semaphore to reduce cvk_command_batch submit latency#808
Conversation
c39a392 to
9f1879c
Compare
|
curious if it brings enhancements to clpeak "Kernel launch latency" score (--kernel-latency).. |
Contributor
Author
I'm seeing an improvement on all the hardware I've tried so far with clpeak. Even with llvmpipe, it goes from But to be honest, where we gain a lot is when we do not have a |
1808fa2 to
5d09625
Compare
5d09625 to
8584500
Compare
Try to submit batch as soon as possible to reduce latency to it's minimum.
8584500 to
67f7102
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use a
cvk_semaphoreinstead of astd::condition_variablewhenVK_KHR_timeline_semaphoreis supported.cvk_eventholds acvk_condition_variablewhich can be eithercvk_std_condition_variable(usingstd::condition_variable) or acvk_semaphore_condition_variable(usingcvk_semaphore).When the event is created it will get a
cvk_semaphoreand avalue. It assumes that nothing will be created between the creation of the event and its submission in the queue, thusvalues will be allocated in order.As this assumption is not always true, we make sure of it by using 3 timelines where we can ensure that nothing will be created between the creation of the event and its submission in the queue.
Add
notify,wait,poll,poll_onceimplementation tocvk_semaphore.When
cvk_command_queue::end_current_command_batchis called, if we can use timeline semaphore and no synchronous command has been submitted, submit the batch.Add config option to poll the timeline semaphore instead of waiting. Differentiate the main thread and the executors. This can be useful to understand performance issues, or driver bugs.