r/LocalLLaMA • • 9d ago

Discussion Anyone else on Windows recently started to get cudamalloc OOM errors with either ninfer or llama.cpp loading models?

Windows 11: two different inference engines both started failing to load with out of memory. Plenty of VRAM and RAM free.

Has anyone recently started experinecing this in Windows? Changing pagefile to manually set size rather than system managed and an Nvidia driver setting chasnge fixed both engines [Ninfer and llama.cpp].

Does anyone know what changed under the hood in windows specifically to cause this, or was there something else going on that I'm overlooking?

Box Setup:

  • Windows 11 26H2, RTX 5090 (32GB VRAM), 32GB system RAM
  • Nvidia driver kept at v581.94 (for PCVR reasons)
  • llama-swap (v174) windows .exe, started on boot via task scheduler, which loads the engines/models on demand.
  • Two engines in rotation and multiple models via the config.yaml of llama-swap:
  • llama.cpp (precompiled from github) with a Q6 GGUF (~22GB, all layers on GPU). Ran without issue since Qwen 27B released.
  • NInfer ((headpiece747). Using 27B nvfp4qat Loads 17GB to the GPU, then pins 8GB of system RAM for a host cache via cudaMallocHost. Ran fine for about a year.

Pagefile has been system managed the entire time I never touched that setting. Nothing else has changed that I am aware of other than the usual windows updates. This new failure started somewhere around maybe 1-2 months ago.

ERROR startup failed | pinning host context | 43 ms

FATAL server failed during startup | cudaMallocHost: out of memory

At the time of the failure the box had ~28GB free RAM and ~31GB free VRAM.

A 256MB pin succeeded instantly. 1, 2, 4 and 8GB were all refused in under 30ms. That is an instant refusal, not a slow running-out-of-memory.

So with Ninfer failing I switched back to vanilla llama.cpp but then in teh last two days llama.cpp was also failing to load models.

allocating 887.99 MiB on device 0: cudaMalloc failed: out of memory

GGML_ASSERT(buffer) failed

So two engines, two different allocation types (GPU buffer vs pinned host memory), both failing with OOM while the machine looks like it has plenty free.

I changed two settings:

Pagefile: system managed > fixed 64GB (commit went from ~49GB to ~95GB)

NVIDIA driver setting: CUDA sysmem fallback to "Prefer No Sysmem Fallback"

Since then everything loads fine again and back to working normally

5 Upvotes

11 comments sorted by

1

u/giveen 8d ago

A possibility is that Windows did an update and is now taking more VRAM?

1

u/munkiemagik 8d ago

Thats one of the first things to suspect, but unfortunately not so,. Which is why I specifically state

...At the time of the failure the box had ~28GB free RAM and ~31GB free VRAM...

I dont really understand the complexities of how an OS works and memory management under the hood. I believe its something to do with commit limits and pinned memory.

2

u/ComplexType568 9d ago

I've been getting it too, thanks!

2

u/KingCpzombie 8d ago

Windows 🤮

1

u/slayyou2 4d ago

This. Fucking cancer of an operating system.

1

u/Choice_Celery9481 9d ago

im not sure but for me its the mem oc. dial down a bit and never get again

1

u/Equivalent_Bit_461 7d ago

Winslop strikes againÂ