📝 Say a Windows landing can take 15 to 20 s for now [ci skip]
The Direct3D 11 draws' wait into a video cache's planes is bounded at DEVICE_WAIT and then STALL_HOLD from the draw's own start, after the decode's sync, itself bounded at DEVICE_WAIT. So a Windows landing can take 15 to 20 s, past the 15 s from the frame's first wait that TEARDOWN_WAIT and HAND_OFF_WAIT assume. Row 20 says so until the fix that carries one deadline from the frame's first wait through the sync and the draw lands.
This commit is contained in:
1 parent
845641e32c
commit
76e6c90369
1 file changed
+1
-1
@@ -67,7 +67,7 @@ and signals the session's shared event.
|
||||
| 17 | A landing in flight at the device's reset, to the rebooted guest | The session's landing thread (rows 14 to 16) | The rebooted guest | The settle waits for every command buffer committed before the reset, and a decode's waits for the session's event, which the reset's release does not set; a landing whose write stalled signals only once the device is done with it (row 14). A faulted walk's stand-in, which the settle waits for, waits for the work its walk handed off (row 13) | `reims-vgpu/src/graphics.rs`, `settle_for_reset`: "Then it waits until every command buffer committed before then has completed and run its completed handlers ([`GpuDevice::settle`])" | `graphics::decode::cmdbuf::tests::a_reset_s_release_leaves_a_decode_s_wait_for_its_session_s_event`, and rows 13's and 14's | The reset returns |
|
||||
| 18 | VA-API's video processing into the session's scratch, where the driver declines the output's caches in place (Linux) | The driver's video-processing run (`Frame::write_to_guest`), into the scratch, a dma-buf buffer of the runtime device's | The runtime's `videoEncodeFill` copy (row 19) | The run's fence, then `vaSyncSurface2`, asked after until `DEVICE_WAIT`, then the scratch acquired (`Buffer::external_write_done`) before the copy. Past the deadline the picture fails before the copy, and the decoder fails each later call, so no copy reads the scratch again | `reims-vgpu/src/graphics/vaapi/gpu_copy.rs`, module doc: "**A picture** is written into the scratch by the driver's video processing (the VA crate's `Frame::write_to_guest`, as the first way writes a cache, through the scratch's memory as [`CacheBytes`]), acquired (`Buffer::external_write_done`), then copied by the platform library's `videoEncodeFill` kernel" | Ignored, needing the hardware and the conformance suite's streams: `graphics::vaapi::gpu_copy::tests::a_picture_copied_by_the_gpu_from_its_scratch_is_the_cpus_copy`; none fails the run's wait | Row 13's failure; the caches hold their earlier bytes, or the zeros they owe |
|
||||
| 19 | The runtime's copy from the scratch into the output's device caches (Linux) | The runtime's GPU: the `videoEncodeFill` kernel, from the scratch (row 18) into the caches' buffers, on the copier's own queue | The runtime's reads of the caches | The copy's command buffer, waited for before the session's signal. A copy that ends in an error fails the picture, and the next picture's copy takes its scratch and arguments again. Where the wait fails, or returns with the copy unfinished, which no rt wait does (above), the copy may still write the caches after the signal: **none**. Its scratch and arguments are kept out of use while the session lives, and at a second such copy the session's GPU copies end, its later pictures copied by the CPU | `reims-vgpu/src/graphics/vaapi/gpu_copy.rs`, module doc: "then the copy is waited for." and "**A copy that failed once submitted** fails its picture, with no copy of the CPU's into the caches the GPU may write still. Where its wait returned and it ended in an error, the GPU is done with it: the next picture's copy takes its scratch and arguments again" | `graphics::vaapi::gpu_copy::tests::on_rt_the_kernel_copies_a_pictures_crop_from_its_scratch_and_nothing_else`, `graphics::vaapi::gpu_copy::tests::a_copy_that_ends_in_an_error_takes_its_scratch_and_arguments_again`, `graphics::vaapi::gpu_copy::tests::a_copy_whose_wait_fails_keeps_its_scratch_and_arguments_out_of_use`, `graphics::vaapi::gpu_copy::tests::a_second_copy_whose_wait_fails_ends_the_session_s_gpu_copies`, `graphics::vaapi::gpu_copy::tests::a_copy_whose_wait_returns_unfinished_is_kept_out_of_use_and_a_second_ends_the_copies`; ignored, needing the hardware: `graphics::vaapi::gpu_copy::tests::a_picture_whose_copy_ends_in_an_error_fails_and_its_scratch_is_taken_again`, `graphics::vaapi::gpu_copy::tests::a_picture_whose_copy_s_wait_fails_fails_and_a_second_ends_the_session_s_gpu_copies` | Row 13's failure; once the session's GPU copies end, its later pictures are copied by the CPU (row 29) |
|
||||
| 20 | A Windows host's draw of VA-API's picture into a cache's surface over Direct3D 11 textures | Direct3D 11 over the pools' Direct3D 12 device (D3D11On12): one draw a plane, from the shared Direct3D 12 texture VA-API decoded into, its decode synced first until `DEVICE_WAIT`, into two textures the platform imports as the cache's planes | The runtime's reads of the cache's planes | The context's signal of a fence after the draws, waited for on the landing thread on the fence's event until `DEVICE_WAIT` from the wait's start (a device Windows removes answers the fence with `UINT64_MAX`), and, where the GPU has not finished by then, up to `STALL_HOLD` (10 s) more, as a landing whose hardware work stalled is held (row 14), counted as `video-drawn-waits-held`; then the surface said written (`ImportedSurfaceMemory::external_writes_done`). Where a call of that wait fails once the draws are submitted, the fence's value is polled within the same bounds, counted as `video-drawn-waits-polled`. Where the signal is refused, the draws are flushed all the same with an end of an event query after them, polled within the same bounds, counted as `video-drawn-waits-queried`. Past the hold, or at once with the query refused too, the draw is `DrawError::Unwaited`, and the process ends at it with a named death (`graphics::drawn`'s `unwaited`): the draws may still write the textures | `reims-vgpu-video/src/vaapi/va/d3d11.rs`, module doc: "Once the wait returns the importer may read the targets: the caller says so to it (`external_writes_done`). Nothing else orders the writes before the reads: the context's signal, the fence's wait and then the importer's acquire do, and no device takes a keyed mutex." and: "Its wait is bounded by `DEVICE_WAIT` (5 s), the crate's bound of a frame's work on its device, from the wait's start on the clock of the runtime the draws were made with, and then by the hold the caller made the draws with ([`PlaneDraw::new`]; reims-vgpu's `STALL_HOLD`, 10 s): work the GPU has not finished by `DEVICE_WAIT`, its fence or query still answering, stalled, and is waited for up to the hold more" and: "So the draw flushes them all the same, with an end of an event query after them [...] and polls the query [...] until the GPU passed its end, under the same bounds"; `reims-vgpu/src/graphics/drawn.rs`, module doc: "the process ends at that draw or clear [...] the GPU may still write the textures, from a pool texture that may by then hold another picture, so neither the CPU's copy nor the platform's reads may follow it." | Ignored, needing Direct3D 11 on the Windows host: `vaapi::va::d3d11::tests::no_draw_returns_before_its_context_stream_ran_however_busy_the_gpu`, `vaapi::va::d3d11::tests::each_picture_drawn_into_its_targets_is_what_get_image_reads_back`, `vaapi::va::d3d11::tests::a_draw_whose_wait_on_its_fences_event_fails_returns_once_the_gpu_ran_it`, `vaapi::va::d3d11::tests::a_draw_whose_fence_signal_is_refused_returns_once_the_gpu_ran_it`, `vaapi::va::d3d11::tests::a_draw_whose_signal_and_query_are_refused_is_unwaited`, `vaapi::va::d3d11::tests::a_draw_the_gpu_never_finishes_is_unwaited_at_its_bound`, `vaapi::va::d3d11::tests::a_draw_the_gpu_finishes_in_its_hold_returns_held`; on Windows hosts: `vaapi::va::d3d11::tests::a_poll_with_no_answer_by_its_bound_is_unwaited`, `graphics::drawn::tests::a_wait_that_polled_is_counted_by_its_code`, `graphics::drawn::tests::a_draw_no_wait_answered_ends_the_process_at_it` | Where the draw failed with nothing it submitted left to run (`DrawError::Failed`), the CPU's copy lands the picture in the textures (row 29), over the zeros they owe, cleared first (`DrawnPlanes::unwritten`); counted as `video-pictures-undrawn`. A draw that no wait answered lands nothing: the process ends at it |
|
||||
| 20 | A Windows host's draw of VA-API's picture into a cache's surface over Direct3D 11 textures | Direct3D 11 over the pools' Direct3D 12 device (D3D11On12): one draw a plane, from the shared Direct3D 12 texture VA-API decoded into, its decode synced first until `DEVICE_WAIT`, into two textures the platform imports as the cache's planes | The runtime's reads of the cache's planes | The context's signal of a fence after the draws, waited for on the landing thread on the fence's event until `DEVICE_WAIT` from the wait's start (a device Windows removes answers the fence with `UINT64_MAX`), and, where the GPU has not finished by then, up to `STALL_HOLD` (10 s) more, as a landing whose hardware work stalled is held (row 14), counted as `video-drawn-waits-held`; then the surface said written (`ImportedSurfaceMemory::external_writes_done`). Where a call of that wait fails once the draws are submitted, the fence's value is polled within the same bounds, counted as `video-drawn-waits-polled`. Where the signal is refused, the draws are flushed all the same with an end of an event query after them, polled within the same bounds, counted as `video-drawn-waits-queried`. Past the hold, or at once with the query refused too, the draw is `DrawError::Unwaited`, and the process ends at it with a named death (`graphics::drawn`'s `unwaited`): the draws may still write the textures. For now a Windows landing can take 15 to 20 s: its decode's sync up to `DEVICE_WAIT`, then the draw's own `DEVICE_WAIT` and `STALL_HOLD` (15 s), past the 15 s from the frame's first wait that `TEARDOWN_WAIT` and `HAND_OFF_WAIT` assume (`DEVICE_WAIT` and `STALL_HOLD`) | `reims-vgpu-video/src/vaapi/va/d3d11.rs`, module doc: "Once the wait returns the importer may read the targets: the caller says so to it (`external_writes_done`). Nothing else orders the writes before the reads: the context's signal, the fence's wait and then the importer's acquire do, and no device takes a keyed mutex." and: "Its wait is bounded by `DEVICE_WAIT` (5 s), the crate's bound of a frame's work on its device, from the wait's start on the clock of the runtime the draws were made with, and then by the hold the caller made the draws with ([`PlaneDraw::new`]; reims-vgpu's `STALL_HOLD`, 10 s): work the GPU has not finished by `DEVICE_WAIT`, its fence or query still answering, stalled, and is waited for up to the hold more" and: "So the draw flushes them all the same, with an end of an event query after them [...] and polls the query [...] until the GPU passed its end, under the same bounds"; `reims-vgpu/src/graphics/drawn.rs`, module doc: "the process ends at that draw or clear [...] the GPU may still write the textures, from a pool texture that may by then hold another picture, so neither the CPU's copy nor the platform's reads may follow it." | Ignored, needing Direct3D 11 on the Windows host: `vaapi::va::d3d11::tests::no_draw_returns_before_its_context_stream_ran_however_busy_the_gpu`, `vaapi::va::d3d11::tests::each_picture_drawn_into_its_targets_is_what_get_image_reads_back`, `vaapi::va::d3d11::tests::a_draw_whose_wait_on_its_fences_event_fails_returns_once_the_gpu_ran_it`, `vaapi::va::d3d11::tests::a_draw_whose_fence_signal_is_refused_returns_once_the_gpu_ran_it`, `vaapi::va::d3d11::tests::a_draw_whose_signal_and_query_are_refused_is_unwaited`, `vaapi::va::d3d11::tests::a_draw_the_gpu_never_finishes_is_unwaited_at_its_bound`, `vaapi::va::d3d11::tests::a_draw_the_gpu_finishes_in_its_hold_returns_held`; on Windows hosts: `vaapi::va::d3d11::tests::a_poll_with_no_answer_by_its_bound_is_unwaited`, `graphics::drawn::tests::a_wait_that_polled_is_counted_by_its_code`, `graphics::drawn::tests::a_draw_no_wait_answered_ends_the_process_at_it` | Where the draw failed with nothing it submitted left to run (`DrawError::Failed`), the CPU's copy lands the picture in the textures (row 29), over the zeros they owe, cleared first (`DrawnPlanes::unwritten`); counted as `video-pictures-undrawn`. A draw that no wait answered lands nothing: the process ends at it |
|
||||
| 21 | A picture whose command buffer completed at its decode, to the output's readers | The session's GPU work into the caches once the decode is done: VA-API's video processing into them (row 15), or a Windows host's draw (row 20) | The guest's readers of the output once the buffer's `CB_COMPLETE` posts: a GPU reader on another queue, a blit from it, a lock's download into the pages, a present, the session's next decode | The decode's command buffer's platform end, after the session's signal, which every reader of the output waits for: a GPU reader for the value the buffer's queue's timeline reaches at its end, and a download, a present and a later decode on the CPU. A faulted walk waits as row 13's | `reims-vgpu/src/graphics/decode/video.rs`, module doc: "Everything else stays at the platform end, after the copy or the draw: the session's signal, the buffer's surface timeline and its caches' copies into the pages, which every reader of the output waits for" | `graphics::decode::cmdbuf::tests::a_decode_alone_into_caches_completes_at_its_decode_and_ends_at_its_end`, `graphics::decode::cmdbuf::tests::a_reader_of_a_decode_completed_ahead_waits_on_the_gpu_for_its_end`, `graphics::decode::cmdbuf::tests::a_blit_from_a_decode_completed_ahead_copies_after_its_end`, `graphics::decode::cmdbuf::tests::a_download_after_a_decode_completed_ahead_copies_after_its_end`, `graphics::decode::cmdbuf::tests::a_present_after_a_decode_completed_ahead_waits_for_its_end`, `graphics::decode::cmdbuf::tests::a_decode_after_a_decode_completed_ahead_waits_on_the_cpu_for_its_end` | The caches as the failed landing left them, the buffer completed as landed; the guest is told one decode late, the session's next decode failing in its stead (`video-landing-failure-carried`), or never where the session ends first (`video-landing-failure-untold`) |
|
||||
|
||||
## x86-64 guests: the device's video encode
|
||||
|
||||
Reference in new issue
Block a user