[GH-ISSUE #11388] Unable to allocate CUDA0 buffer when num_gpu > 1 #33277

Closed
opened 2026-04-22 15:48:04 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Ji-Peng on GitHub (Jul 12, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11388

What is the issue?

Ollama version: 0.9.6
GPU: NVIDIA GeForce RTX 4070 SUPER 12GiB
CUDA version (by nvcc --version): Cuda compilation tools, release 12.6, V12.6.85
OS: Windows 11 24H2 26100.4652

Environment variables:
OLLAMA_GPU_LAYER: cuda
OLLAMA_GPU_OVERHEAD: 536870912
OLLAMA_NUM_PARALLEL: 1

Modelfile:

FROM qwen2.5-coder:7b
PARAMETER num_ctx 1024
PARAMETER num_batch 1
PARAMETER num_gpu 2

Note: My attempts found that when num_gpu is set to a value > 1, an error will be reported: "Error: llama runner process has terminated: error loading model: unable to allocate CUDA0 buffer". When num_gpu=1, it can run, but the CPU/GPU ratio is about 60%/40%. I want the GPU ratio to be higher.
The memory part in the log: library=cuda layers.requested=2 layers.model=29 layers.offload=2 layers.split="" memory.available="[9.3 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="5.2 GiB" memory.required.partial="1.3 GiB" memory.required.kv="112.0 MiB" memory.required.allocations="[1.3 GiB]" memory.weights.total="4.1 GiB" memory.weights.repeating="3.7 GiB" memory.weights.nonrepeating="426.4 MiB" memory.graph.full="608.0 KiB" memory.graph.partial="427.0 MiB"

Among them: memory.available="[9.3 GiB]" is obviously larger than memory.required.full="5.2 GiB", but why is it wrong?

Relevant log output

Full log:

time=2025-07-12T10:02:51.868+08:00 level=INFO source=routes.go:1235 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:4096 OLLAMA_DEBUG:INFO OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:536870912 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:D:\\Ollama\\LLMInstall OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]"
time=2025-07-12T10:02:51.879+08:00 level=INFO source=images.go:476 msg="total blobs: 23"
time=2025-07-12T10:02:51.881+08:00 level=INFO source=images.go:483 msg="total unused blobs removed: 0"
time=2025-07-12T10:02:51.882+08:00 level=INFO source=routes.go:1288 msg="Listening on 127.0.0.1:11434 (version 0.9.6)"
time=2025-07-12T10:02:51.882+08:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs"
time=2025-07-12T10:02:51.882+08:00 level=INFO source=gpu_windows.go:167 msg=packages count=1
time=2025-07-12T10:02:51.882+08:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=8 efficiency=0 threads=14
time=2025-07-12T10:02:52.064+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b library=cuda variant=v12 compute=8.9 driver=12.7 name="NVIDIA GeForce RTX 4070 SUPER" total="12.0 GiB" available="10.8 GiB"
[GIN] 2025/07/12 - 10:03:09 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2025/07/12 - 10:03:09 | 200 |     56.3713ms |       127.0.0.1 | POST     "/api/show"
time=2025-07-12T10:03:09.908+08:00 level=INFO source=sched.go:788 msg="new model will fit in available VRAM in single GPU, loading" model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b parallel=1 available=10004086784 required="1.3 GiB"
time=2025-07-12T10:03:09.934+08:00 level=INFO source=server.go:135 msg="system memory" total="31.8 GiB" free="16.8 GiB" free_swap="30.1 GiB"
time=2025-07-12T10:03:09.935+08:00 level=INFO source=server.go:175 msg=offload library=cuda layers.requested=2 layers.model=29 layers.offload=2 layers.split="" memory.available="[9.3 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="5.2 GiB" memory.required.partial="1.3 GiB" memory.required.kv="112.0 MiB" memory.required.allocations="[1.3 GiB]" memory.weights.total="4.1 GiB" memory.weights.repeating="3.7 GiB" memory.weights.nonrepeating="426.4 MiB" memory.graph.full="608.0 KiB" memory.graph.partial="427.0 MiB"
llama_model_loader: loaded meta data with 34 key-value pairs and 339 tensors from D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv   0:                       general.architecture str              = qwen2
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Qwen2.5 Coder 7B Instruct
llama_model_loader: - kv   3:                           general.finetune str              = Instruct
llama_model_loader: - kv   4:                           general.basename str              = Qwen2.5-Coder
llama_model_loader: - kv   5:                         general.size_label str              = 7B
llama_model_loader: - kv   6:                            general.license str              = apache-2.0
llama_model_loader: - kv   7:                       general.license.link str              = https://huggingface.co/Qwen/Qwen2.5-C...
llama_model_loader: - kv   8:                   general.base_model.count u32              = 1
llama_model_loader: - kv   9:                  general.base_model.0.name str              = Qwen2.5 Coder 7B
llama_model_loader: - kv  10:          general.base_model.0.organization str              = Qwen
llama_model_loader: - kv  11:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen2.5-C...
llama_model_loader: - kv  12:                               general.tags arr[str,6]       = ["code", "codeqwen", "chat", "qwen", ...
llama_model_loader: - kv  13:                          general.languages arr[str,1]       = ["en"]
llama_model_loader: - kv  14:                          qwen2.block_count u32              = 28
llama_model_loader: - kv  15:                       qwen2.context_length u32              = 32768
llama_model_loader: - kv  16:                     qwen2.embedding_length u32              = 3584
llama_model_loader: - kv  17:                  qwen2.feed_forward_length u32              = 18944
llama_model_loader: - kv  18:                 qwen2.attention.head_count u32              = 28
llama_model_loader: - kv  19:              qwen2.attention.head_count_kv u32              = 4
llama_model_loader: - kv  20:                       qwen2.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  21:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  22:                          general.file_type u32              = 15
llama_model_loader: - kv  23:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  24:                         tokenizer.ggml.pre str              = qwen2
llama_model_loader: - kv  25:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  26:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  27:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  28:                tokenizer.ggml.eos_token_id u32              = 151645
llama_model_loader: - kv  29:            tokenizer.ggml.padding_token_id u32              = 151643
llama_model_loader: - kv  30:                tokenizer.ggml.bos_token_id u32              = 151643
llama_model_loader: - kv  31:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  32:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
llama_model_loader: - kv  33:               general.quantization_version u32              = 2
llama_model_loader: - type  f32:  141 tensors
llama_model_loader: - type q4_K:  169 tensors
llama_model_loader: - type q6_K:   29 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q4_K - Medium
print_info: file size   = 4.36 GiB (4.91 BPW) 
load: special tokens cache size = 22
load: token to piece cache size = 0.9310 MB
print_info: arch             = qwen2
print_info: vocab_only       = 1
print_info: model type       = ?B
print_info: model params     = 7.62 B
print_info: general.name     = Qwen2.5 Coder 7B Instruct
print_info: vocab type       = BPE
print_info: n_vocab          = 152064
print_info: n_merges         = 151387
print_info: BOS token        = 151643 '<|endoftext|>'
print_info: EOS token        = 151645 '<|im_end|>'
print_info: EOT token        = 151645 '<|im_end|>'
print_info: PAD token        = 151643 '<|endoftext|>'
print_info: LF token         = 198 'Ċ'
print_info: FIM PRE token    = 151659 '<|fim_prefix|>'
print_info: FIM SUF token    = 151661 '<|fim_suffix|>'
print_info: FIM MID token    = 151660 '<|fim_middle|>'
print_info: FIM PAD token    = 151662 '<|fim_pad|>'
print_info: FIM REP token    = 151663 '<|repo_name|>'
print_info: FIM SEP token    = 151664 '<|file_sep|>'
print_info: EOG token        = 151643 '<|endoftext|>'
print_info: EOG token        = 151645 '<|im_end|>'
print_info: EOG token        = 151662 '<|fim_pad|>'
print_info: EOG token        = 151663 '<|repo_name|>'
print_info: EOG token        = 151664 '<|file_sep|>'
print_info: max token length = 256
llama_model_load: vocab only - skipping tensors
time=2025-07-12T10:03:10.336+08:00 level=INFO source=server.go:438 msg="starting llama server" cmd="D:\\Ollama\\OllamaInstall\\ollama.exe runner --model D:\\Ollama\\LLMInstall\\blobs\\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 --ctx-size 1024 --batch-size 1 --n-gpu-layers 2 --threads 8 --no-mmap --parallel 1 --port 53356"
time=2025-07-12T10:03:10.343+08:00 level=INFO source=sched.go:483 msg="loaded runners" count=1
time=2025-07-12T10:03:10.344+08:00 level=INFO source=server.go:598 msg="waiting for llama runner to start responding"
time=2025-07-12T10:03:10.345+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server error"
time=2025-07-12T10:03:10.394+08:00 level=INFO source=runner.go:815 msg="starting go runner"
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 4070 SUPER, compute capability 8.9, VMM: yes
load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\ggml-cuda.dll
load_backend: loaded CPU backend from D:\Ollama\OllamaInstall\lib\ollama\ggml-cpu-icelake.dll
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 4070 SUPER, compute capability 8.9, VMM: yes
load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\cuda_v12\ggml-cuda.dll
time=2025-07-12T10:03:10.516+08:00 level=INFO source=ggml.go:104 msg=system CPU.0.SSE3=1 CPU.0.SSSE3=1 CPU.0.AVX=1 CPU.0.AVX2=1 CPU.0.F16C=1 CPU.0.FMA=1 CPU.0.BMI2=1 CPU.0.AVX512=1 CPU.0.AVX512_VBMI=1 CPU.0.AVX512_VNNI=1 CPU.0.LLAMAFILE=1 CPU.1.LLAMAFILE=1 CUDA.0.ARCHS=500,600,610,700,750,800,860,870,890,900,1200 CUDA.0.USE_GRAPHS=1 CUDA.0.PEER_MAX_BATCH_SIZE=128 CUDA.1.ARCHS=500,600,610,700,750,800,860,870,890,900,1200 CUDA.1.USE_GRAPHS=1 CUDA.1.PEER_MAX_BATCH_SIZE=128 compiler=cgo(clang)
time=2025-07-12T10:03:10.518+08:00 level=INFO source=runner.go:874 msg="Server listening on 127.0.0.1:53356"
time=2025-07-12T10:03:10.598+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server loading model"
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4070 SUPER) - 11053 MiB free
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4070 SUPER) - 11053 MiB free
llama_model_loader: loaded meta data with 34 key-value pairs and 339 tensors from D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv   0:                       general.architecture str              = qwen2
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Qwen2.5 Coder 7B Instruct
llama_model_loader: - kv   3:                           general.finetune str              = Instruct
llama_model_loader: - kv   4:                           general.basename str              = Qwen2.5-Coder
llama_model_loader: - kv   5:                         general.size_label str              = 7B
llama_model_loader: - kv   6:                            general.license str              = apache-2.0
llama_model_loader: - kv   7:                       general.license.link str              = https://huggingface.co/Qwen/Qwen2.5-C...
llama_model_loader: - kv   8:                   general.base_model.count u32              = 1
llama_model_loader: - kv   9:                  general.base_model.0.name str              = Qwen2.5 Coder 7B
llama_model_loader: - kv  10:          general.base_model.0.organization str              = Qwen
llama_model_loader: - kv  11:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen2.5-C...
llama_model_loader: - kv  12:                               general.tags arr[str,6]       = ["code", "codeqwen", "chat", "qwen", ...
llama_model_loader: - kv  13:                          general.languages arr[str,1]       = ["en"]
llama_model_loader: - kv  14:                          qwen2.block_count u32              = 28
llama_model_loader: - kv  15:                       qwen2.context_length u32              = 32768
llama_model_loader: - kv  16:                     qwen2.embedding_length u32              = 3584
llama_model_loader: - kv  17:                  qwen2.feed_forward_length u32              = 18944
llama_model_loader: - kv  18:                 qwen2.attention.head_count u32              = 28
llama_model_loader: - kv  19:              qwen2.attention.head_count_kv u32              = 4
llama_model_loader: - kv  20:                       qwen2.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  21:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  22:                          general.file_type u32              = 15
llama_model_loader: - kv  23:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  24:                         tokenizer.ggml.pre str              = qwen2
llama_model_loader: - kv  25:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  26:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  27:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  28:                tokenizer.ggml.eos_token_id u32              = 151645
llama_model_loader: - kv  29:            tokenizer.ggml.padding_token_id u32              = 151643
llama_model_loader: - kv  30:                tokenizer.ggml.bos_token_id u32              = 151643
llama_model_loader: - kv  31:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  32:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
llama_model_loader: - kv  33:               general.quantization_version u32              = 2
llama_model_loader: - type  f32:  141 tensors
llama_model_loader: - type q4_K:  169 tensors
llama_model_loader: - type q6_K:   29 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q4_K - Medium
print_info: file size   = 4.36 GiB (4.91 BPW) 
load: special tokens cache size = 22
load: token to piece cache size = 0.9310 MB
print_info: arch             = qwen2
print_info: vocab_only       = 0
print_info: n_ctx_train      = 32768
print_info: n_embd           = 3584
print_info: n_layer          = 28
print_info: n_head           = 28
print_info: n_head_kv        = 4
print_info: n_rot            = 128
print_info: n_swa            = 0
print_info: n_swa_pattern    = 1
print_info: n_embd_head_k    = 128
print_info: n_embd_head_v    = 128
print_info: n_gqa            = 7
print_info: n_embd_k_gqa     = 512
print_info: n_embd_v_gqa     = 512
print_info: f_norm_eps       = 0.0e+00
print_info: f_norm_rms_eps   = 1.0e-06
print_info: f_clamp_kqv      = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale    = 0.0e+00
print_info: f_attn_scale     = 0.0e+00
print_info: n_ff             = 18944
print_info: n_expert         = 0
print_info: n_expert_used    = 0
print_info: causal attn      = 1
print_info: pooling type     = -1
print_info: rope type        = 2
print_info: rope scaling     = linear
print_info: freq_base_train  = 1000000.0
print_info: freq_scale_train = 1
print_info: n_ctx_orig_yarn  = 32768
print_info: rope_finetuned   = unknown
print_info: ssm_d_conv       = 0
print_info: ssm_d_inner      = 0
print_info: ssm_d_state      = 0
print_info: ssm_dt_rank      = 0
print_info: ssm_dt_b_c_rms   = 0
print_info: model type       = 7B
print_info: model params     = 7.62 B
print_info: general.name     = Qwen2.5 Coder 7B Instruct
print_info: vocab type       = BPE
print_info: n_vocab          = 152064
print_info: n_merges         = 151387
print_info: BOS token        = 151643 '<|endoftext|>'
print_info: EOS token        = 151645 '<|im_end|>'
print_info: EOT token        = 151645 '<|im_end|>'
print_info: PAD token        = 151643 '<|endoftext|>'
print_info: LF token         = 198 'Ċ'
print_info: FIM PRE token    = 151659 '<|fim_prefix|>'
print_info: FIM SUF token    = 151661 '<|fim_suffix|>'
print_info: FIM MID token    = 151660 '<|fim_middle|>'
print_info: FIM PAD token    = 151662 '<|fim_pad|>'
print_info: FIM REP token    = 151663 '<|repo_name|>'
print_info: FIM SEP token    = 151664 '<|file_sep|>'
print_info: EOG token        = 151643 '<|endoftext|>'
print_info: EOG token        = 151645 '<|im_end|>'
print_info: EOG token        = 151662 '<|fim_pad|>'
print_info: EOG token        = 151663 '<|repo_name|>'
print_info: EOG token        = 151664 '<|file_sep|>'
print_info: max token length = 256
load_tensors: loading model tensors, this can take a while... (mmap = false)
alloc_tensor_range: failed to initialize tensor blk.27.attn_q.weight
llama_model_load: error loading model: unable to allocate CUDA0 buffer
llama_model_load_from_file_impl: failed to load model
panic: unable to load model: D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463

goroutine 12 [running]:
github.com/ollama/ollama/runner/llamarunner.(*Server).loadModel(0xc00010c360, {0x2, 0x0, 0x0, {0x0, 0x0, 0x0}, 0xc000483da0, 0x0}, {0xc00003a1c0, ...}, ...)
	C:/a/ollama/ollama/runner/llamarunner/runner.go:751 +0x395
created by github.com/ollama/ollama/runner/llamarunner.Execute in goroutine 1
	C:/a/ollama/ollama/runner/llamarunner/runner.go:848 +0xb57
time=2025-07-12T10:03:10.869+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server error"
time=2025-07-12T10:03:10.893+08:00 level=ERROR source=server.go:464 msg="llama runner terminated" error="exit status 2"
time=2025-07-12T10:03:11.120+08:00 level=ERROR source=sched.go:489 msg="error loading llama server" error="llama runner process has terminated: error loading model: unable to allocate CUDA0 buffer"
[GIN] 2025/07/12 - 10:03:11 | 500 |    1.4203973s |       127.0.0.1 | POST     "/api/generate"

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.9.6

Originally created by @Ji-Peng on GitHub (Jul 12, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11388 ### What is the issue? Ollama version: 0.9.6 GPU: NVIDIA GeForce RTX 4070 SUPER 12GiB CUDA version (by nvcc --version): Cuda compilation tools, release 12.6, V12.6.85 OS: Windows 11 24H2 26100.4652 Environment variables: OLLAMA_GPU_LAYER: cuda OLLAMA_GPU_OVERHEAD: 536870912 OLLAMA_NUM_PARALLEL: 1 Modelfile: ``` FROM qwen2.5-coder:7b PARAMETER num_ctx 1024 PARAMETER num_batch 1 PARAMETER num_gpu 2 ``` Note: My attempts found that when num_gpu is set to a value > 1, an error will be reported: "Error: llama runner process has terminated: error loading model: unable to allocate CUDA0 buffer". When num_gpu=1, it can run, but the CPU/GPU ratio is about 60%/40%. I want the GPU ratio to be higher. The memory part in the log: `library=cuda layers.requested=2 layers.model=29 layers.offload=2 layers.split="" memory.available="[9.3 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="5.2 GiB" memory.required.partial="1.3 GiB" memory.required.kv="112.0 MiB" memory.required.allocations="[1.3 GiB]" memory.weights.total="4.1 GiB" memory.weights.repeating="3.7 GiB" memory.weights.nonrepeating="426.4 MiB" memory.graph.full="608.0 KiB" memory.graph.partial="427.0 MiB"` Among them: memory.available="[9.3 GiB]" is obviously larger than memory.required.full="5.2 GiB", but why is it wrong? ### Relevant log output ```shell Full log: time=2025-07-12T10:02:51.868+08:00 level=INFO source=routes.go:1235 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:4096 OLLAMA_DEBUG:INFO OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:536870912 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:D:\\Ollama\\LLMInstall OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]" time=2025-07-12T10:02:51.879+08:00 level=INFO source=images.go:476 msg="total blobs: 23" time=2025-07-12T10:02:51.881+08:00 level=INFO source=images.go:483 msg="total unused blobs removed: 0" time=2025-07-12T10:02:51.882+08:00 level=INFO source=routes.go:1288 msg="Listening on 127.0.0.1:11434 (version 0.9.6)" time=2025-07-12T10:02:51.882+08:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs" time=2025-07-12T10:02:51.882+08:00 level=INFO source=gpu_windows.go:167 msg=packages count=1 time=2025-07-12T10:02:51.882+08:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=8 efficiency=0 threads=14 time=2025-07-12T10:02:52.064+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b library=cuda variant=v12 compute=8.9 driver=12.7 name="NVIDIA GeForce RTX 4070 SUPER" total="12.0 GiB" available="10.8 GiB" [GIN] 2025/07/12 - 10:03:09 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2025/07/12 - 10:03:09 | 200 | 56.3713ms | 127.0.0.1 | POST "/api/show" time=2025-07-12T10:03:09.908+08:00 level=INFO source=sched.go:788 msg="new model will fit in available VRAM in single GPU, loading" model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b parallel=1 available=10004086784 required="1.3 GiB" time=2025-07-12T10:03:09.934+08:00 level=INFO source=server.go:135 msg="system memory" total="31.8 GiB" free="16.8 GiB" free_swap="30.1 GiB" time=2025-07-12T10:03:09.935+08:00 level=INFO source=server.go:175 msg=offload library=cuda layers.requested=2 layers.model=29 layers.offload=2 layers.split="" memory.available="[9.3 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="5.2 GiB" memory.required.partial="1.3 GiB" memory.required.kv="112.0 MiB" memory.required.allocations="[1.3 GiB]" memory.weights.total="4.1 GiB" memory.weights.repeating="3.7 GiB" memory.weights.nonrepeating="426.4 MiB" memory.graph.full="608.0 KiB" memory.graph.partial="427.0 MiB" llama_model_loader: loaded meta data with 34 key-value pairs and 339 tensors from D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 (version GGUF V3 (latest)) llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output. llama_model_loader: - kv 0: general.architecture str = qwen2 llama_model_loader: - kv 1: general.type str = model llama_model_loader: - kv 2: general.name str = Qwen2.5 Coder 7B Instruct llama_model_loader: - kv 3: general.finetune str = Instruct llama_model_loader: - kv 4: general.basename str = Qwen2.5-Coder llama_model_loader: - kv 5: general.size_label str = 7B llama_model_loader: - kv 6: general.license str = apache-2.0 llama_model_loader: - kv 7: general.license.link str = https://huggingface.co/Qwen/Qwen2.5-C... llama_model_loader: - kv 8: general.base_model.count u32 = 1 llama_model_loader: - kv 9: general.base_model.0.name str = Qwen2.5 Coder 7B llama_model_loader: - kv 10: general.base_model.0.organization str = Qwen llama_model_loader: - kv 11: general.base_model.0.repo_url str = https://huggingface.co/Qwen/Qwen2.5-C... llama_model_loader: - kv 12: general.tags arr[str,6] = ["code", "codeqwen", "chat", "qwen", ... llama_model_loader: - kv 13: general.languages arr[str,1] = ["en"] llama_model_loader: - kv 14: qwen2.block_count u32 = 28 llama_model_loader: - kv 15: qwen2.context_length u32 = 32768 llama_model_loader: - kv 16: qwen2.embedding_length u32 = 3584 llama_model_loader: - kv 17: qwen2.feed_forward_length u32 = 18944 llama_model_loader: - kv 18: qwen2.attention.head_count u32 = 28 llama_model_loader: - kv 19: qwen2.attention.head_count_kv u32 = 4 llama_model_loader: - kv 20: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 21: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001 llama_model_loader: - kv 22: general.file_type u32 = 15 llama_model_loader: - kv 23: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 24: tokenizer.ggml.pre str = qwen2 llama_model_loader: - kv 25: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 26: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 27: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 28: tokenizer.ggml.eos_token_id u32 = 151645 llama_model_loader: - kv 29: tokenizer.ggml.padding_token_id u32 = 151643 llama_model_loader: - kv 30: tokenizer.ggml.bos_token_id u32 = 151643 llama_model_loader: - kv 31: tokenizer.ggml.add_bos_token bool = false llama_model_loader: - kv 32: tokenizer.chat_template str = {%- if tools %}\n {{- '<|im_start|>... llama_model_loader: - kv 33: general.quantization_version u32 = 2 llama_model_loader: - type f32: 141 tensors llama_model_loader: - type q4_K: 169 tensors llama_model_loader: - type q6_K: 29 tensors print_info: file format = GGUF V3 (latest) print_info: file type = Q4_K - Medium print_info: file size = 4.36 GiB (4.91 BPW) load: special tokens cache size = 22 load: token to piece cache size = 0.9310 MB print_info: arch = qwen2 print_info: vocab_only = 1 print_info: model type = ?B print_info: model params = 7.62 B print_info: general.name = Qwen2.5 Coder 7B Instruct print_info: vocab type = BPE print_info: n_vocab = 152064 print_info: n_merges = 151387 print_info: BOS token = 151643 '<|endoftext|>' print_info: EOS token = 151645 '<|im_end|>' print_info: EOT token = 151645 '<|im_end|>' print_info: PAD token = 151643 '<|endoftext|>' print_info: LF token = 198 'Ċ' print_info: FIM PRE token = 151659 '<|fim_prefix|>' print_info: FIM SUF token = 151661 '<|fim_suffix|>' print_info: FIM MID token = 151660 '<|fim_middle|>' print_info: FIM PAD token = 151662 '<|fim_pad|>' print_info: FIM REP token = 151663 '<|repo_name|>' print_info: FIM SEP token = 151664 '<|file_sep|>' print_info: EOG token = 151643 '<|endoftext|>' print_info: EOG token = 151645 '<|im_end|>' print_info: EOG token = 151662 '<|fim_pad|>' print_info: EOG token = 151663 '<|repo_name|>' print_info: EOG token = 151664 '<|file_sep|>' print_info: max token length = 256 llama_model_load: vocab only - skipping tensors time=2025-07-12T10:03:10.336+08:00 level=INFO source=server.go:438 msg="starting llama server" cmd="D:\\Ollama\\OllamaInstall\\ollama.exe runner --model D:\\Ollama\\LLMInstall\\blobs\\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 --ctx-size 1024 --batch-size 1 --n-gpu-layers 2 --threads 8 --no-mmap --parallel 1 --port 53356" time=2025-07-12T10:03:10.343+08:00 level=INFO source=sched.go:483 msg="loaded runners" count=1 time=2025-07-12T10:03:10.344+08:00 level=INFO source=server.go:598 msg="waiting for llama runner to start responding" time=2025-07-12T10:03:10.345+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server error" time=2025-07-12T10:03:10.394+08:00 level=INFO source=runner.go:815 msg="starting go runner" 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 4070 SUPER, compute capability 8.9, VMM: yes load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\ggml-cuda.dll load_backend: loaded CPU backend from D:\Ollama\OllamaInstall\lib\ollama\ggml-cpu-icelake.dll 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 4070 SUPER, compute capability 8.9, VMM: yes load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\cuda_v12\ggml-cuda.dll time=2025-07-12T10:03:10.516+08:00 level=INFO source=ggml.go:104 msg=system CPU.0.SSE3=1 CPU.0.SSSE3=1 CPU.0.AVX=1 CPU.0.AVX2=1 CPU.0.F16C=1 CPU.0.FMA=1 CPU.0.BMI2=1 CPU.0.AVX512=1 CPU.0.AVX512_VBMI=1 CPU.0.AVX512_VNNI=1 CPU.0.LLAMAFILE=1 CPU.1.LLAMAFILE=1 CUDA.0.ARCHS=500,600,610,700,750,800,860,870,890,900,1200 CUDA.0.USE_GRAPHS=1 CUDA.0.PEER_MAX_BATCH_SIZE=128 CUDA.1.ARCHS=500,600,610,700,750,800,860,870,890,900,1200 CUDA.1.USE_GRAPHS=1 CUDA.1.PEER_MAX_BATCH_SIZE=128 compiler=cgo(clang) time=2025-07-12T10:03:10.518+08:00 level=INFO source=runner.go:874 msg="Server listening on 127.0.0.1:53356" time=2025-07-12T10:03:10.598+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server loading model" llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4070 SUPER) - 11053 MiB free llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4070 SUPER) - 11053 MiB free llama_model_loader: loaded meta data with 34 key-value pairs and 339 tensors from D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 (version GGUF V3 (latest)) llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output. llama_model_loader: - kv 0: general.architecture str = qwen2 llama_model_loader: - kv 1: general.type str = model llama_model_loader: - kv 2: general.name str = Qwen2.5 Coder 7B Instruct llama_model_loader: - kv 3: general.finetune str = Instruct llama_model_loader: - kv 4: general.basename str = Qwen2.5-Coder llama_model_loader: - kv 5: general.size_label str = 7B llama_model_loader: - kv 6: general.license str = apache-2.0 llama_model_loader: - kv 7: general.license.link str = https://huggingface.co/Qwen/Qwen2.5-C... llama_model_loader: - kv 8: general.base_model.count u32 = 1 llama_model_loader: - kv 9: general.base_model.0.name str = Qwen2.5 Coder 7B llama_model_loader: - kv 10: general.base_model.0.organization str = Qwen llama_model_loader: - kv 11: general.base_model.0.repo_url str = https://huggingface.co/Qwen/Qwen2.5-C... llama_model_loader: - kv 12: general.tags arr[str,6] = ["code", "codeqwen", "chat", "qwen", ... llama_model_loader: - kv 13: general.languages arr[str,1] = ["en"] llama_model_loader: - kv 14: qwen2.block_count u32 = 28 llama_model_loader: - kv 15: qwen2.context_length u32 = 32768 llama_model_loader: - kv 16: qwen2.embedding_length u32 = 3584 llama_model_loader: - kv 17: qwen2.feed_forward_length u32 = 18944 llama_model_loader: - kv 18: qwen2.attention.head_count u32 = 28 llama_model_loader: - kv 19: qwen2.attention.head_count_kv u32 = 4 llama_model_loader: - kv 20: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 21: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001 llama_model_loader: - kv 22: general.file_type u32 = 15 llama_model_loader: - kv 23: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 24: tokenizer.ggml.pre str = qwen2 llama_model_loader: - kv 25: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 26: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 27: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 28: tokenizer.ggml.eos_token_id u32 = 151645 llama_model_loader: - kv 29: tokenizer.ggml.padding_token_id u32 = 151643 llama_model_loader: - kv 30: tokenizer.ggml.bos_token_id u32 = 151643 llama_model_loader: - kv 31: tokenizer.ggml.add_bos_token bool = false llama_model_loader: - kv 32: tokenizer.chat_template str = {%- if tools %}\n {{- '<|im_start|>... llama_model_loader: - kv 33: general.quantization_version u32 = 2 llama_model_loader: - type f32: 141 tensors llama_model_loader: - type q4_K: 169 tensors llama_model_loader: - type q6_K: 29 tensors print_info: file format = GGUF V3 (latest) print_info: file type = Q4_K - Medium print_info: file size = 4.36 GiB (4.91 BPW) load: special tokens cache size = 22 load: token to piece cache size = 0.9310 MB print_info: arch = qwen2 print_info: vocab_only = 0 print_info: n_ctx_train = 32768 print_info: n_embd = 3584 print_info: n_layer = 28 print_info: n_head = 28 print_info: n_head_kv = 4 print_info: n_rot = 128 print_info: n_swa = 0 print_info: n_swa_pattern = 1 print_info: n_embd_head_k = 128 print_info: n_embd_head_v = 128 print_info: n_gqa = 7 print_info: n_embd_k_gqa = 512 print_info: n_embd_v_gqa = 512 print_info: f_norm_eps = 0.0e+00 print_info: f_norm_rms_eps = 1.0e-06 print_info: f_clamp_kqv = 0.0e+00 print_info: f_max_alibi_bias = 0.0e+00 print_info: f_logit_scale = 0.0e+00 print_info: f_attn_scale = 0.0e+00 print_info: n_ff = 18944 print_info: n_expert = 0 print_info: n_expert_used = 0 print_info: causal attn = 1 print_info: pooling type = -1 print_info: rope type = 2 print_info: rope scaling = linear print_info: freq_base_train = 1000000.0 print_info: freq_scale_train = 1 print_info: n_ctx_orig_yarn = 32768 print_info: rope_finetuned = unknown print_info: ssm_d_conv = 0 print_info: ssm_d_inner = 0 print_info: ssm_d_state = 0 print_info: ssm_dt_rank = 0 print_info: ssm_dt_b_c_rms = 0 print_info: model type = 7B print_info: model params = 7.62 B print_info: general.name = Qwen2.5 Coder 7B Instruct print_info: vocab type = BPE print_info: n_vocab = 152064 print_info: n_merges = 151387 print_info: BOS token = 151643 '<|endoftext|>' print_info: EOS token = 151645 '<|im_end|>' print_info: EOT token = 151645 '<|im_end|>' print_info: PAD token = 151643 '<|endoftext|>' print_info: LF token = 198 'Ċ' print_info: FIM PRE token = 151659 '<|fim_prefix|>' print_info: FIM SUF token = 151661 '<|fim_suffix|>' print_info: FIM MID token = 151660 '<|fim_middle|>' print_info: FIM PAD token = 151662 '<|fim_pad|>' print_info: FIM REP token = 151663 '<|repo_name|>' print_info: FIM SEP token = 151664 '<|file_sep|>' print_info: EOG token = 151643 '<|endoftext|>' print_info: EOG token = 151645 '<|im_end|>' print_info: EOG token = 151662 '<|fim_pad|>' print_info: EOG token = 151663 '<|repo_name|>' print_info: EOG token = 151664 '<|file_sep|>' print_info: max token length = 256 load_tensors: loading model tensors, this can take a while... (mmap = false) alloc_tensor_range: failed to initialize tensor blk.27.attn_q.weight llama_model_load: error loading model: unable to allocate CUDA0 buffer llama_model_load_from_file_impl: failed to load model panic: unable to load model: D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 goroutine 12 [running]: github.com/ollama/ollama/runner/llamarunner.(*Server).loadModel(0xc00010c360, {0x2, 0x0, 0x0, {0x0, 0x0, 0x0}, 0xc000483da0, 0x0}, {0xc00003a1c0, ...}, ...) C:/a/ollama/ollama/runner/llamarunner/runner.go:751 +0x395 created by github.com/ollama/ollama/runner/llamarunner.Execute in goroutine 1 C:/a/ollama/ollama/runner/llamarunner/runner.go:848 +0xb57 time=2025-07-12T10:03:10.869+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server error" time=2025-07-12T10:03:10.893+08:00 level=ERROR source=server.go:464 msg="llama runner terminated" error="exit status 2" time=2025-07-12T10:03:11.120+08:00 level=ERROR source=sched.go:489 msg="error loading llama server" error="llama runner process has terminated: error loading model: unable to allocate CUDA0 buffer" [GIN] 2025/07/12 - 10:03:11 | 500 | 1.4203973s | 127.0.0.1 | POST "/api/generate" ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.9.6
GiteaMirror added the bug label 2026-04-22 15:48:04 -05:00
Author
Owner

@Ji-Peng commented on GitHub (Jul 12, 2025):

More log with level=DEBUG:

time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:491 msg="triggering expiration for failed load" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024
[GIN] 2025/07/12 - 10:34:55 | 500 |    1.4827842s |       127.0.0.1 | POST     "/api/generate"
time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:364 msg="runner expired event received" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024
time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:379 msg="got lock to unload expired event" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024
time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:402 msg="starting background wait for VRAM recovery" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024
time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.2 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.2 GiB"
time=2025-07-12T10:34:55.651+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB"
releasing nvml library
time=2025-07-12T10:34:55.685+08:00 level=DEBUG source=server.go:1031 msg="stopping llama server" pid=23564
time=2025-07-12T10:34:55.685+08:00 level=DEBUG source=sched.go:407 msg="runner terminated and removed from list, blocking for VRAM recovery" runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463
time=2025-07-12T10:34:55.903+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.2 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB"
time=2025-07-12T10:34:55.927+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB"
releasing nvml library
time=2025-07-12T10:34:56.153+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.3 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB"
time=2025-07-12T10:34:56.179+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB"
releasing nvml library
time=2025-07-12T10:34:56.403+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.3 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB"
time=2025-07-12T10:34:56.413+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB"
releasing nvml library
time=2025-07-12T10:34:56.653+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.3 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB"
time=2025-07-12T10:34:56.678+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB"
releasing nvml library
time=2025-07-12T10:34:56.680+08:00 level=DEBUG source=sched.go:700 msg="gpu VRAM free memory converged after 1.05 seconds" runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463
time=2025-07-12T10:34:56.680+08:00 level=DEBUG source=sched.go:410 msg="sending an unloaded event" runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463
time=2025-07-12T10:34:56.680+08:00 level=DEBUG source=sched.go:312 msg="ignoring unload event with no pending requests"
<!-- gh-comment-id:3064544841 --> @Ji-Peng commented on GitHub (Jul 12, 2025): More log with level=DEBUG: ``` time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:491 msg="triggering expiration for failed load" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024 [GIN] 2025/07/12 - 10:34:55 | 500 | 1.4827842s | 127.0.0.1 | POST "/api/generate" time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:364 msg="runner expired event received" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024 time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:379 msg="got lock to unload expired event" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024 time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=sched.go:402 msg="starting background wait for VRAM recovery" runner.name=registry.ollama.ai/library/qwen2.5-coder:7b-16k-gpu runner.inference=cuda runner.devices=1 runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 runner.num_ctx=1024 time=2025-07-12T10:34:55.629+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.2 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.2 GiB" time=2025-07-12T10:34:55.651+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB" releasing nvml library time=2025-07-12T10:34:55.685+08:00 level=DEBUG source=server.go:1031 msg="stopping llama server" pid=23564 time=2025-07-12T10:34:55.685+08:00 level=DEBUG source=sched.go:407 msg="runner terminated and removed from list, blocking for VRAM recovery" runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 time=2025-07-12T10:34:55.903+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.2 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB" time=2025-07-12T10:34:55.927+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB" releasing nvml library time=2025-07-12T10:34:56.153+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.3 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB" time=2025-07-12T10:34:56.179+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB" releasing nvml library time=2025-07-12T10:34:56.403+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.3 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB" time=2025-07-12T10:34:56.413+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB" releasing nvml library time=2025-07-12T10:34:56.653+08:00 level=DEBUG source=gpu.go:391 msg="updating system memory data" before.total="31.8 GiB" before.free="16.1 GiB" before.free_swap="28.3 GiB" now.total="31.8 GiB" now.free="16.1 GiB" now.free_swap="28.3 GiB" time=2025-07-12T10:34:56.678+08:00 level=DEBUG source=gpu.go:441 msg="updating cuda memory data" gpu=GPU-cb15de68-b178-c58d-6cac-5fa0b4b5b91b name="NVIDIA GeForce RTX 4070 SUPER" overhead="0 B" before.total="12.0 GiB" before.free="9.3 GiB" now.total="12.0 GiB" now.free="9.3 GiB" now.used="2.7 GiB" releasing nvml library time=2025-07-12T10:34:56.680+08:00 level=DEBUG source=sched.go:700 msg="gpu VRAM free memory converged after 1.05 seconds" runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 time=2025-07-12T10:34:56.680+08:00 level=DEBUG source=sched.go:410 msg="sending an unloaded event" runner.size="5.2 GiB" runner.vram="1.3 GiB" runner.parallel=1 runner.pid=23564 runner.model=D:\Ollama\LLMInstall\blobs\sha256-60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463 time=2025-07-12T10:34:56.680+08:00 level=DEBUG source=sched.go:312 msg="ignoring unload event with no pending requests" ```
Author
Owner

@Ji-Peng commented on GitHub (Jul 12, 2025):

I now switch to LM studio, and with the same model and similar configuration, I can fully utilize the GPU.

<!-- gh-comment-id:3064737665 --> @Ji-Peng commented on GitHub (Jul 12, 2025): I now switch to LM studio, and with the same model and similar configuration, I can fully utilize the GPU.
Author
Owner

@rick-github commented on GitHub (Jul 12, 2025):

load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\ggml-cuda.dll
load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\cuda_v12\ggml-cuda.dll

ollama is loading the cuda library twice. https://github.com/ollama/ollama/issues/11211#issuecomment-3014589554

<!-- gh-comment-id:3065688753 --> @rick-github commented on GitHub (Jul 12, 2025): ``` load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\ggml-cuda.dll load_backend: loaded CUDA backend from D:\Ollama\OllamaInstall\lib\ollama\cuda_v12\ggml-cuda.dll ``` ollama is loading the cuda library twice. https://github.com/ollama/ollama/issues/11211#issuecomment-3014589554
Author
Owner

@Ji-Peng commented on GitHub (Jul 13, 2025):

Solved! Thanks!

<!-- gh-comment-id:3066346430 --> @Ji-Peng commented on GitHub (Jul 13, 2025): Solved! Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#33277