mesh=false hosts drop the whole world; and VICTORY_TEXTURE_BUDGET_MB reliably gets the device removed #415

Open
opened 2026-11-26 03:42:58 +00:00 by github-bot · 2 comments
Owner

@⁠2150272538-jpg on GitHub · 2026-11-25 00:30 UTC · original

GPU: RX 5700 XT 8 GB (RDNA1, FL 12_1, no mesh shader)
OS: Windows 10 19045, system d3d12.dll 10.0.19041.5794
Runtime: Agility SDK 1.606.3 (D3D12Core.dll + d3d12SDKLayers.dll next to the exe, /EXPORT:D3D12SDKVersion,DATA and D3D12SDKPath,DATA)
CPU: Xeon E5-2698 v3, 16C/32T, 16 GB RAM, 32 GB pagefile, TdrDelay=60
Title: 7952987A, game_scarlett_master.exe, 208.6 GB, data on NVMe
Source: fxceless/victory-fork @ 2119b0e, release build, 1920×1080 (and 1280×720)
What works
Menus, account picker, language list, brightness calibration (Chinese UI), the loading art and the intro camera beat all render correctly, at 30 fps on the loading screens. shader does not translate went 413 → 0 and no host texture 33 → 0 compared to the older tree I started from, and I get 0 device removals in a 300 s run where the old tree died at 263 s. Nice work on e9765a7.

Issue 1 — no mesh shaders means no world (expected? worth stating)
代码块

INFO victory_gpu::host: host mesh shader support mesh=false
WARN victory_gpu::pipeline::host: no host pipeline: the host GPU has no mesh shaders (or no shader model 6.6) (logged once)
shaders=[mesh d4111a6e6ea49d91, pixel c0a7fe77b1862e10]
Per frame:

代码块

dropped 1232-1286 without a host pipeline (0 being made) and 4055 indirect
Only vertex/pixel geometry survives (hair, trees); ground, buildings and the character body never draw.

Two sub-questions:

Is a non-mesh fallback (meshlet cull on compute + draw-indirect of expanded verts) something you'd accept a PR for, or is it out of scope?
WARP reports mesh=false too on this runtime. Is that a WARP limitation you know about, or should VICTORY_D3D12_WARP=1 be documented as "menus only"?
Issue 2 — VICTORY_TEXTURE_BUDGET_MB=6144 kills the device in ~220 s
720p, speed switches on (VICTORY_LATE_WAIT=3, VICTORY_WIDE_BACK=1, VICTORY_CARD_BUFFERS_MB=1024), budget 6144:

代码块

victory_gpu::host: host GPU device removed after 16 submissions sent ahead (VICTORY_LATE_WAIT=1) of 128 lists;
no breadcrumbs (0x887A0004)
device removed: GPU 不响应更多的命令 (0x887A0007)
GPU frame time right before: 900 → 1902 → 3942 → 4768 ms.

Two things look suspicious to me:

The submissions themselves are short (slow host submission ms=329 lists=15, ms=331 lists=30), far under any TDR threshold, yet GetDeviceRemovedReason() is 0x887A0004 (UNSUPPORTED) — same reason code I get on the older tree at 1080p/263 s.
Just before the hang the log shows a sweeper releasing copies (sweep: N host copies ... let go) and then
代码块

indirect execution dropped (first time for this signature) stride=20 args=1, 32761, 1325099172, 32761 max=1
1325099172 looks like an unclamped address/index rather than a count — could the budget sweep be freeing a resource the in-flight indirect args still reference?
Control runs on the same build: budget 4096 → no device removal but 71 × 0x8007000E (no host list for a prelude, no upload buffer size=11189768); no budget → 0x8007000E at 113 s. So on 8 GB there is no setting that both fits and survives — I'm reporting it in case the failure mode is useful, not because I expect 8 GB to work.

Issue 3 — docs: the binary needs the Agility exports
Out of the box on Win10 the build gets nothing on screen: every pipeline is refused with Unsupported bit-flag set (root signature flags c01) then E_INVALIDARG, because the translated DXIL uses SM 6.6 (ResourceDescriptorHeap[], SamplerDescriptorHeap[]) and the system runtime is 19041. Removing the 0x400/0x800 root-signature flags is not enough — the DXIL is 6.6 regardless. What fixed it was adding D3D12SDKVersion = 606 / D3D12SDKPath = "D3D12\" and shipping Agility 1.606.3. If that's the intended requirement, a line in the README next to "shader model 6.6" would save the next person a day.

Happy to provide
crashes.log, the two minidumps, full logs (F:\run-*.err) and the RT dumps if useful — say which and I'll put them in a gist.

**@⁠2150272538-jpg** on GitHub · 2026-11-25 00:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/415) GPU: RX 5700 XT 8 GB (RDNA1, FL 12_1, no mesh shader) OS: Windows 10 19045, system d3d12.dll 10.0.19041.5794 Runtime: Agility SDK 1.606.3 (D3D12Core.dll + d3d12SDKLayers.dll next to the exe, /EXPORT:D3D12SDKVersion,DATA and D3D12SDKPath,DATA) CPU: Xeon E5-2698 v3, 16C/32T, 16 GB RAM, 32 GB pagefile, TdrDelay=60 Title: 7952987A, game_scarlett_master.exe, 208.6 GB, data on NVMe Source: fxceless/victory-fork @ 2119b0e, release build, 1920×1080 (and 1280×720) What works Menus, account picker, language list, brightness calibration (Chinese UI), the loading art and the intro camera beat all render correctly, at 30 fps on the loading screens. shader does not translate went 413 → 0 and no host texture 33 → 0 compared to the older tree I started from, and I get 0 device removals in a 300 s run where the old tree died at 263 s. Nice work on e9765a7. Issue 1 — no mesh shaders means no world (expected? worth stating) 代码块 INFO victory_gpu::host: host mesh shader support mesh=false WARN victory_gpu::pipeline::host: no host pipeline: the host GPU has no mesh shaders (or no shader model 6.6) (logged once) shaders=[mesh d4111a6e6ea49d91, pixel c0a7fe77b1862e10] Per frame: 代码块 dropped 1232-1286 without a host pipeline (0 being made) and 4055 indirect Only vertex/pixel geometry survives (hair, trees); ground, buildings and the character body never draw. Two sub-questions: Is a non-mesh fallback (meshlet cull on compute + draw-indirect of expanded verts) something you'd accept a PR for, or is it out of scope? WARP reports mesh=false too on this runtime. Is that a WARP limitation you know about, or should VICTORY_D3D12_WARP=1 be documented as "menus only"? Issue 2 — VICTORY_TEXTURE_BUDGET_MB=6144 kills the device in ~220 s 720p, speed switches on (VICTORY_LATE_WAIT=3, VICTORY_WIDE_BACK=1, VICTORY_CARD_BUFFERS_MB=1024), budget 6144: 代码块 victory_gpu::host: host GPU device removed after 16 submissions sent ahead (VICTORY_LATE_WAIT=1) of 128 lists; no breadcrumbs (0x887A0004) device removed: GPU 不响应更多的命令 (0x887A0007) GPU frame time right before: 900 → 1902 → 3942 → 4768 ms. Two things look suspicious to me: The submissions themselves are short (slow host submission ms=329 lists=15, ms=331 lists=30), far under any TDR threshold, yet GetDeviceRemovedReason() is 0x887A0004 (UNSUPPORTED) — same reason code I get on the older tree at 1080p/263 s. Just before the hang the log shows a sweeper releasing copies (sweep: N host copies ... let go) and then 代码块 indirect execution dropped (first time for this signature) stride=20 args=[[1, 32761, 1325099172, 32761]] max=1 1325099172 looks like an unclamped address/index rather than a count — could the budget sweep be freeing a resource the in-flight indirect args still reference? Control runs on the same build: budget 4096 → no device removal but 71 × 0x8007000E (no host list for a prelude, no upload buffer size=11189768); no budget → 0x8007000E at 113 s. So on 8 GB there is no setting that both fits and survives — I'm reporting it in case the failure mode is useful, not because I expect 8 GB to work. Issue 3 — docs: the binary needs the Agility exports Out of the box on Win10 the build gets nothing on screen: every pipeline is refused with Unsupported bit-flag set (root signature flags c01) then E_INVALIDARG, because the translated DXIL uses SM 6.6 (ResourceDescriptorHeap[], SamplerDescriptorHeap[]) and the system runtime is 19041. Removing the 0x400/0x800 root-signature flags is not enough — the DXIL is 6.6 regardless. What fixed it was adding D3D12SDKVersion = 606 / D3D12SDKPath = "D3D12\\" and shipping Agility 1.606.3. If that's the intended requirement, a line in the README next to "shader model 6.6" would save the next person a day. Happy to provide crashes.log, the two minidumps, full logs (F:\run-*.err) and the RT dumps if useful — say which and I'll put them in a gist.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:42:58 +00:00
Author
Owner

@⁠Kcaiooooo on GitHub · 2026-11-25 00:45 UTC · original

I traced the texture-budget part of this report on current main (a803c87). In resource::room(), setting VICTORY_TEXTURE_BUDGET_MB makes the check return based solely on the bytes held by these texture copies. The process's total local video-memory usage reported by DXGI is then ignored. A 6144 MiB texture cap can therefore still admit new copies when the process is already near its DXGI budget because of other allocations.

The candidate below keeps the manual cap and also uses main's existing 90% DXGI budget threshold when the adapter reports a budget. It preserves the default path and keeps using the manual cap if budget telemetry is unavailable. This is a guard on admitting new copies; the device-removal cause and the suspected in-flight resource lifetime issue remain open.

I tested the decision in isolation with an 8 GiB budget. At 4 GiB of texture copies and 7,800 MiB of total usage, the original rule admitted another copy and the candidate declined. The regression test passed with the patch, and cargo check --locked --target x86_64-pc-windows-msvc -p victory-gpu --tests --features blake3/pure passed from Linux. I haven't run this on an RX 5700 XT or in the title.

If you're able to retest, could you compare this patch against the same revision with VICTORY_TEXTURE_BUDGET_MB=6144 and share whether device removal still occurs, or whether the texture queue instead reports that the card has no room? Keeping the other flags and cache conditions fixed would help distinguish the two outcomes.

Patch against a803c87
diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs
--- a/crates/victory-gpu/src/resource.rs
+++ b/crates/victory-gpu/src/resource.rs
@@ -1357,31 +1357,34 @@
 /// Whether more host copies of textures the title fills may be made for
 /// shaders that pick textures by index (`draw.rs` `heap_textures`): always
 /// up to `FLOOR` bytes of them, beyond that while the card's memory in use
-/// by this process is under nine tenths of the budget the system gives it
-/// (`VICTORY_TEXTURE_BUDGET_MB` sets a limit on those copies' bytes
-/// instead). Past the budget the system moves the card's memory into the
-/// PC's, which ended runs 20 and 24.
+/// by this process is under nine tenths of the budget the system gives it.
+/// `VICTORY_TEXTURE_BUDGET_MB` replaces the default texture allowance and
+/// still respects the system's budget when available.
 #[cfg(windows)]
 pub(crate) fn room() -> bool {
     use std::sync::atomic::Ordering::Relaxed;
-    const FLOOR: u64 = 2 << 30;
-    const WITHOUT_BUDGET: u64 = 4 << 30;
     static LIMIT: std::sync::OnceLock<Option<u64>> = std::sync::OnceLock::new();
     let limit = *LIMIT.get_or_init(|| {
         let mb = std::env::var("VICTORY_TEXTURE_BUDGET_MB").ok()?;
         mb.trim().parse::<u64>().ok().map(|mb| mb << 20)
     });
-    let filled = KINDS[1].load(Relaxed);
+    texture_room(KINDS[1].load(Relaxed), limit, || {
+        crate::host::host().and_then(|h| h.video_memory())
+    })
+}
+
+#[cfg(any(windows, test))]
+fn texture_room(filled: u64, limit: Option<u64>, memory: impl FnOnce() -> Option<[u64; 4]>) -> bool {
+    const FLOOR: u64 = 2 << 30;
+    const WITHOUT_BUDGET: u64 = 4 << 30;
+    let below_budget = |[budget, used, ..]: [u64; 4]| used < budget / 10 * 9;
     if let Some(limit) = limit {
-        return filled < limit;
+        return filled < limit && memory().is_none_or(below_budget);
     }
     if filled < FLOOR {
         return true;
     }
-    match crate::host::host().and_then(|h| h.video_memory()) {
-        Some([budget, used, ..]) => used < budget / 10 * 9,
-        None => filled < WITHOUT_BUDGET,
-    }
+    memory().map_or(filled < WITHOUT_BUDGET, below_budget)
 }
 
 /// Lets go of the host copies of textures the title fills that nothing
@@ -2239,6 +2242,25 @@
 
 #[cfg(test)]
 mod tests {
+    #[test]
+    fn manual_texture_limit_respects_other_video_memory_use() {
+        const MIB: u64 = 1 << 20;
+        let limit = Some(6144 * MIB);
+        let below_limit = 4096 * MIB;
+        let budget = 8192 * MIB;
+
+        assert!(super::texture_room(below_limit, limit, || None));
+        assert!(super::texture_room(below_limit, limit, || {
+            Some([budget, 7000 * MIB, 0, 0])
+        }));
+        assert!(!super::texture_room(below_limit, limit, || {
+            Some([budget, 7800 * MIB, 0, 0])
+        }));
+        assert!(!super::texture_room(6144 * MIB, limit, || {
+            panic!("no budget query needed once the texture limit is reached")
+        }));
+    }
+
     use super::*;
     use crate::object::slot;
 

AI assisted with the code, regression test, and report. No title data was used.

**@⁠Kcaiooooo** on GitHub · 2026-11-25 00:45 UTC · [original](https://github.com/fxceless/victory-fork/issues/415#issuecomment-7148839380) I traced the texture-budget part of this report on current main (`a803c87`). In `resource::room()`, setting `VICTORY_TEXTURE_BUDGET_MB` makes the check return based solely on the bytes held by these texture copies. The process's total local video-memory usage reported by DXGI is then ignored. A `6144` MiB texture cap can therefore still admit new copies when the process is already near its DXGI budget because of other allocations. The candidate below keeps the manual cap and also uses main's existing 90% DXGI budget threshold when the adapter reports a budget. It preserves the default path and keeps using the manual cap if budget telemetry is unavailable. This is a guard on admitting new copies; the device-removal cause and the suspected in-flight resource lifetime issue remain open. I tested the decision in isolation with an 8 GiB budget. At 4 GiB of texture copies and 7,800 MiB of total usage, the original rule admitted another copy and the candidate declined. The regression test passed with the patch, and `cargo check --locked --target x86_64-pc-windows-msvc -p victory-gpu --tests --features blake3/pure` passed from Linux. I haven't run this on an RX 5700 XT or in the title. If you're able to retest, could you compare this patch against the same revision with `VICTORY_TEXTURE_BUDGET_MB=6144` and share whether device removal still occurs, or whether the texture queue instead reports that the card has no room? Keeping the other flags and cache conditions fixed would help distinguish the two outcomes. <details> <summary>Patch against a803c87</summary> ```diff diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -1357,31 +1357,34 @@ /// Whether more host copies of textures the title fills may be made for /// shaders that pick textures by index (`draw.rs` `heap_textures`): always /// up to `FLOOR` bytes of them, beyond that while the card's memory in use -/// by this process is under nine tenths of the budget the system gives it -/// (`VICTORY_TEXTURE_BUDGET_MB` sets a limit on those copies' bytes -/// instead). Past the budget the system moves the card's memory into the -/// PC's, which ended runs 20 and 24. +/// by this process is under nine tenths of the budget the system gives it. +/// `VICTORY_TEXTURE_BUDGET_MB` replaces the default texture allowance and +/// still respects the system's budget when available. #[cfg(windows)] pub(crate) fn room() -> bool { use std::sync::atomic::Ordering::Relaxed; - const FLOOR: u64 = 2 << 30; - const WITHOUT_BUDGET: u64 = 4 << 30; static LIMIT: std::sync::OnceLock<Option<u64>> = std::sync::OnceLock::new(); let limit = *LIMIT.get_or_init(|| { let mb = std::env::var("VICTORY_TEXTURE_BUDGET_MB").ok()?; mb.trim().parse::<u64>().ok().map(|mb| mb << 20) }); - let filled = KINDS[1].load(Relaxed); + texture_room(KINDS[1].load(Relaxed), limit, || { + crate::host::host().and_then(|h| h.video_memory()) + }) +} + +#[cfg(any(windows, test))] +fn texture_room(filled: u64, limit: Option<u64>, memory: impl FnOnce() -> Option<[u64; 4]>) -> bool { + const FLOOR: u64 = 2 << 30; + const WITHOUT_BUDGET: u64 = 4 << 30; + let below_budget = |[budget, used, ..]: [u64; 4]| used < budget / 10 * 9; if let Some(limit) = limit { - return filled < limit; + return filled < limit && memory().is_none_or(below_budget); } if filled < FLOOR { return true; } - match crate::host::host().and_then(|h| h.video_memory()) { - Some([budget, used, ..]) => used < budget / 10 * 9, - None => filled < WITHOUT_BUDGET, - } + memory().map_or(filled < WITHOUT_BUDGET, below_budget) } /// Lets go of the host copies of textures the title fills that nothing @@ -2239,6 +2242,25 @@ #[cfg(test)] mod tests { + #[test] + fn manual_texture_limit_respects_other_video_memory_use() { + const MIB: u64 = 1 << 20; + let limit = Some(6144 * MIB); + let below_limit = 4096 * MIB; + let budget = 8192 * MIB; + + assert!(super::texture_room(below_limit, limit, || None)); + assert!(super::texture_room(below_limit, limit, || { + Some([budget, 7000 * MIB, 0, 0]) + })); + assert!(!super::texture_room(below_limit, limit, || { + Some([budget, 7800 * MIB, 0, 0]) + })); + assert!(!super::texture_room(6144 * MIB, limit, || { + panic!("no budget query needed once the texture limit is reached") + })); + } + use super::*; use crate::object::slot; ``` </details> AI assisted with the code, regression test, and report. No title data was used.
Author
Owner

@⁠2150272538-jpg on GitHub · 2026-11-25 01:17 UTC · original

Tested this on the exact configuration you asked for.

Setup. RX 5700 XT 8 GB (RDNA1 — no mesh shaders, so the world itself doesn't draw, but this failure reproduces during the prologue/loading phase), 1280×720, identical flags in every run: VICTORY_LATE_WAIT=3, VICTORY_WIDE_BACK=1, VICTORY_CARD_BUFFERS_MIN_MB=1, VICTORY_CARD_BUFFERS_MB=1024, VICTORY_TEXTURE_BUDGET_MB=6144, with the shader cache warm and shared between runs.

I applied your diff to 2119b0e (the room() body matched verbatim, so the patch applied as-is apart from line numbers) and rebuilt release with the same Agility 1.606.3 setup. Your regression test passes here on Windows/MSVC: cargo test -p victory-gpu --lib manual_texture_limit → resource::tests::manual_texture_limit_respects_other_video_memory_use ... ok.

Four runs, alternating between the two builds on the same machine:

run build exited after the card has no room for more no shared buffer (0x8007000E) device removed
A1 2119b0e 161 s – (string absent) 659 0
A2 2119b0e 170 s – 2 0
B1 + patch 206 s 1 8 0
B2 + patch 396 s 1 41,886 0

What I see:

  1. The guard fires exactly once per patched run and then holds — no further texture copies are admitted afterwards. It never fires in the baseline (the string doesn't exist there), which is the expected contrast.
  2. Time to death roughly doubles (161/170 s → 206/396 s). But it still dies, and B2 only got that far by limping: 41,886 no shared buffer ... size=8388608 warnings while still presenting frames. So once the texture-copy path is gated, the binding allocation moves to the 8 MiB shared-buffer pool, which room() doesn't cover.
  3. Device removal did not reproduce in any of these four runs. Earlier, on plain 2119b0e with these same settings, I got host GPU device removed after 16 submissions sent ahead (VICTORY_LATE_WAIT=1) of 128 lists; no breadcrumbs (0x887A0004) ... (0x887A0007) at 220 s. So that mode is not deterministic run to run, which is consistent with your "in-flight resource lifetime" hypothesis staying open — an admission guard wouldn't address it either way.
  4. All four exits end in a host command list did not close (0x8007000E): a command recorded into it was invalid.

One question: the card has no room for more; they wait is logged once!, so the log can't tell you how many frames ran starved — I only know from the no shared buffer flood that followed. Worth adding a counter or a periodic summary line?

I can put the four logs (10–20 MB each) and this machine's crashes.log/dumps in a gist if useful, and I'm happy to test a follow-up that applies the same budget check to the shared-buffer pool, or that queues/retries those allocations instead of dropping them.

**@⁠2150272538-jpg** on GitHub · 2026-11-25 01:17 UTC · [original](https://github.com/fxceless/victory-fork/issues/415#issuecomment-7149399567) Tested this on the exact configuration you asked for. **Setup.** RX 5700 XT 8 GB (RDNA1 — no mesh shaders, so the world itself doesn't draw, but this failure reproduces during the prologue/loading phase), 1280×720, identical flags in every run: `VICTORY_LATE_WAIT=3`, `VICTORY_WIDE_BACK=1`, `VICTORY_CARD_BUFFERS_MIN_MB=1`, `VICTORY_CARD_BUFFERS_MB=1024`, `VICTORY_TEXTURE_BUDGET_MB=6144`, with the shader cache warm and shared between runs. I applied your diff to `2119b0e` (the `room()` body matched verbatim, so the patch applied as-is apart from line numbers) and rebuilt release with the same Agility 1.606.3 setup. Your regression test passes here on Windows/MSVC: `cargo test -p victory-gpu --lib manual_texture_limit` → `resource::tests::manual_texture_limit_respects_other_video_memory_use ... ok`. **Four runs, alternating between the two builds on the same machine:** | run | build | exited after | `the card has no room for more` | `no shared buffer (0x8007000E)` | `device removed` | |---|---|---|---|---|---| | A1 | `2119b0e` | 161 s | – (string absent) | 659 | 0 | | A2 | `2119b0e` | 170 s | – | 2 | 0 | | B1 | + patch | 206 s | **1** | 8 | 0 | | B2 | + patch | **396 s** | **1** | **41,886** | 0 | **What I see:** 1. The guard fires exactly once per patched run and then holds — no further texture copies are admitted afterwards. It never fires in the baseline (the string doesn't exist there), which is the expected contrast. 2. Time to death roughly doubles (161/170 s → 206/396 s). But it still dies, and B2 only got that far by limping: 41,886 `no shared buffer ... size=8388608` warnings while still presenting frames. So once the texture-copy path is gated, the binding allocation moves to the 8 MiB shared-buffer pool, which `room()` doesn't cover. 3. **Device removal did not reproduce in any of these four runs.** Earlier, on plain `2119b0e` with these same settings, I got `host GPU device removed after 16 submissions sent ahead (VICTORY_LATE_WAIT=1) of 128 lists; no breadcrumbs (0x887A0004) ... (0x887A0007)` at 220 s. So that mode is not deterministic run to run, which is consistent with your "in-flight resource lifetime" hypothesis staying open — an admission guard wouldn't address it either way. 4. All four exits end in `a host command list did not close (0x8007000E): a command recorded into it was invalid`. **One question:** `the card has no room for more; they wait` is logged `once!`, so the log can't tell you how many frames ran starved — I only know from the `no shared buffer` flood that followed. Worth adding a counter or a periodic summary line? I can put the four logs (10–20 MB each) and this machine's `crashes.log`/dumps in a gist if useful, and I'm happy to test a follow-up that applies the same budget check to the shared-buffer pool, or that queues/retries those allocations instead of dropping them.
This discussion has been locked. Commenting is limited to contributors.
No description provided.