mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #147] Windows: CUDA page-locking caps the RAM tier at ~90 GB per process - RAM-resident mode cannot start (32 GB card, 192 GB RAM, 128K ctx) #50
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @gmanzienko on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/147
Windows: the CUDA page-locking cap (~90 GB/process) starves the RAM tier; RAM-resident mode cannot start on a 32 GB card with 192 GB RAM
v1.1.3, Windows 11, one RTX 5090 32 GB (sm_120, CUDA toolkit 12.8, driver 617.14), Ryzen 9 9950X3D, 192 GB RAM, page file fixed 40 GB (per #20 - thank you, that warning was spot on), Maya-L, 131072 context, DFlash2 drafter.
What happens
The engine pins only 84-91 GB of RAM tier no matter how much is free (155-170 GB), while Maya-L at 128K needs about 125 GB off-VRAM. The rest of the experts are served from the SSD (10-16 disk reads/token):
RAM-resident mode then fails at startup:
This happens with STRATA_GLM_RAM_GB=130, with STRATA_GLM_NUMA=0, with 165 GB free RAM and 201 GB of free commit, and also when the whole process tree is launched outside my shell (via WMI), so it is not an environment or job artifact.
Diagnostics: where the cap actually is
A 9950X3D is a single socket; Windows reports one NUMA node. "2 seen" looks like processor groups being mistaken for NUMA nodes, and if the tier is then sized or placed against node 0 only, that alone would explain the 84-91 GB ceiling even before the driver cap.
An experiment that gets the tier pinned but then trips an IMA
As a working-tree experiment I added a third fallback in the glm_fast_path.cu tier loop: when numa_pinned and cudaHostAlloc both refuse, allocate with plain VirtualAlloc(MEM_RESERVE|MEM_COMMIT) and pin it with strata::platform::lock_resident (opt-out env STRATA_GLM_OS_LOCK=0). Result at startup:
Generation then stops after 2-3 tokens with:
which is the cudaStreamSynchronize(F->copy) check in lend_tail (glm_prefill.cu) - the background tier moves and lending copies evidently assume the tier base is driver page-locked (cudaHostAlloc or registered), and plain VirtualLock-ed memory breaks that assumption somewhere. So a real fix likely wants the lending and promotion DMA paths audited for unregistered-but-locked host memory (or an explicit partial-registration scheme), which is beyond a safe local patch - hence this report.
Current workaround
Auto-sized tier (84 GB) + STRATA_GLM_DISK_SKIP_W=0.12 keeps the 128K-context setup usable (decode ~3 tok/s here, cache still warming), and everything else (DFlash2, vision) runs fine.
Happy to test candidate fixes; the standalone VirtualLock and cudaHostRegister repro is a 20-line program I can share.
@gmanzienko commented on GitHub (Oct 12, 2026):
Follow-up: with the same VirtualAlloc + lock_resident fallback enabled as an experiment, an AUTO-sized tier (124.74 GB pinned, no RAM-resident flag) also trips the identical "glm lending copies: an illegal memory access" at the first prompt - so the lending/promotion copies on the copy stream require driver page-locked (cudaHostAlloc/registered) tier memory in every mode, not just RAM-resident. The fallback is therefore opt-in (STRATA_GLM_OS_LOCK=1) in my tree and disabled by default; the report above stands. Anything the maintainers want tested on this machine (driver page-locking caps, the node-0-of-2 NUMA detection, candidate copy-path fixes) - happy to run it.
@uvtzxpm commented on GitHub (Oct 13, 2026):
I think I'm also hitting this. Windows, an NVIDIA 3090 24 GB. I have "only" 64 GB RAM and no matter what I try, ~25 GB RAM is free while running this, with ~"21.4 GB pinned for experts". Testing with
github.com/mw00/project-maya@f4d13e1293.@mw00 commented on GitHub (Oct 13, 2026):
Thank you - an exceptionally clear diagnosis, and the standalone repro settles where the cap is.
What you found matches the engine:
cudaHostAllocandcudaHostRegister.STRATA_GLM_RAM_GBand the NUMA settings can't move it.the RAM tier sits on node 0 of 2 seendoesn't count NUMA nodes: "2 seen" is the number of RAM-tier blocks (one per expert size) whose node could be read, all on node 0. It doesn't size or place anything, so it isn't behind the ~90 GB. We'll reword it.Where this could go: RAM above the cap can still serve experts without the GPU reading it - through the CPU lane, which computes experts from RAM on the CPU, or copied through a small pinned buffer, the way disk reads land today. That's a real change to the tiers, so it's on our list rather than a quick patch, and we'd like your machine to test it when there's a build. Until then, the auto-sized tier with
STRATA_GLM_DISK_SKIP_Wis the best setup on that PC, as you found.@uvtzxpm: with 64 GB of RAM you're more likely hitting a different limit. Windows charges pinned memory to the commit limit (RAM + page file), and the engine sizes the tier from what's left of it. If your engine log has a line starting
glm fast: WARNING - Windows' commit limit, enlarging the page file by what it says should let the tier grow (see #20). If not, please post the log'sglm fast:lines and we'll look.@mw00 commented on GitHub (Oct 13, 2026):
A small part of this is in v1.1.7: the "node 0 of 2 seen" line is gone on single-socket PCs, and where Windows refuses a size the tier is now sized to what still pins instead of stepping down. Using the RAM above the ~90 GB cap is still on our list.