From 508a70b5ebe52b5ffd93d5d62a2e122d7796fdca Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 12 Nov 2026 18:50:57 -0800 Subject: [PATCH] RUNTIME_VERSION 2177: a GPU that stops with no loss from the driver fails its work and is parked The five commits before this one. On NVIDIA after an Xid 109 the device's queues stopped: no batch completed and every completion wait answered VK_TIMEOUT, never VK_ERROR_DEVICE_LOST, so the program's command buffers waited without end. The completion's waiters keep a device-wide stall clock (command_buffer/stall.rs) that runs while a wait ran out with its front batch pending and stops whenever any queue's timeline advances. Past 10 s one waiter probes the staging queue with an empty submission and for up to 2 s reads the probe, the stuck front's fence and its timeline; a loss takes the failed wait's path, an answered probe or an advanced front fails nothing and restarts the clock, so a device that still makes progress is never failed whatever its work's length. An unanswered probe marks the generation stopped and lost (the oldest command buffer GpuHang, the rest GpuRecoveryVictim), the line recovers, and the VkDevice is parked: never destroyed, none of its objects released, its queues never waited for, its teardown returning before vkDeviceWaitIdle. New public query Device::is_parked(vk::Device) -> bool (no Metal counterpart); counters stall_probes_sent, wedges_declared, longest_stall_nanos; the DeviceRecovered notice says the VkDevice stopped and was parked. The queue-switch check's waits end for a parked device. FAST-PATHS known gaps: no probe without a staging queue, the parked device's leak, NVIDIA's exit handler waiting on a parked device's work, Metal's own bounds. Verified (on the branch, archive c010d899ff, validation layer 1.4.363 on, NVIDIA 620.70.06): um870 RTX 3090 (m3-max-23757) 5/5 and um790 RTX 2080 (23758) 5/5: an answered stall sends 2 probes that complete in 81-197 us and fails nothing (longest stall 200 ms), a stopped one fails after 2.3 s with 1 probe, 1 wedge, 1 recovery, the device made again in 512-549 ms and the next command buffer running; the managed-copy rounds 0 wrong on all three routes, the layer's whole-pool vkResetQueryPool report (VUID-vkResetQueryPool-firstQuery-02741, the documented layer gap) claimed through layer_claim::Watched. lavapipe 95/95 (23685, at 1f24262fad). Clippy default, m2v_gpu, m2v_cpu_icd, rustdoc and the api tests at c010d899ff (23748). --- crates/metal2vulkan/src/cache/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index 581c47b82..2109cc1f3 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 512; /// changes no behaviour, and then updates that hash alone with the commit saying why, or changes /// behaviour and also bumps this version. The commit that bumps it says what changed; this comment /// keeps no history. -pub const RUNTIME_VERSION: u32 = 2176; +pub const RUNTIME_VERSION: u32 = 2177; /// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex, /// of the manifest, the build script, and exactly the files the crate roots' module tree compiles