rt: count scheduled-to-start under earlier GPU spans, GPU-end-to-handler steps and calibrations
The clean 5080 re-play's print needs three things the stage sums alone cannot give.
First, how much of each command buffer's span from scheduling to GPU start lies under other
command buffers' GPU spans, the runtime's own uploads and copy-ins included, against the part
under none of them. This is Metrics::scheduled_to_gpu_start_behind_nanos.
Second, its span from GPU end to handlers split at the completion thread's own steps. This is
Metrics::gpu_end_to_handler_steps_nanos, six steps:
- seen: GPU end to the thread seeing the completion;
- told: telling the submit thread;
- stamp read: reading the round's timestamps;
- calibration: a calibration, where the round runs one;
- earlier: the round's earlier retirements, their handlers included;
- own: its own retirement until its handlers begin.
The same steps are kept for the command buffers of 1,024 us or more (gpu_end_to_handler_tail
and its steps), so a 1-8 ms tail can be placed in a step.
Third, the calibrations and their calls' time. The counter that only the tests had becomes
Metrics::calibrations, beside calibration_nanos.
The replay backend reports all of these as executed counters.
Counting only; nothing changes form. There are no new waits, locks or allocations. What each
count costs:
- Completion thread, per round: two clock reads (the stamp read's start and end), and a third
where it calibrates. The period check reuses the stamp read's end, so it no longer reads the
clock itself.
- Per command buffer retired: one clock read where its retirement begins, then for one that
counts stages:
- one pass over a fixed ring of the latest 128 GPU spans, a stack array in the completion
thread;
- a sort, on the stack, of those that meet its span;
- one relaxed atomic add for the behind part;
- six for the steps, and seven more for one in the tail.
- Per upload or copy-in retired: the timestamps it already read go into that ring. There is no
second query read.
- Per calibration: two clock reads and two relaxed atomic adds.
Retirement returns an upload's and a copy-in's two timestamps (times::retire_own). The
completion thread places them on the host clock by the calibration as it stands
(Calibration::at, which moves nothing), and the program's command buffers' spans as placed.
Tests:
- host tests for the ring's merged, clipped union and its oldest-first replacement;
- a host test for the round's steps adding up to the span;
- the device stage test now checks that the six steps add up to gpu_end_to_handler_nanos, that
the behind part is at most scheduled_to_gpu_start_nanos, and that the device start
calibrated;
- the replay stage test checks the same through the report's keys.
This commit is contained in:
1 parent
c8bd7123b7
commit
9027bd2aa3
12 files changed
+433
-49
No files matched your search
@@ -186,7 +186,11 @@ four histograms of each command buffer's stages, in 23 power-of-two buckets from
|
||||
to scheduled (`commit_to_scheduled`, counted as it is scheduled), scheduled to GPU start, the GPU
|
||||
run, and GPU end to the host time its handlers begin (counted as it retires, for one that
|
||||
completes with GPU times), each beside its spans' sum in nanoseconds (`commit_to_scheduled_nanos`
|
||||
and the three like it); the segments the submit thread held for an event's value that neither
|
||||
and the three like it); of scheduled to GPU start, the part under the GPU spans of other command
|
||||
buffers retired before it, the runtime's own included (`scheduled_to_gpu_start_behind_nanos`); GPU
|
||||
end to handlers split at the completion thread's six steps, for all and for those of 1,024 us or
|
||||
more (`gpu_end_to_handler_steps_nanos`, `gpu_end_to_handler_tail` and its steps); the clock
|
||||
calibrations and their calls' time (`calibrations`, `calibration_nanos`); the segments the submit thread held for an event's value that neither
|
||||
the host had set nor a submitted signal promised, by the length of each hold (`event_holds`, in
|
||||
the same buckets); the groups a queue held behind three submissions in flight that went once a
|
||||
completion left fewer running (`held_starts`), and the GPU's time behind them, from the latest
|
||||
|
||||
@@ -196,8 +196,9 @@ pub(crate) struct CopyIn {
|
||||
impl CopyIn {
|
||||
/// Gives its recorder back and drops what it holds, and its pair of timestamp queries, read
|
||||
/// where its submission completed (`end`, [`times::retire_own`]): once what took it retired,
|
||||
/// or ended at a loss, or where it never went.
|
||||
pub(crate) fn retire(self, core: &Core, end: times::OwnEnd) {
|
||||
/// or ended at a loss, or where it never went. Answers its two timestamps where it completed
|
||||
/// and both read.
|
||||
pub(crate) fn retire(self, core: &Core, end: times::OwnEnd) -> Option<(u64, u64)> {
|
||||
let CopyIn {
|
||||
recorder,
|
||||
modified,
|
||||
@@ -205,9 +206,10 @@ impl CopyIn {
|
||||
stamps,
|
||||
..
|
||||
} = self;
|
||||
times::retire_own(core, stamps, end);
|
||||
let read = times::retire_own(core, stamps, end);
|
||||
core.recorders.give_back(core, recorder);
|
||||
drop((modified, images));
|
||||
read
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
//! states from creation to retirement.
|
||||
|
||||
use crate::buffer::{Buffer, BufferInner, BufferObject};
|
||||
use crate::complete::Completion;
|
||||
use crate::counters::{Metric, Stage, Tally};
|
||||
use crate::device::{lock, Core, Device};
|
||||
use crate::error::{Error, Refusal};
|
||||
@@ -1492,18 +1493,25 @@ pub(crate) fn run_scheduled(inner: Arc<CbInner>, handlers: Vec<Handler>) {
|
||||
}
|
||||
|
||||
/// On the completion thread: retires a command buffer that completed (`error` None), with its GPU
|
||||
/// times where they were read, or ended, recycling its recorder and giving up its blocks, its pair
|
||||
/// of timestamp queries with the `written` of them reset, and its place in the queue, then runs
|
||||
/// its handlers.
|
||||
/// times where they were read (`completion`), or ended, recycling its recorder and giving up its
|
||||
/// blocks, its pair of timestamp queries with the `written` of them reset, and its place in the
|
||||
/// queue, then runs its handlers.
|
||||
pub(crate) fn retire(
|
||||
core: &Core,
|
||||
inner: Arc<CbInner>,
|
||||
gpu: Gpu,
|
||||
handlers: Handlers,
|
||||
error: Option<CommandBufferError>,
|
||||
gpu_times: Option<(u64, u64)>,
|
||||
written: u32,
|
||||
completion: Completion<'_>,
|
||||
) {
|
||||
let Completion {
|
||||
gpu_times,
|
||||
round,
|
||||
spans,
|
||||
} = completion;
|
||||
// Where its retirement begins, the step before its handlers (`Round::steps`): one clock read.
|
||||
let retiring = times::host_time();
|
||||
// Its own GPU run, by its timestamps, sets what its queue expects of the next
|
||||
// (`QueueInner::expected_run`, which bounds the groups `submit.rs` joins).
|
||||
if let Some((start, end)) = gpu_times {
|
||||
@@ -1556,15 +1564,17 @@ pub(crate) fn retire(
|
||||
}
|
||||
inner.queue.release(kept);
|
||||
// Its stages from its scheduling on, by the times it already holds and the host time its
|
||||
// handlers begin (`Metrics::scheduled_to_gpu_start` and the two after it).
|
||||
// handlers begin (`Metrics::scheduled_to_gpu_start` and the two after it): the part of the
|
||||
// first under the spans retired before it, and the steps of the last.
|
||||
if let Some((scheduled, start, end)) = stages {
|
||||
let counters = &core.counters;
|
||||
counters.stage(Stage::ScheduledToGpuStart, start.saturating_sub(scheduled));
|
||||
counters.scheduled_behind(spans.covered(scheduled, start));
|
||||
counters.stage(Stage::GpuRun, end.saturating_sub(start));
|
||||
counters.stage(
|
||||
Stage::GpuEndToHandler,
|
||||
times::host_time().saturating_sub(end),
|
||||
);
|
||||
let handled = times::host_time();
|
||||
let span = handled.saturating_sub(end);
|
||||
counters.stage(Stage::GpuEndToHandler, span);
|
||||
counters.handler_steps(span, round.steps(end, retiring, handled));
|
||||
}
|
||||
let handle = CommandBuffer { inner };
|
||||
for handler in handlers.scheduled.into_iter().chain(handlers.completed) {
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
use crate::capture::CopyIn;
|
||||
use crate::command::{self, CbInner, CommandBufferError, DeviceLoss, Gpu, Handlers, Pending};
|
||||
use crate::counters::Metric;
|
||||
use crate::counters::{Metric, HANDLER_STEPS};
|
||||
use crate::device::{lock, Core};
|
||||
use crate::error::Error;
|
||||
use crate::event::{self, EventInner, Listener};
|
||||
use crate::submit::{Ended, Finished, Upload};
|
||||
use crate::times::{self, Calibration, OwnEnd};
|
||||
use crate::times::{self, Calibration, OwnEnd, Spans};
|
||||
use ash::vk;
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
|
||||
@@ -328,9 +328,10 @@ pub(crate) fn lose(core: &Core, loss: DeviceLoss) {
|
||||
}
|
||||
|
||||
impl Retiree {
|
||||
/// Retires it, a command buffer with its GPU times where it completed; an upload or a copy-in
|
||||
/// with its timestamps read where it completed (`times::retire_own`).
|
||||
fn retire(self, core: &Core, gpu_times: Option<(u64, u64)>) {
|
||||
/// Retires it, a command buffer by its `completion`; an upload or a copy-in with its
|
||||
/// timestamps read where it completed (`times::retire_own`), which it answers where both
|
||||
/// read.
|
||||
fn retire(self, core: &Core, completion: Completion<'_>) -> Option<(u64, u64)> {
|
||||
let end = match self.lost {
|
||||
true => OwnEnd::Lost,
|
||||
false => OwnEnd::Completed,
|
||||
@@ -342,7 +343,10 @@ impl Retiree {
|
||||
handlers,
|
||||
error,
|
||||
written,
|
||||
} => command::retire(core, cb, gpu, handlers, error, gpu_times, written),
|
||||
} => {
|
||||
command::retire(core, cb, gpu, handlers, error, written, completion);
|
||||
None
|
||||
}
|
||||
Item::Upload(upload) => upload.retire(core, end),
|
||||
Item::CopyIn(copy_in) => copy_in.retire(core, end),
|
||||
}
|
||||
@@ -372,6 +376,54 @@ impl Retiree {
|
||||
}
|
||||
}
|
||||
|
||||
/// The host times of a round of the completion thread's steps, which split each of its command
|
||||
/// buffers' spans from their GPU end to their handlers (`Metrics::gpu_end_to_handler_steps_nanos`).
|
||||
pub(crate) struct Round {
|
||||
/// The thread saw the round's completions.
|
||||
seen: u64,
|
||||
/// Its read of the round's timestamps began.
|
||||
read: u64,
|
||||
/// That read ended.
|
||||
stamped: u64,
|
||||
/// Its calibration ended, where the round read one; else the read's end.
|
||||
calibrated: u64,
|
||||
}
|
||||
|
||||
impl Round {
|
||||
/// A round that saw its completions at `seen`, read its timestamps from `read` to `stamped`,
|
||||
/// and ended its calibration at `calibrated` (`stamped` where it read none).
|
||||
pub(crate) fn at(seen: u64, read: u64, stamped: u64, calibrated: u64) -> Round {
|
||||
Round {
|
||||
seen,
|
||||
read,
|
||||
stamped,
|
||||
calibrated,
|
||||
}
|
||||
}
|
||||
|
||||
/// The steps of a command buffer's span from its GPU end, `end`, to its handlers, which
|
||||
/// begin at `handled`, its retirement having begun at `retiring`: each from the earlier of
|
||||
/// its two host times, 0 where the later comes first.
|
||||
pub(crate) fn steps(&self, end: u64, retiring: u64, handled: u64) -> [u64; HANDLER_STEPS] {
|
||||
[
|
||||
self.seen.saturating_sub(end),
|
||||
self.read.saturating_sub(self.seen),
|
||||
self.stamped.saturating_sub(self.read),
|
||||
self.calibrated.saturating_sub(self.stamped),
|
||||
retiring.saturating_sub(self.calibrated),
|
||||
handled.saturating_sub(retiring),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/// What the completion thread knows of a command buffer's completion as it retires it: its GPU
|
||||
/// times where they were read, its round, and the GPU spans retired before it.
|
||||
pub(crate) struct Completion<'a> {
|
||||
pub(crate) gpu_times: Option<(u64, u64)>,
|
||||
pub(crate) round: &'a Round,
|
||||
pub(crate) spans: &'a Spans,
|
||||
}
|
||||
|
||||
/// What a round of the completion thread saw of the progress semaphore.
|
||||
enum Seen {
|
||||
/// A host wait reported this value reached (0: nothing new).
|
||||
@@ -415,6 +467,9 @@ pub(crate) fn run(core: Arc<Core>) {
|
||||
// group's submission whose gap was counted (`Metrics::held_start_gap_nanos`).
|
||||
let mut last_end: Option<u64> = None;
|
||||
let mut gapped = 0;
|
||||
// The latest GPU spans retired, on the host clock, under which a command buffer's span from
|
||||
// its scheduling to its GPU start may lie (`Metrics::scheduled_to_gpu_start_behind_nanos`).
|
||||
let mut spans = Spans::new();
|
||||
// A value the counter read and the host wait then reported not reached: the next wait is for
|
||||
// it, so the thread sleeps until the wait agrees rather than reading the counter again.
|
||||
let mut behind: Option<u64> = None;
|
||||
@@ -520,16 +575,23 @@ pub(crate) fn run(core: Arc<Core>) {
|
||||
// Each completed command buffer's timestamps are placed on the host clock by the
|
||||
// last calibration, read again first where the period has passed since it, and moved
|
||||
// earlier where it would place an end after the host time the thread saw it complete.
|
||||
// The round's steps are timed by clock reads around them (`Round`): two, and a third
|
||||
// where it calibrates.
|
||||
let seen = seen_at.unwrap_or_else(times::host_time);
|
||||
let read = times::host_time();
|
||||
let stamps: Vec<Option<(u64, u64)>> =
|
||||
retire.iter().map(|retiree| retiree.stamps(&core)).collect();
|
||||
let stamped = times::host_time();
|
||||
let mut calibrated = stamped;
|
||||
if stamps.iter().any(Option::is_some)
|
||||
&& calibration.is_none_or(|last| {
|
||||
times::host_time().saturating_sub(last.host()) >= times::CALIBRATION_PERIOD
|
||||
stamped.saturating_sub(last.host()) >= times::CALIBRATION_PERIOD
|
||||
})
|
||||
{
|
||||
calibration = Calibration::read(&core).or(calibration);
|
||||
calibrated = times::host_time();
|
||||
}
|
||||
let round = Round::at(seen, read, stamped, calibrated);
|
||||
for (retiree, stamps) in retire.into_iter().zip(stamps) {
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
if let Some((start, end)) = stamps {
|
||||
@@ -552,7 +614,25 @@ pub(crate) fn run(core: Arc<Core>) {
|
||||
let times = stamps
|
||||
.zip(calibration.as_mut())
|
||||
.map(|(stamps, calibration)| calibration.place(&core.ticks, stamps, seen));
|
||||
retiree.retire(&core, times);
|
||||
let completion = Completion {
|
||||
gpu_times: times,
|
||||
round: &round,
|
||||
spans: &spans,
|
||||
};
|
||||
// Its GPU span joins those the later ones' spans lie under: a command buffer's as
|
||||
// placed, an upload's or a copy-in's by the calibration as it stands.
|
||||
let own = retiree.retire(&core, completion);
|
||||
let own = own
|
||||
.zip(calibration.as_ref())
|
||||
.map(|((start, end), calibration)| {
|
||||
(
|
||||
calibration.at(&core.ticks, start),
|
||||
calibration.at(&core.ticks, end),
|
||||
)
|
||||
});
|
||||
if let Some(span) = own.or(times) {
|
||||
spans.push(span);
|
||||
}
|
||||
}
|
||||
for (listener, value) in fire {
|
||||
listener(value);
|
||||
|
||||
@@ -47,6 +47,14 @@ pub(crate) fn stage_bucket(nanos: u64) -> usize {
|
||||
}
|
||||
}
|
||||
|
||||
/// The steps of the completion thread that split a command buffer's span from its GPU end to its
|
||||
/// handlers ([`Metrics::gpu_end_to_handler_steps_nanos`]).
|
||||
pub(crate) const HANDLER_STEPS: usize = 6;
|
||||
|
||||
/// The first bucket of [`Metrics::gpu_end_to_handler`] whose spans count in
|
||||
/// [`Metrics::gpu_end_to_handler_tail`]: from 1,024 us on.
|
||||
const HANDLER_TAIL_BUCKET: usize = 10;
|
||||
|
||||
/// A stage of a command buffer's life that [`Metrics`] keeps a histogram of.
|
||||
#[derive(Clone, Copy)]
|
||||
pub(crate) enum Stage {
|
||||
@@ -509,6 +517,12 @@ struct Atomics {
|
||||
/// Each [`Stage`]'s histogram, at its index, and its spans summed.
|
||||
stages: [[AtomicU64; STAGE_BUCKETS]; 4],
|
||||
stage_nanos: [AtomicU64; 4],
|
||||
scheduled_behind_nanos: AtomicU64,
|
||||
handler_steps_nanos: [AtomicU64; HANDLER_STEPS],
|
||||
handler_tail: AtomicU64,
|
||||
handler_tail_steps_nanos: [AtomicU64; HANDLER_STEPS],
|
||||
calibrations: AtomicU64,
|
||||
calibration_nanos: AtomicU64,
|
||||
event_holds: [AtomicU64; STAGE_BUCKETS],
|
||||
held_starts: AtomicU64,
|
||||
held_start_gap_nanos: AtomicU64,
|
||||
@@ -680,9 +694,6 @@ struct Atomics {
|
||||
/// Segment ends whose barrier reaches the host, for the tests.
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
host_reaches: AtomicU64,
|
||||
/// Calibrations of the GPU's clock against the host's, for the tests.
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
calibrations: AtomicU64,
|
||||
/// Barriers that ended a blit of an image, and the global memory barriers they held, for the
|
||||
/// tests.
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
@@ -875,6 +886,37 @@ impl Counters {
|
||||
self.atomics.stage_nanos[stage as usize].fetch_add(nanos, Relaxed);
|
||||
}
|
||||
|
||||
/// Of a command buffer's span from its scheduling to its GPU start, the `nanos` nanoseconds
|
||||
/// under other command buffers' GPU spans ([`Metrics::scheduled_to_gpu_start_behind_nanos`]).
|
||||
pub(crate) fn scheduled_behind(&self, nanos: u64) {
|
||||
self.atomics
|
||||
.scheduled_behind_nanos
|
||||
.fetch_add(nanos, Relaxed);
|
||||
}
|
||||
|
||||
/// A command buffer's span of `nanos` nanoseconds from its GPU end to its handlers, split at
|
||||
/// the completion thread's `steps` ([`Metrics::gpu_end_to_handler_steps_nanos`], and the tail's
|
||||
/// where the span is 1,024 us or more).
|
||||
pub(crate) fn handler_steps(&self, nanos: u64, steps: [u64; HANDLER_STEPS]) {
|
||||
let a = &self.atomics;
|
||||
for (sum, step) in a.handler_steps_nanos.iter().zip(steps) {
|
||||
sum.fetch_add(step, Relaxed);
|
||||
}
|
||||
if stage_bucket(nanos) >= HANDLER_TAIL_BUCKET {
|
||||
a.handler_tail.fetch_add(1, Relaxed);
|
||||
for (sum, step) in a.handler_tail_steps_nanos.iter().zip(steps) {
|
||||
sum.fetch_add(step, Relaxed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// One more calibration of the GPU's clock against the host's, its call `nanos` nanoseconds
|
||||
/// long ([`Metrics::calibrations`]).
|
||||
pub(crate) fn calibrated(&self, nanos: u64) {
|
||||
self.atomics.calibrations.fetch_add(1, Relaxed);
|
||||
self.atomics.calibration_nanos.fetch_add(nanos, Relaxed);
|
||||
}
|
||||
|
||||
/// A segment the submit thread held `nanos` nanoseconds for an event's value
|
||||
/// ([`Metrics::event_holds`]).
|
||||
pub(crate) fn event_hold(&self, nanos: u64) {
|
||||
@@ -1217,12 +1259,6 @@ impl Counters {
|
||||
self.atomics.host_reaches.load(Relaxed)
|
||||
}
|
||||
|
||||
/// One more calibration of the GPU's clock against the host's.
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
pub(crate) fn calibrated(&self) {
|
||||
self.atomics.calibrations.fetch_add(1, Relaxed);
|
||||
}
|
||||
|
||||
/// The calibrations made.
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
pub(crate) fn calibrations(&self) -> u64 {
|
||||
@@ -1388,10 +1424,18 @@ impl Counters {
|
||||
commit_to_scheduled_nanos: stage_nanos(Stage::CommitToScheduled),
|
||||
scheduled_to_gpu_start: stage(Stage::ScheduledToGpuStart),
|
||||
scheduled_to_gpu_start_nanos: stage_nanos(Stage::ScheduledToGpuStart),
|
||||
scheduled_to_gpu_start_behind_nanos: a.scheduled_behind_nanos.load(Relaxed),
|
||||
gpu_run: stage(Stage::GpuRun),
|
||||
gpu_run_nanos: stage_nanos(Stage::GpuRun),
|
||||
gpu_end_to_handler: stage(Stage::GpuEndToHandler),
|
||||
gpu_end_to_handler_nanos: stage_nanos(Stage::GpuEndToHandler),
|
||||
gpu_end_to_handler_steps_nanos: (a.handler_steps_nanos.each_ref())
|
||||
.map(|n| n.load(Relaxed)),
|
||||
gpu_end_to_handler_tail: a.handler_tail.load(Relaxed),
|
||||
gpu_end_to_handler_tail_steps_nanos: (a.handler_tail_steps_nanos.each_ref())
|
||||
.map(|n| n.load(Relaxed)),
|
||||
calibrations: a.calibrations.load(Relaxed),
|
||||
calibration_nanos: a.calibration_nanos.load(Relaxed),
|
||||
event_holds: (a.event_holds.each_ref()).map(|n| n.load(Relaxed)),
|
||||
held_starts: a.held_starts.load(Relaxed),
|
||||
held_start_gap_nanos: a.held_start_gap_nanos.load(Relaxed),
|
||||
@@ -1671,6 +1715,12 @@ pub struct Metrics {
|
||||
/// The spans [`scheduled_to_gpu_start`](Self::scheduled_to_gpu_start) counts, summed, in
|
||||
/// nanoseconds.
|
||||
pub scheduled_to_gpu_start_nanos: u64,
|
||||
/// Of [`scheduled_to_gpu_start_nanos`](Self::scheduled_to_gpu_start_nanos), the nanoseconds
|
||||
/// under the GPU span of another command buffer the completion thread retired before this
|
||||
/// one: the program's, or one of the runtime's own (an upload or a copy-in), among the latest
|
||||
/// 128 retired with both timestamps, each placed on the host clock and merged where they
|
||||
/// overlap. The rest of the span lies under none of them.
|
||||
pub scheduled_to_gpu_start_behind_nanos: u64,
|
||||
/// The same command buffers by their GPU run: the span from their
|
||||
/// [`gpu_start_time`](crate::CommandBuffer::gpu_start_time) to their
|
||||
/// [`gpu_end_time`](crate::CommandBuffer::gpu_end_time), their two timestamps' own span, in
|
||||
@@ -1689,6 +1739,28 @@ pub struct Metrics {
|
||||
/// The spans [`gpu_end_to_handler`](Self::gpu_end_to_handler) counts, summed, in
|
||||
/// nanoseconds.
|
||||
pub gpu_end_to_handler_nanos: u64,
|
||||
/// Those spans split at the completion thread's steps, summed, in nanoseconds: 0, from the
|
||||
/// GPU end to the host time the thread saw the completion (its wait's return and its read of
|
||||
/// the progress semaphore); 1, from then to its read of the round's timestamps (the submit
|
||||
/// thread told of the completion); 2, that read; 3, a calibration, where the round read one
|
||||
/// ([`calibrations`](Self::calibrations)); 4, the retirements before this one in the round,
|
||||
/// the command buffers', uploads' and copy-ins', their handlers included; 5, its own
|
||||
/// retirement until its handlers begin. Each step is the span between its two host times, 0
|
||||
/// where the later comes first, so the six add up to the span wherever the GPU end is no
|
||||
/// later than the time the thread saw it.
|
||||
pub gpu_end_to_handler_steps_nanos: [u64; HANDLER_STEPS],
|
||||
/// Of the command buffers [`gpu_end_to_handler`](Self::gpu_end_to_handler) counts, those whose
|
||||
/// span is 1,024 us or more (its buckets 10 and above).
|
||||
pub gpu_end_to_handler_tail: u64,
|
||||
/// Their spans split at the steps of
|
||||
/// [`gpu_end_to_handler_steps_nanos`](Self::gpu_end_to_handler_steps_nanos), summed, in
|
||||
/// nanoseconds.
|
||||
pub gpu_end_to_handler_tail_steps_nanos: [u64; HANDLER_STEPS],
|
||||
/// Calibrations of the GPU's clock against the host's (`vkGetCalibratedTimestampsKHR` calls):
|
||||
/// one as the device starts, then one at a completion once 100 ms have passed since the last.
|
||||
pub calibrations: u64,
|
||||
/// Those calls' time, summed, in nanoseconds of [`host_time`](crate::host_time).
|
||||
pub calibration_nanos: u64,
|
||||
/// Segments the submit thread held for an event's value that neither the host had set nor a
|
||||
/// signal submitted to the driver promised: a value the host sets later, or one a command
|
||||
/// buffer not yet submitted signals. A wait whose signal is submitted is not held: it goes to
|
||||
|
||||
@@ -2102,7 +2102,9 @@ fn submit(core: &Core, value: u64, uploads: Vec<Upload>, batch: Batch) {
|
||||
Err(Error::Vulkan { call, result }) => ok = Err(DeviceLoss { call, result }),
|
||||
Err(error) => unreachable!("an upload's begin fails only in a Vulkan call: {error}"),
|
||||
},
|
||||
(false, Some(upload)) => upload.retire(core, times::OwnEnd::Unsent),
|
||||
(false, Some(upload)) => {
|
||||
upload.retire(core, times::OwnEnd::Unsent);
|
||||
}
|
||||
(false, None) => {}
|
||||
}
|
||||
let mut uploads = kept;
|
||||
@@ -2287,9 +2289,11 @@ fn submit(core: &Core, value: u64, uploads: Vec<Upload>, batch: Batch) {
|
||||
impl Upload {
|
||||
/// Recycles the upload's recorder and gives up what it holds, and its pair of timestamp
|
||||
/// queries, read where its submission completed (`end`, [`times::retire_own`]): once its
|
||||
/// submission completed, or ended at a loss, or where it never went.
|
||||
pub(crate) fn retire(self, core: &Core, end: times::OwnEnd) {
|
||||
times::retire_own(core, self.stamps, end);
|
||||
/// submission completed, or ended at a loss, or where it never went. Answers its two
|
||||
/// timestamps where it completed and both read.
|
||||
pub(crate) fn retire(self, core: &Core, end: times::OwnEnd) -> Option<(u64, u64)> {
|
||||
let read = times::retire_own(core, self.stamps, end);
|
||||
core.recorders.give_back(core, self.recorder);
|
||||
read
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,58 @@
|
||||
//! counted once in every stage histogram. Without a device: a push whose bytes the command buffer
|
||||
//! holds is not recorded again; a queue's expected run rises to a longer run at once and halves
|
||||
//! toward a shorter one; the join and send decisions of the group bound; the stage histograms'
|
||||
//! bucket edges.
|
||||
//! bucket edges; the part of a span under the latest GPU spans, and the completion round's steps.
|
||||
|
||||
use crate::command::Pushed;
|
||||
use crate::complete::Round;
|
||||
use crate::counters::{stage_bucket, STAGE_BUCKETS};
|
||||
use crate::queue::next_run;
|
||||
use crate::submit::{apart, joins, GROUP_RUN, UNSEEN_JOINS};
|
||||
use crate::times::{Spans, SPANS_KEPT};
|
||||
|
||||
/// A span from a scheduling to a GPU start lies under the GPU spans kept as their union clipped
|
||||
/// to it: overlapping spans count once, one outside it not at all, one of no length is not kept,
|
||||
/// and past `SPANS_KEPT` the oldest are no longer kept.
|
||||
#[test]
|
||||
fn a_span_counts_the_part_under_the_latest_gpu_spans_once() {
|
||||
let mut spans = Spans::new();
|
||||
assert_eq!(spans.covered(0, 100), 0);
|
||||
for span in [
|
||||
(10, 30),
|
||||
(20, 40),
|
||||
(60, 70),
|
||||
(90, 200),
|
||||
(50, 50),
|
||||
(300, 400),
|
||||
] {
|
||||
spans.push(span);
|
||||
}
|
||||
// [10, 40) once, [60, 70) and [90, 100): 30 + 10 + 10.
|
||||
assert_eq!(spans.covered(0, 100), 50);
|
||||
assert_eq!(spans.covered(25, 65), 20);
|
||||
assert_eq!(spans.covered(40, 60), 0);
|
||||
assert_eq!(spans.covered(100, 100), 0);
|
||||
for at in 0..SPANS_KEPT as u64 {
|
||||
spans.push((1_000 + at, 1_001 + at));
|
||||
}
|
||||
assert_eq!(spans.covered(0, 1_000), 0, "the first spans no longer kept");
|
||||
assert_eq!(
|
||||
spans.covered(1_000, 1_000 + SPANS_KEPT as u64),
|
||||
SPANS_KEPT as u64
|
||||
);
|
||||
}
|
||||
|
||||
/// A command buffer's span from its GPU end to its handlers splits at the round's host times,
|
||||
/// the six steps adding up to the span; a step whose later time comes first is 0.
|
||||
#[test]
|
||||
fn a_command_buffer_s_span_to_its_handlers_splits_at_the_round_s_steps() {
|
||||
let round = Round::at(100, 110, 130, 160);
|
||||
let steps = round.steps(90, 175, 200);
|
||||
assert_eq!(steps, [10, 10, 20, 30, 15, 25]);
|
||||
assert_eq!(steps.iter().sum::<u64>(), 200 - 90);
|
||||
let none = Round::at(100, 110, 130, 130);
|
||||
assert_eq!(none.steps(120, 140, 150), [0, 10, 20, 0, 10, 10]);
|
||||
}
|
||||
|
||||
/// The stage histograms' bucket edges: under 2 us in bucket 0, from 2^i us to under 2^(i+1) us
|
||||
/// in bucket i, and from 2^22 us on in the last.
|
||||
@@ -1984,6 +2030,10 @@ pub(crate) mod on_device {
|
||||
]
|
||||
};
|
||||
let before = counters.metrics();
|
||||
assert!(
|
||||
before.calibrations >= 1,
|
||||
"{name}: the device start's calibration"
|
||||
);
|
||||
let mut spans = [0; 3];
|
||||
let mut handled_by = 0;
|
||||
for word in 1..=3 {
|
||||
@@ -2013,6 +2063,20 @@ pub(crate) mod on_device {
|
||||
"{name}: GPU end to handlers {} past its bound {handled_by}",
|
||||
added[3]
|
||||
);
|
||||
// Each end is placed no later than the round saw it, so the steps add up to the span.
|
||||
let steps = |m: &crate::Metrics| m.gpu_end_to_handler_steps_nanos.iter().sum::<u64>();
|
||||
assert_eq!(
|
||||
steps(&after) - steps(&before),
|
||||
added[3],
|
||||
"{name}: the completion thread's steps add up to GPU end to handlers"
|
||||
);
|
||||
let behind = after.scheduled_to_gpu_start_behind_nanos
|
||||
- before.scheduled_to_gpu_start_behind_nanos;
|
||||
assert!(
|
||||
behind <= added[1],
|
||||
"{name}: {behind} under earlier spans of {} from scheduling to GPU start",
|
||||
added[1]
|
||||
);
|
||||
drop((buffer, arena, queue, device));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -171,10 +171,12 @@ impl Calibration {
|
||||
vk::CalibratedTimestampInfoKHR::default().time_domain(vk::TimeDomainKHR::DEVICE),
|
||||
vk::CalibratedTimestampInfoKHR::default().time_domain(HOST_DOMAIN),
|
||||
];
|
||||
// The call's own time, counted with it (`Metrics::calibrations`): two clock reads.
|
||||
let began = host_time();
|
||||
// SAFETY: the device enables the extension (the floor's), and calibrates both domains.
|
||||
let (values, _) = unsafe { core.calibrated.get_calibrated_timestamps(&infos) }.ok()?;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
core.counters.calibrated();
|
||||
let read = unsafe { core.calibrated.get_calibrated_timestamps(&infos) };
|
||||
core.counters.calibrated(host_time().saturating_sub(began));
|
||||
let (values, _) = read.ok()?;
|
||||
let host = host_nanos(values[1])?;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
let host = host
|
||||
@@ -207,12 +209,78 @@ impl Calibration {
|
||||
seen: u64,
|
||||
) -> (u64, u64) {
|
||||
let span = ticks.span(start, end);
|
||||
let start = (self.host as f64 + ticks.nanos(self.tick, start)) as u64;
|
||||
let start = self.at(ticks, start);
|
||||
let excess = (start + span).saturating_sub(seen);
|
||||
self.host = self.host.saturating_sub(excess);
|
||||
let start = start.saturating_sub(excess);
|
||||
(start, start + span)
|
||||
}
|
||||
|
||||
/// The host time of timestamp `tick` by this calibration as it stands, which moves nothing:
|
||||
/// for the spans of the runtime's own command buffers ([`Spans`]).
|
||||
pub(crate) fn at(&self, ticks: &Ticks, tick: u64) -> u64 {
|
||||
(self.host as f64 + ticks.nanos(self.tick, tick)) as u64
|
||||
}
|
||||
}
|
||||
|
||||
/// How many of the latest GPU spans the completion thread keeps ([`Spans`]): more than the
|
||||
/// command buffers, uploads and copy-ins of a queue's three submissions in flight at sixteen
|
||||
/// command buffers each.
|
||||
pub(crate) const SPANS_KEPT: usize = 128;
|
||||
|
||||
/// The completion thread's latest GPU spans on the host clock, of the command buffers it retired
|
||||
/// with both timestamps, the program's and the runtime's own: [`SPANS_KEPT`] of them, the oldest
|
||||
/// replaced first, in place, with nothing allocated.
|
||||
pub(crate) struct Spans {
|
||||
spans: [(u64, u64); SPANS_KEPT],
|
||||
next: usize,
|
||||
kept: usize,
|
||||
}
|
||||
|
||||
impl Spans {
|
||||
pub(crate) fn new() -> Spans {
|
||||
Spans {
|
||||
spans: [(0, 0); SPANS_KEPT],
|
||||
next: 0,
|
||||
kept: 0,
|
||||
}
|
||||
}
|
||||
|
||||
/// One more span, from `start` to `end`; one of no length is not kept.
|
||||
pub(crate) fn push(&mut self, (start, end): (u64, u64)) {
|
||||
if end <= start {
|
||||
return;
|
||||
}
|
||||
self.spans[self.next] = (start, end);
|
||||
self.next = (self.next + 1) % SPANS_KEPT;
|
||||
self.kept = (self.kept + 1).min(SPANS_KEPT);
|
||||
}
|
||||
|
||||
/// The nanoseconds from `from` to `to` that lie under any span kept, the spans merged where
|
||||
/// they overlap (`Metrics::scheduled_to_gpu_start_behind_nanos`): one pass over the spans
|
||||
/// kept, then a sort of those that meet the range, in place.
|
||||
pub(crate) fn covered(&self, from: u64, to: u64) -> u64 {
|
||||
let mut met = [(0, 0); SPANS_KEPT];
|
||||
let mut count = 0;
|
||||
for &(start, end) in &self.spans[..self.kept] {
|
||||
let (start, end) = (start.max(from), end.min(to));
|
||||
if start < end {
|
||||
met[count] = (start, end);
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
let met = &mut met[..count];
|
||||
met.sort_unstable();
|
||||
let (mut covered, mut reached) = (0, from);
|
||||
for &(start, end) in met.iter() {
|
||||
let start = start.max(reached);
|
||||
if start < end {
|
||||
covered += end - start;
|
||||
reached = end;
|
||||
}
|
||||
}
|
||||
covered
|
||||
}
|
||||
}
|
||||
|
||||
/// The queries of one of the device's timestamp pools: the pairs of 2,048 command buffers. Neither
|
||||
@@ -417,15 +485,16 @@ pub(crate) enum OwnEnd {
|
||||
/// Gives back `pair` ([`begin_own`]) as its command buffer retires (`end`). Where it completed,
|
||||
/// its span is added to `Metrics::runtime_command_buffer_gpu_nanos` where both timestamps read,
|
||||
/// and one that reads as not available is counted ([`Pair::times`]); where it was submitted, both
|
||||
/// queries are reset first ([`reset`]).
|
||||
pub(crate) fn retire_own(core: &Core, pair: Option<Pair>, end: OwnEnd) {
|
||||
let Some(pair) = pair else {
|
||||
return;
|
||||
};
|
||||
/// queries are reset first ([`reset`]). Answers the two timestamps where it completed and both
|
||||
/// read, for the completion thread's spans ([`Spans`]).
|
||||
pub(crate) fn retire_own(core: &Core, pair: Option<Pair>, end: OwnEnd) -> Option<(u64, u64)> {
|
||||
let pair = pair?;
|
||||
let mut read = None;
|
||||
if end == OwnEnd::Completed {
|
||||
// SAFETY: the pair's pool is the device's, and only this retirement resets its two
|
||||
// queries, after this read.
|
||||
if let Some((start, stop)) = unsafe { pair.times(&core.device, &core.counters) } {
|
||||
read = unsafe { pair.times(&core.device, &core.counters) };
|
||||
if let Some((start, stop)) = read {
|
||||
(core.counters).runtime_command_buffer_ran(core.ticks.span(start, stop));
|
||||
}
|
||||
}
|
||||
@@ -433,4 +502,5 @@ pub(crate) fn retire_own(core: &Core, pair: Option<Pair>, end: OwnEnd) {
|
||||
reset(&core.device, pair.pool, pair.first, 2);
|
||||
}
|
||||
core.stamps.give_back(pair);
|
||||
read
|
||||
}
|
||||
@@ -390,6 +390,27 @@ const STAGES: [&str; 4] = [
|
||||
"gpu_end_to_handler",
|
||||
];
|
||||
|
||||
/// The executed counters of the completion thread's steps from a command buffer's GPU end to its
|
||||
/// handlers (`rt::Metrics::gpu_end_to_handler_steps_nanos`), all and the tail's, in its order.
|
||||
const HANDLER_STEPS: [[&str; 6]; 2] = [
|
||||
[
|
||||
"gpu_end_to_handler_seen_nanos",
|
||||
"gpu_end_to_handler_told_nanos",
|
||||
"gpu_end_to_handler_stamp_read_nanos",
|
||||
"gpu_end_to_handler_calibration_nanos",
|
||||
"gpu_end_to_handler_earlier_nanos",
|
||||
"gpu_end_to_handler_own_nanos",
|
||||
],
|
||||
[
|
||||
"gpu_end_to_handler_tail_seen_nanos",
|
||||
"gpu_end_to_handler_tail_told_nanos",
|
||||
"gpu_end_to_handler_tail_stamp_read_nanos",
|
||||
"gpu_end_to_handler_tail_calibration_nanos",
|
||||
"gpu_end_to_handler_tail_earlier_nanos",
|
||||
"gpu_end_to_handler_tail_own_nanos",
|
||||
],
|
||||
];
|
||||
|
||||
/// The stage histograms of `metrics`.
|
||||
fn stages(m: &rt::Metrics) -> Stages {
|
||||
[
|
||||
@@ -2982,6 +3003,13 @@ impl Backend for NewRuntime {
|
||||
),
|
||||
("gpu_run_nanos", metrics.gpu_run_nanos),
|
||||
("gpu_end_to_handler_nanos", metrics.gpu_end_to_handler_nanos),
|
||||
(
|
||||
"scheduled_to_gpu_start_behind_nanos",
|
||||
metrics.scheduled_to_gpu_start_behind_nanos,
|
||||
),
|
||||
("gpu_end_to_handler_tail", metrics.gpu_end_to_handler_tail),
|
||||
("calibrations", metrics.calibrations),
|
||||
("calibration_nanos", metrics.calibration_nanos),
|
||||
("held_starts", metrics.held_starts),
|
||||
("held_start_gap_nanos", metrics.held_start_gap_nanos),
|
||||
("runtime_command_buffers", metrics.runtime_command_buffers),
|
||||
@@ -3018,6 +3046,13 @@ impl Backend for NewRuntime {
|
||||
("not_attempted", self.skips.not_attempted_count()),
|
||||
("gap_pipeline_ids", self.unanswered_pipeline_ids),
|
||||
]);
|
||||
let steps = [
|
||||
metrics.gpu_end_to_handler_steps_nanos,
|
||||
metrics.gpu_end_to_handler_tail_steps_nanos,
|
||||
];
|
||||
for (names, steps) in HANDLER_STEPS.iter().zip(steps) {
|
||||
counters.extend(names.iter().copied().zip(steps));
|
||||
}
|
||||
self.surfaces.timed();
|
||||
counters.extend(self.surfaces.counted());
|
||||
counters.extend(self.videos.counted());
|
||||
|
||||
@@ -447,9 +447,11 @@ fn a_draw_into_a_pass_plays_on_the_new_runtime() {
|
||||
assert_eq!(report.first_skip, None);
|
||||
}
|
||||
|
||||
/// A play's report carries the runtime's stage sums among its executed counters, and its stage
|
||||
/// histograms as each frame ended and at the play's end: two frames of one fill each count one
|
||||
/// command buffer more in each histogram by each frame's end.
|
||||
/// A play's report carries the runtime's stage sums among its executed counters, with the part
|
||||
/// from scheduling to GPU start under earlier spans and the completion thread's steps, which add
|
||||
/// up to the span from GPU end to handlers, and its stage histograms as each frame ended and at
|
||||
/// the play's end: two frames of one fill each count one command buffer more in each histogram by
|
||||
/// each frame's end.
|
||||
#[test]
|
||||
fn a_play_reports_the_runtime_s_command_buffer_stages() {
|
||||
let dir = ScratchDir::new("rt-replay-stages").unwrap();
|
||||
@@ -482,10 +484,38 @@ fn a_play_reports_the_runtime_s_command_buffer_stages() {
|
||||
"runtime_command_buffers",
|
||||
"runtime_command_buffer_gpu_nanos",
|
||||
"untimed_command_buffers",
|
||||
"scheduled_to_gpu_start_behind_nanos",
|
||||
"gpu_end_to_handler_tail",
|
||||
"calibrations",
|
||||
"calibration_nanos",
|
||||
];
|
||||
for key in sums {
|
||||
assert!(executed.contains_key(key), "{key}: {executed:?}");
|
||||
}
|
||||
// The completion thread's six steps add up to each span from a GPU end to its handlers.
|
||||
let steps = [
|
||||
"seen",
|
||||
"told",
|
||||
"stamp_read",
|
||||
"calibration",
|
||||
"earlier",
|
||||
"own",
|
||||
];
|
||||
let sum = |infix: &str| -> u64 {
|
||||
(steps.iter())
|
||||
.map(|step| executed[format!("gpu_end_to_handler_{infix}{step}_nanos").as_str()])
|
||||
.sum()
|
||||
};
|
||||
assert_eq!(
|
||||
sum(""),
|
||||
executed["gpu_end_to_handler_nanos"],
|
||||
"{executed:?}"
|
||||
);
|
||||
assert!(sum("tail_") <= sum(""), "{executed:?}");
|
||||
assert!(
|
||||
executed["scheduled_to_gpu_start_behind_nanos"] <= executed["scheduled_to_gpu_start_nanos"],
|
||||
"{executed:?}"
|
||||
);
|
||||
let counted = |at: &str| -> Vec<u64> {
|
||||
let prefix = format!("stages {at} ");
|
||||
let line = lines.iter().find(|line| line.starts_with(&prefix));
|
||||
|
||||
@@ -1579,6 +1579,8 @@ field metal2vulkan-runtime::Metrics.bytes_copied pub bytes_copied: u64
|
||||
field metal2vulkan-runtime::Metrics.bytes_zeroed pub bytes_zeroed: u64
|
||||
field metal2vulkan-runtime::Metrics.cache_bytes_written pub cache_bytes_written: u64
|
||||
field metal2vulkan-runtime::Metrics.cache_writes_dropped pub cache_writes_dropped: u64
|
||||
field metal2vulkan-runtime::Metrics.calibration_nanos pub calibration_nanos: u64
|
||||
field metal2vulkan-runtime::Metrics.calibrations pub calibrations: u64
|
||||
field metal2vulkan-runtime::Metrics.commit_lock_wait_max_nanos pub commit_lock_wait_max_nanos: u64
|
||||
field metal2vulkan-runtime::Metrics.commit_lock_wait_nanos pub commit_lock_wait_nanos: u64
|
||||
field metal2vulkan-runtime::Metrics.commit_to_scheduled pub commit_to_scheduled: [u64; STAGE_BUCKETS]
|
||||
@@ -1609,6 +1611,9 @@ field metal2vulkan-runtime::Metrics.first_use_wait_nanos pub first_use_wait_nano
|
||||
field metal2vulkan-runtime::Metrics.first_use_waits pub first_use_waits: u64
|
||||
field metal2vulkan-runtime::Metrics.gpu_end_to_handler pub gpu_end_to_handler: [u64; STAGE_BUCKETS]
|
||||
field metal2vulkan-runtime::Metrics.gpu_end_to_handler_nanos pub gpu_end_to_handler_nanos: u64
|
||||
field metal2vulkan-runtime::Metrics.gpu_end_to_handler_steps_nanos pub gpu_end_to_handler_steps_nanos: [u64; HANDLER_STEPS]
|
||||
field metal2vulkan-runtime::Metrics.gpu_end_to_handler_tail pub gpu_end_to_handler_tail: u64
|
||||
field metal2vulkan-runtime::Metrics.gpu_end_to_handler_tail_steps_nanos pub gpu_end_to_handler_tail_steps_nanos: [u64; HANDLER_STEPS]
|
||||
field metal2vulkan-runtime::Metrics.gpu_run pub gpu_run: [u64; STAGE_BUCKETS]
|
||||
field metal2vulkan-runtime::Metrics.gpu_run_nanos pub gpu_run_nanos: u64
|
||||
field metal2vulkan-runtime::Metrics.held_release_bytes pub held_release_bytes: u64
|
||||
@@ -1680,6 +1685,7 @@ field metal2vulkan-runtime::Metrics.runtime_command_buffer_gpu_nanos pub runtime
|
||||
field metal2vulkan-runtime::Metrics.runtime_command_buffers pub runtime_command_buffers: u64
|
||||
field metal2vulkan-runtime::Metrics.sampler_element_writes pub sampler_element_writes: u64
|
||||
field metal2vulkan-runtime::Metrics.scheduled_to_gpu_start pub scheduled_to_gpu_start: [u64; STAGE_BUCKETS]
|
||||
field metal2vulkan-runtime::Metrics.scheduled_to_gpu_start_behind_nanos pub scheduled_to_gpu_start_behind_nanos: u64
|
||||
field metal2vulkan-runtime::Metrics.scheduled_to_gpu_start_nanos pub scheduled_to_gpu_start_nanos: u64
|
||||
field metal2vulkan-runtime::Metrics.shared_long_reuses pub shared_long_reuses: u64
|
||||
field metal2vulkan-runtime::Metrics.shared_remade_after_frees pub shared_remade_after_frees: u64
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -982,7 +982,14 @@ gpu_end_to_handler=...` for each frame `F` a later call followed and `stages end
|
||||
end (the runtime's four histograms of its command buffers' stages, `Metrics::commit_to_scheduled`
|
||||
and the three after it, bucket by bucket, as they stood then, since the device was made: a span's
|
||||
histogram is the difference of two lines; the executed counters `commit_to_scheduled_nanos` and
|
||||
the three like it sum each stage's spans, `held_starts` and `held_start_gap_nanos` count the
|
||||
the three like it sum each stage's spans, `scheduled_to_gpu_start_behind_nanos` the part from
|
||||
scheduling to GPU start under other command buffers' GPU spans, the runtime's own included,
|
||||
`gpu_end_to_handler_seen_nanos`, `_told_nanos`, `_stamp_read_nanos`, `_calibration_nanos`,
|
||||
`_earlier_nanos` and `_own_nanos` the completion thread's six steps of the span from GPU end to
|
||||
handlers (`Metrics::gpu_end_to_handler_steps_nanos`), `gpu_end_to_handler_tail` the command
|
||||
buffers whose span is 1,024 us or more and `gpu_end_to_handler_tail_seen_nanos` and the five
|
||||
like it their steps, `calibrations` and `calibration_nanos` the clock calibrations and their
|
||||
calls' time, `held_starts` and `held_start_gap_nanos` count the
|
||||
groups a queue held behind three submissions in flight and the GPU's time behind them, and
|
||||
`runtime_command_buffers` and `runtime_command_buffer_gpu_nanos` the runtime's own uploads and
|
||||
copy-ins and their GPU time, outside every Metal command buffer's GPU interval), its
|
||||
|
||||
Reference in new issue
Block a user