diff options
| author | enlight3d <19186686+enlight3d@users.noreply.github.com> | 2026-12-02 13:25:12 +0100 |
|---|---|---|
| committer | enlight3d <19186686+enlight3d@users.noreply.github.com> | 2026-12-02 14:14:22 +0100 |
| commit | 854fc3441c70fcafc108d900e21fed8ffeebed66 (patch) | |
| tree | c4798057b808a6f2e929bb8b0cb9567488bffc7d /runtime/xma_decoder/tests/ffi_cpp_smoke.cpp | |
| parent | bf788674692831df253049621448e76b9ceb613a (diff) | |
d3d12: hold the title's address range below 2^37 (LEONIDA_TITLE_RANGE)
Translated shaders reach title memory by address only through the 64 KiB
page directory below 2^37 (MEMORY_PAGES), so the title's memory and the
lists' upload arenas must lie in [4 GiB, 2^37 - 64 KiB). Nothing kept that
range for them: a library in the process that reserves address space early
can take it. CUDA's cuInit, called by a third-party frame generation
unlocker on RTX 30 cards, reserves 68 GiB and 28 GiB from 8 GiB; the upload
arenas then fell from 29 to 8, allocate_upload returned null without a log
line and the title stopped while the world loaded.
- leonida-gpu/title_range.rs (new): at the start of `run`, every free place
of [4 GiB, 2^37 - 64 KiB) is reserved with no access, in plain
reservations of at most 1 GiB (no placeholders: write-watched memory made
in one cannot be turned back into a placeholder). A request takes the
lowest place held that fits (the highest with MEM_TOP_DOWN): the pieces
under it are released, the request is made inside them at once and the
rest is reserved again. If another thread takes the place in between, the
next place is tried (4 times at most). What the title frees in the range
is held again. A warning when much of the range was taken before it was
held.
- xmem: XMemVirtualAlloc reservations of an address of our choice whose
bounds take in the range, or at an address the range holds, are made
there. The title's own VirtualAlloc (now ours, the host's otherwise)
makes a reservation at an address the range holds there, and its
VirtualFree gives freed places back. A request not placed in the range
(no room, taken by other threads, refused) is said in the log and made
of the host as before, except one refused at its own address, which
fails with its own error.
- upload: the arenas come from the range, and stop before the directory's
empty last page (they could take it before). When no arena can be had, an
upload comes from the process heap with one log line instead of null.
- LEONIDA_TITLE_RANGE=0: nothing is held and every request goes to the host
as before; the arenas' end and their heap fallback stay. docs/switches.md
regenerated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/xma_decoder/tests/ffi_cpp_smoke.cpp')
0 files changed, 0 insertions, 0 deletions