Uploads: reserve the ray tracing's address space at start (port of VIctory-NVIDIA; fixes Failed to allocate upload buffer) #189
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!189
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-189"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@SleepyYui on GitHub · 2026-11-30 20:33 UTC · original
SleepyYui:fix/reserve-upload-space→main· +361 −43 · 6 files · 47 commits · closed without mergingWhat goes wrong
On an RTX 4090 PC (77.7 GB RAM, 157.7 GB commit limit, so not a page file limit), foxhound v0.8.2 ended twice as the world loaded:
The title's ray tracing (XboxBvhBuilder) asks for upload memory below 2^37. With the rest of the process allocating first, that window is already full by the first ray-traced frame. This looks like the crash in issue #9. The first of the two runs had no mods or host DLLs loaded.
VIctory-NVIDIA documented the same crash on RTX 4090/5080/5090 PCs and fixed it on 2026-11-27 by reserving that address space first thing. VIctory-NVIDIA never hit this crash on the same PC.
The change (a port of VIctory-NVIDIA's fix)
foxhound's
crates/victory-gpu/src/upload.rswas VIctory-NVIDIA's version from before the fix, line for line, so this brings it up to date and adds the few call sites:upload.rs: taken from VIctory-NVIDIA as it is now. Original commits by Yorivel and contributors:30b979eeande69e39c5: a pool of address space reserved in [4 GiB, 2^37) at start, plus early pieces reserved when the host device is ready.0dd6ed89: allocation failures keep their reservations.0925efdf: ray-tracing scans stay inside their allocation.be846d2a: the pool stays below the page directory's last entry.memory.rs(30b979ee): after an arena that could not be made, no other is tried before the next frame, and its reservation is given back. Without this, a full address range made every builder dispatch search again under the lock.host.rs:upload::reserve_early()once the host device is ready.main.rs:victory_hle::reserve_upload_space()before anything else, re-exported throughvictory-gpuandvictory-hle.VICTORY_UPLOAD_SPACE=0turns the pool off, as in VIctory-NVIDIA.Testing
cargo test --release -p victory-gpu --lib -- upload:: memory::: 11 passed, includingthe_pool_is_reserved_in_the_window_and_handed_out_onceanda_failed_commit_can_retry_the_same_reservation.cargo clippy --locked --no-deps -p victory-gpu -p victory-hle -p victory --all-targets -- -D warnings: clean.cargo xtask policy: 289 files ok.cargo build --release --locked -p victorybuilds.@readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original
A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection.
Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.
Pull request closed