RUNTIME 2459: Joined completions: a command buffer marked to join the next groups under Exact
CommandBuffer::set_completion_joins_next marks a command buffer, before its commit, as one whose completion may be seen with the next one's. Under CompletionPolicy::Exact, on a device whose merge check holds and whose queues are not relayed, a marked command buffer's batches wait in the scheduler's group as every batch does under Grouped. The first batch of the VkQueue behind them that is not marked goes last in that group, which then goes at once (GroupEnd::Closed, WorkCounts::group_ends_closed), so it is seen complete at its own end and never held back. Its submission check runs with the marked ones' (check_heads), so they are found ready together. No group is kept past its pass under Exact (Alone::Unkept, WorkCounts::batches_held_alone_unkept): a kept group can reach the GPU after the work ahead of it ended, which would delay the unmarked one behind it. Everywhere else (Grouped, no merge, relayed queues, the encoder trail, batches that never group) the mark changes nothing. Why: on the Iris Xe, ANV on i915 lists every VkDeviceMemory in each execbuffer, about 170-190 us of driver time a vkQueueSubmit at the consumer's import count, and the consumer cuts each guest command buffer into about 12 parts committed under Exact, one kernel submission each. In its walk the GPU sat idle about 1.5 ms per waited guest buffer between parts already committed, behind a backlog of those calls. The consumer will mark every part but the last of a cut whose completion nothing observes. Grouped-completion's notice, docs/API.md's catalogue, FAST-PATHS row 38, the runtime README, CompletionPolicy::Exact's doc, api_signatures and REFUSALS say so. Tests: runtime_lane::joined_completions (marked parts group and a group is closed by the last; checked parts too; a no-op where the device's own check finds no merge; unmarked parts go alone; an unmarked command buffer is seen complete while the long one behind it still runs, the marked one before it complete by then), on lavapipe with the merge assumed. Joined completions: the cost table's length, and the order test's first work done before The conformance cost table's SHARED list holds 36 rows with batches_held_alone_unkept. In the order test the marked command buffer took the new buffers' first work, which no batch in a group takes, so it went alone and nothing grouped: the buffers' first work now runs before it. Verified: clippy and lavapipe lane job m3-max-36769 showed the failure (grouped 0 with grouping true); the rerun is the next job. Verified at 8e6c37c263: m3-max-36784 (msi) clippy --workspace --all-targets --all-features 0; m3-max-36785 (msi, lavapipe, --cfg m2v_cpu_icd) joined_completions + grouped_submissions + alone_batches 21/21 (marked parts under Exact with the merge: 7 command buffers in 2 submissions; unmarked: 7 submissions, 0 grouped; lavapipe's own merge check, not Holds: 0 grouped; an unmarked buffer is seen complete at its own end). The Iris merge check answers Holds (m3-max-36725: 9.6 us in one call of 4 against 26.4 us apart). Release-mode lavapipe, clippy --cfg m2v_gpu and m2v_cpu_icd and rustdoc run after the merge.
This commit is contained in:
1 parent
03e5c2fd24
commit
3de483d86f
20 files changed
+561
-66
No files matched your search
+7
-3
@@ -4087,8 +4087,10 @@ bound.
|
||||
buffers committed on one queue that the scheduler found ready together, or held while two or more
|
||||
earlier submissions of their queue ran, went to the driver in one `vkQueueSubmit`, only the last
|
||||
signalling its queue's timeline and their events (`CompletionPolicy::Grouped`, the default, on a
|
||||
driver whose queue merges a submission that signals nothing into the next one: Mesa's drivers):
|
||||
one kernel submission for up to four batches, where each kernel submission costs CPU time for
|
||||
driver whose queue merges a submission that signals nothing into the next one: Mesa's drivers;
|
||||
under `CompletionPolicy::Exact`, batches of command buffers marked to join the next,
|
||||
`CommandBuffer::set_completion_joins_next`, and the batch found ready behind them): one kernel
|
||||
submission for up to four batches, where each kernel submission costs CPU time for
|
||||
every `VkDeviceMemory` of the device. Announced once per device, on the scheduler's thread. Cost:
|
||||
each command buffer of the submission but the last is seen complete (its status, completed
|
||||
handlers and waits), and the event values it signals are reached, once the last completed, late by
|
||||
@@ -4097,7 +4099,9 @@ bound.
|
||||
those and its own start on the GPU, at most a completion turn's reaction and its vkQueueSubmit;
|
||||
and the submission checks of the batches behind a queue's next one run with its own, before the
|
||||
batch before them is submitted; their commands, barriers and GPU times are unchanged;
|
||||
`CompletionPolicy::Exact` submits and checks each batch alone.
|
||||
`CompletionPolicy::Exact` submits and checks each batch alone but those of a command buffer
|
||||
marked to join the next (`CommandBuffer::set_completion_joins_next`), which go with the batches
|
||||
found ready behind them in the same pass, the last of those seen complete at its own end.
|
||||
- `metal2vulkan-degrade-sync-file-after-host-copies` (performance). `SyncFileAfterHostCopies`: A
|
||||
command buffer's completion sync file (`CommandBuffer::export_completion_sync_file`) whose
|
||||
command buffer's completion writes the caller's pages on the host after its GPU work: the merge
|
||||
|
||||
Reference in new issue
Block a user