GPU: a pipeline library save with no memory for its buffer waits, not aborts (port of upstream #2007) #1323

Closed
CwWwWwW wants to merge 1 commit from upstream-pr/1326 into main
CwWwWwW commented 2026-11-26 15:30:44 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-26T15:30:44Z.


Problem

When the pipeline library's file cannot be mapped - the file system refuses the mapping, or VICTORY_LIBRARY_MAP=0 - library::serialise falls back to an infallible vec![0u8; size]. The serialised library is about 1.7 GB on NVIDIA (each pipeline's machine code), and an allocation of that size the host cannot give aborts the whole process mid-run: upstream saw memory allocation of 2650101862 bytes failed on an RTX 4050 Laptop.

Upstream VIctory fixed this in commit 321a4bc (pull request #2007, by Kevin); this is that fix ported to the fork, which keeps the mapped path and the fallback the upstream change targets.

Change

  • A new zeroed(n) -> Option<Vec<u8>> allocates with try_reserve_exact; no memory returns None and serialise returns an error instead of aborting.
  • save logs it and leaves the save for a later one (the pipelines stay counted as added, so a later save retries); the run continues.
  • The mapped path is untouched.

Tests

  • New a_save_buffer_the_host_cannot_give_is_refused: a size the host cannot give is None, 100 bytes are zeros.
  • cargo test -p victory-gpu --lib --locked: 218 passed, 0 failed, 6 ignored.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.
  • No game or GPU needed for the test. The 1.7 GB allocation itself cannot be reproduced here (it depends on the host's memory); the path is a pure allocation helper.

(CI note: the check job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)

<!-- greyfinch-sync:fxceless/victory-fork:issue:6629955058 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1326). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-26T15:30:44Z. --- ## Problem When the pipeline library's file cannot be mapped - the file system refuses the mapping, or `VICTORY_LIBRARY_MAP=0` - `library::serialise` falls back to an infallible `vec![0u8; size]`. The serialised library is about 1.7 GB on NVIDIA (each pipeline's machine code), and an allocation of that size the host cannot give **aborts the whole process** mid-run: upstream saw `memory allocation of 2650101862 bytes failed` on an RTX 4050 Laptop. Upstream VIctory fixed this in [commit 321a4bc](https://github.com/Marvisak/VIctory/commit/321a4bc) (pull request #2007, by **Kevin**); this is that fix ported to the fork, which keeps the mapped path and the fallback the upstream change targets. ## Change - A new `zeroed(n) -> Option<Vec<u8>>` allocates with `try_reserve_exact`; no memory returns `None` and `serialise` returns an error instead of aborting. - `save` logs it and leaves the save for a later one (the pipelines stay counted as added, so a later save retries); the run continues. - The mapped path is untouched. ## Tests - New `a_save_buffer_the_host_cannot_give_is_refused`: a size the host cannot give is `None`, 100 bytes are zeros. - `cargo test -p victory-gpu --lib --locked`: **218 passed, 0 failed, 6 ignored**. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: clean. - No game or GPU needed for the test. The 1.7 GB allocation itself cannot be reproduced here (it depends on the host's memory); the path is a pure allocation helper. (CI note: the `check` job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)
upstream-sync closed this pull request 2026-11-26 16:06:34 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1323
No description provided.