Repository navigation
Description
Name and Version
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 3060, compute capability 8.6, VMM: yes
version: 7437 (ec98e20)
built with GNU 13.3.0 for Linux x86_64
Operating systems
Linux
GGML backends
CUDA
Hardware
RTX 3060 (12GB)
Models
Anything that exceeds your vram and has a vision stack (I have been testing with gemma3-27B. The new GLM-4.6V also works if you need something that will still overflow vram on a more expensive GPU.)
Problem description & steps to reproduce
./build/bin/llama-server -m models/custom/gemma3/gemma-3-27B-it-qat/gemma-3-27b-it-q4_0.gguf --mmproj models/custom/gemma3/gemma-3-27B-it-qat/mmproj-model-f16-27B.gguf
The new fit algorithm fills up my vram nicely with as many layers as possible, and as much context as possible. Hitting the server with text-only requests processes fine, and about as efficiently as I have been able to tune myself manually.
However, hitting the server with an image causes a CUDA OOM crash. I assume the vision stack is loaded lazily, and cannot overflow to system ram; because the fit algorithm has otherwise filled vram already, it crashes trying to allocate memory for the vision stack.
(Also, the new llama-fit-params command doesn't even accept --mmproj so I assume it's just not including that in the calculation at all.)
First Bad Commit
No response
Relevant log output
srv process_chun: processing image...
encoding image slice...
/home/eapache/src/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu:94: CUDA error
CUDA error: out of memory
current device: 0, in function alloc at /home/eapache/src/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu:471
cuMemCreate(&handle, reserve_size, &prop, 0)
...
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007a9ae3710813 in __GI___wait4 (pid=20921, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
warning: 30 ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory
#0 0x00007a9ae3710813 in __GI___wait4 (pid=20921, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
30 in ../sysdeps/unix/sysv/linux/wait4.c
#1 0x00007a9ae40d96b3 in ggml_print_backtrace () from /home/eapache/src/llama.cpp/build/bin/libggml-base.so.0
#2 0x00007a9ae40d985b in ggml_abort () from /home/eapache/src/llama.cpp/build/bin/libggml-base.so.0
#3 0x00007a9adbf2ce27 in ggml_cuda_error(char const*, char const*, char const*, int, char const*) () from /home/eapache/src/llama.cpp/build/bin/libggml-cuda.so.0
#4 0x00007a9adbf448ce in ggml_cuda_pool_vmm::alloc(unsigned long, unsigned long*) () from /home/eapache/src/llama.cpp/build/bin/libggml-cuda.so.0
#5 0x00007a9adbf33160 in ggml_cuda_op_mul_mat_cublas(ggml_backend_cuda_context&, ggml_tensor const*, ggml_tensor const*, ggml_tensor*, char const*, float const*, char const*, float*, long, long, long, long, CUstream_st*) () from /home/eapache/src/llama.cpp/build/bin/libggml-cuda.so.0
#6 0x00007a9adbf39c54 in ggml_cuda_op_mul_mat(ggml_backend_cuda_context&, ggml_tensor const*, ggml_tensor const*, ggml_tensor*, void (*)(ggml_backend_cuda_context&, ggml_tensor const*, ggml_tensor const*, ggml_tensor*, char const*, float const*, char const*, float*, long, long, long, long, CUstream_st*), void (*)(float const*, int const*, void*, ggml_type, long, long, long, long, long, long, long, long, CUstream_st*)) () from /home/eapache/src/llama.cpp/build/bin/libggml-cuda.so.0
#7 0x00007a9adbf3ce0b in ggml_cuda_compute_forward(ggml_backend_cuda_context&, ggml_tensor*) () from /home/eapache/src/llama.cpp/build/bin/libggml-cuda.so.0
#8 0x00007a9adbf40803 in evaluate_and_capture_cuda_graph(ggml_backend_cuda_context*, ggml_cgraph*, bool&, bool&, bool&) [clone .constprop.0] () from /home/eapache/src/llama.cpp/build/bin/libggml-cuda.so.0
#9 0x00007a9adbf42770 in ggml_backend_cuda_graph_compute(ggml_backend*, ggml_cgraph*) () from /home/eapache/src/llama.cpp/build/bin/libggml-cuda.so.0
#10 0x00007a9ae40f59a7 in ggml_backend_sched_graph_compute_async () from /home/eapache/src/llama.cpp/build/bin/libggml-base.so.0
#11 0x00007a9ae40f5c82 in ggml_backend_sched_graph_compute () from /home/eapache/src/llama.cpp/build/bin/libggml-base.so.0
#12 0x00007a9ae4208310 in clip_image_batch_encode(clip_ctx*, int, clip_image_f32_batch const*, float*) () from /home/eapache/src/llama.cpp/build/bin/libmtmd.so.0
#13 0x00007a9ae41958a3 in mtmd_encode () from /home/eapache/src/llama.cpp/build/bin/libmtmd.so.0
#14 0x00007a9ae4202489 in mtmd_helper_eval_chunk_single () from /home/eapache/src/llama.cpp/build/bin/libmtmd.so.0
#15 0x00005dbd58a6ee43 in server_tokens::process_chunk(llama_context*, mtmd_context*, unsigned long, int, int, unsigned long&) const ()
#16 0x00005dbd58ab8f34 in server_context_impl::update_slots() ()
#17 0x00005dbd58a5e9e8 in server_queue::start_loop() ()
#18 0x00005dbd589e7dbf in main ()
Activity
eapache commentedon Dec 16, 2025
cc @JohannesGaessler
SlavikCA commentedon Dec 18, 2025
I'm getting same issue.
System with 2 GPUs:
Build:
build: 7444 (5806286) with GNU 11.4.0 for Linux x86_64
Using this config:
When I start it:
But on the first request with image it crashed:
SlavikCA commentedon Dec 26, 2025
duplicate to #18181 ?
eapache commentedon Dec 26, 2025
Yes, duplicate, although this one was filed first that one clearly has received more attention.