[GH-ISSUE #8984] Ollama not fully utilizing secondary GPU resulting in Cuda OOM #5832

Closed
opened 2026-04-12 17:10:33 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Sub0X on GitHub (Feb 10, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8984

What is the issue?

I've tried loading in Qwen2.5-32B-Instruct:q5_K_S (inference on GPU only which should work fine without offloading to memory) to GPU 0: RTX 3090 and GPU 1: RTX 4070 Laptop which has 24gb and 8gb vram respectively. When I have tried loading the model with llama.cpp, Qwen2.5-32B-Instruct has loaded fine, fully allocating the model to both GPUs while Ollama only use 1/8th of the available memory in GPU 1 with the rest still free:

(base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe -m .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes
error: invalid argument: .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf
(base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe -m .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes
build: 4667 (d2fe216f) with MSVC 19.29.30158.0 for
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free
llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free
llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf (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.size_label str              = 33B
llama_model_loader: - kv   3:                            general.license str              = apache-2.0
llama_model_loader: - kv   4:                       general.license.link str              = https://huggingface.co/huihui-ai/Qwen...
llama_model_loader: - kv   5:                   general.base_model.count u32              = 1
llama_model_loader: - kv   6:                  general.base_model.0.name str              = Qwen2.5 32B Instruct
llama_model_loader: - kv   7:          general.base_model.0.organization str              = Qwen
llama_model_loader: - kv   8:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen2.5-3...
llama_model_loader: - kv   9:                               general.tags arr[str,4]       = ["chat", "abliterated", "uncensored",...
llama_model_loader: - kv  10:                          general.languages arr[str,1]       = ["en"]
llama_model_loader: - kv  11:                          qwen2.block_count u32              = 64
llama_model_loader: - kv  12:                       qwen2.context_length u32              = 32768
llama_model_loader: - kv  13:                     qwen2.embedding_length u32              = 5120
llama_model_loader: - kv  14:                  qwen2.feed_forward_length u32              = 27648
llama_model_loader: - kv  15:                 qwen2.attention.head_count u32              = 40
llama_model_loader: - kv  16:              qwen2.attention.head_count_kv u32              = 8
llama_model_loader: - kv  17:                       qwen2.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  18:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  19:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  20:                         tokenizer.ggml.pre str              = qwen2
llama_model_loader: - kv  21:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  22:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  23:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  24:                tokenizer.ggml.eos_token_id u32              = 151645
llama_model_loader: - kv  25:            tokenizer.ggml.padding_token_id u32              = 151645
llama_model_loader: - kv  26:                tokenizer.ggml.bos_token_id u32              = 151643
llama_model_loader: - kv  27:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  28:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
llama_model_loader: - kv  29:               general.quantization_version u32              = 2
llama_model_loader: - kv  30:                          general.file_type u32              = 16
llama_model_loader: - kv  31:                      quantize.imatrix.file str              = .\jp_calibration\imatrix.dat
llama_model_loader: - kv  32:                   quantize.imatrix.dataset str              = C:\Users\sub01\Server\Storage\QUANT_I...
llama_model_loader: - kv  33:             quantize.imatrix.entries_count i32              = 448
llama_model_loader: - kv  34:              quantize.imatrix.chunks_count i32              = 727
llama_model_loader: - type  f32:  321 tensors
llama_model_loader: - type q5_K:  449 tensors
llama_model_loader: - type q6_K:    1 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q5_K - Small
print_info: file size   = 21.08 GiB (5.53 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           = 5120
print_info: n_layer          = 64
print_info: n_head           = 40
print_info: n_head_kv        = 8
print_info: n_rot            = 128
print_info: n_swa            = 0
print_info: n_embd_head_k    = 128
print_info: n_embd_head_v    = 128
print_info: n_gqa            = 5
print_info: n_embd_k_gqa     = 1024
print_info: n_embd_v_gqa     = 1024
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: n_ff             = 27648
print_info: n_expert         = 0
print_info: n_expert_used    = 0
print_info: causal attn      = 1
print_info: pooling type     = 0
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       = 32B
print_info: model params     = 32.76 B
print_info: general.name     = n/a
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        = 151645 '<|im_end|>'
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 = true)
load_tensors: offloading 64 repeating layers to GPU
load_tensors: offloading output layer to GPU
load_tensors: offloaded 65/65 layers to GPU
load_tensors:        CUDA0 model buffer size = 15987.70 MiB
load_tensors:        CUDA1 model buffer size =  5085.66 MiB
load_tensors:   CPU_Mapped model buffer size =   510.47 MiB
.................................................................................................
llama_init_from_model: n_seq_max     = 1
llama_init_from_model: n_ctx         = 4096
llama_init_from_model: n_ctx_per_seq = 4096
llama_init_from_model: n_batch       = 2048
llama_init_from_model: n_ubatch      = 512
llama_init_from_model: flash_attn    = 0
llama_init_from_model: freq_base     = 1000000.0
llama_init_from_model: freq_scale    = 1
llama_init_from_model: n_ctx_per_seq (4096) < n_ctx_train (32768) -- the full capacity of the model will not be utilized
llama_kv_cache_init: kv_size = 4096, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 64, can_shift = 1
llama_kv_cache_init:      CUDA0 KV buffer size =   800.00 MiB
llama_kv_cache_init:      CUDA1 KV buffer size =   224.00 MiB
llama_init_from_model: KV self size  = 1024.00 MiB, K (f16):  512.00 MiB, V (f16):  512.00 MiB
llama_init_from_model:  CUDA_Host  output buffer size =     0.58 MiB
llama_init_from_model: pipeline parallelism enabled (n_copies=4)
llama_init_from_model:      CUDA0 compute buffer size =   432.01 MiB
llama_init_from_model:      CUDA1 compute buffer size =   432.02 MiB
llama_init_from_model:  CUDA_Host compute buffer size =    42.02 MiB
llama_init_from_model: graph nodes  = 2246
llama_init_from_model: graph splits = 3
common_init_from_params: setting dry_penalty_last_n to ctx_size = 4096
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
main: llama threadpool init, n_threads = 24
main: chat template is available, enabling conversation mode (disable it with -no-cnv)
main: chat template example:
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
Hello<|im_end|>
<|im_start|>assistant
Hi there<|im_end|>
<|im_start|>user
How are you?<|im_end|>
<|im_start|>assistant


system_info: n_threads = 24 (n_threads_batch = 24) / 32 | CUDA : ARCHS = 520,610,700,750 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 |

main: interactive mode on.
sampler seed: 1105860231
sampler params:
        repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.000
        dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 4096
        top_k = 40, top_p = 0.950, min_p = 0.050, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, temp = 0.800
        mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000
sampler chain: logits -> logit-bias -> penalties -> dry -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist
generate: n_ctx = 4096, n_batch = 2048, n_predict = -1, n_keep = 0

== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.
 - Using default system message. To change it, set a different value via -p PROMPT or -f FILE argument.

However, when using ollama, it primarily allocates the model to GPU 0 and only 1GB of the memory in GPU 1 (unlike the 5GB from llama.cpp) resulting in a CUDA OOM error:

2025/02/10 00:41:06 routes.go:1187: INFO server config env="map[CUDA_VISIBLE_DEVICES:GPU-6a8f1072-ea32-0f5b-6750-34c854c28566,GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:true OLLAMA_GPU_OVERHEAD:536870912 OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:2562047h47m16.854775807s OLLAMA_KV_CACHE_TYPE:q8_0 OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:C:\\Users\\sub01\\Server\\ollama\\models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 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://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]"
time=2025-02-10T00:41:06.438-05:00 level=INFO source=images.go:432 msg="total blobs: 29"
time=2025-02-10T00:41:06.439-05:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1238 msg="Listening on [::]:11434 (version 0.5.7)"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1267 msg="Dynamic LLM libraries" runners="[cpu_avx2 cuda_v11_avx cuda_v12_avx rocm_avx cpu cpu_avx]"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu.go:226 msg="looking for compatible GPUs"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:167 msg=packages count=1
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:183 msg="efficiency cores detected" maxEfficiencyClass=1
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=24 efficiency=16 threads=32
time=2025-02-10T00:41:06.609-05:00 level=INFO source=gpu.go:334 msg="detected OS VRAM overhead" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" overhead="1020.0 MiB"
time=2025-02-10T00:41:06.689-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda variant=v12 compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" total="24.0 GiB" available="22.8 GiB"
time=2025-02-10T00:41:06.690-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c library=cuda variant=v12 compute=8.9 driver=12.8 name="NVIDIA GeForce RTX 4070 Laptop GPU" total="8.0 GiB" available="6.9 GiB"
[GIN] 2025/02/10 - 00:41:19 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2025/02/10 - 00:41:19 | 200 |     73.6193ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2025/02/10 - 00:41:26 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2025/02/10 - 00:41:26 | 200 |     12.0953ms |       127.0.0.1 | POST     "/api/show"
time=2025-02-10T00:41:26.434-05:00 level=INFO source=server.go:104 msg="system memory" total="95.6 GiB" free="80.2 GiB" free_swap="92.4 GiB"
time=2025-02-10T00:41:26.468-05:00 level=INFO source=memory.go:356 msg="offload to cuda" layers.requested=99 layers.model=65 layers.offload=45 layers.split=43,2 memory.available="[22.8 GiB 6.4 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="36.0 GiB" memory.required.partial="27.6 GiB" memory.required.kv="5.0 GiB" memory.required.allocations="[22.0 GiB 5.7 GiB]" memory.weights.total="25.6 GiB" memory.weights.repeating="25.0 GiB" memory.weights.nonrepeating="609.1 MiB" memory.graph.full="4.0 GiB" memory.graph.partial="4.0 GiB"
time=2025-02-10T00:41:26.469-05:00 level=INFO source=server.go:223 msg="enabling flash attention"
time=2025-02-10T00:41:26.479-05:00 level=INFO source=server.go:376 msg="starting llama server" cmd="C:\\Users\\sub01\\AppData\\Local\\Programs\\Ollama\\lib\\ollama\\runners\\cuda_v12_avx\\ollama_llama_server.exe runner --model C:\\Users\\sub01\\Server\\ollama\\models\\blobs\\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d --ctx-size 40960 --batch-size 512 --n-gpu-layers 99 --threads 8 --flash-attn --kv-cache-type q8_0 --no-mmap --parallel 1 --tensor-split 43,2 --port 60489"
time=2025-02-10T00:41:26.481-05:00 level=INFO source=sched.go:449 msg="loaded runners" count=1
time=2025-02-10T00:41:26.481-05:00 level=INFO source=server.go:555 msg="waiting for llama runner to start responding"
time=2025-02-10T00:41:26.482-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server error"
time=2025-02-10T00:41:26.564-05:00 level=INFO source=runner.go:936 msg="starting go runner"
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes
time=2025-02-10T00:41:26.652-05:00 level=INFO source=runner.go:937 msg=system info="CUDA : ARCHS = 600,610,620,700,720,750,800,860,870,890,900 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | LLAMAFILE = 1 | AARCH64_REPACK = 1 | cgo(clang)" threads=8
time=2025-02-10T00:41:26.652-05:00 level=INFO source=.:0 msg="Server listening on 127.0.0.1:60489"
time=2025-02-10T00:41:26.733-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server loading model"
llama_load_model_from_file: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free
llama_load_model_from_file: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free
llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from C:\Users\sub01\Server\ollama\models\blobs\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d (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.size_label str              = 33B
llama_model_loader: - kv   3:                            general.license str              = apache-2.0
llama_model_loader: - kv   4:                       general.license.link str              = https://huggingface.co/huihui-ai/Qwen...
llama_model_loader: - kv   5:                   general.base_model.count u32              = 1
llama_model_loader: - kv   6:                  general.base_model.0.name str              = Qwen2.5 32B Instruct
llama_model_loader: - kv   7:          general.base_model.0.organization str              = Qwen
llama_model_loader: - kv   8:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen2.5-3...
llama_model_loader: - kv   9:                               general.tags arr[str,4]       = ["chat", "abliterated", "uncensored",...
llama_model_loader: - kv  10:                          general.languages arr[str,1]       = ["en"]
llama_model_loader: - kv  11:                          qwen2.block_count u32              = 64
llama_model_loader: - kv  12:                       qwen2.context_length u32              = 32768
llama_model_loader: - kv  13:                     qwen2.embedding_length u32              = 5120
llama_model_loader: - kv  14:                  qwen2.feed_forward_length u32              = 27648
llama_model_loader: - kv  15:                 qwen2.attention.head_count u32              = 40
llama_model_loader: - kv  16:              qwen2.attention.head_count_kv u32              = 8
llama_model_loader: - kv  17:                       qwen2.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  18:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  19:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  20:                         tokenizer.ggml.pre str              = qwen2
llama_model_loader: - kv  21:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  22:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  23:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  24:                tokenizer.ggml.eos_token_id u32              = 151645
llama_model_loader: - kv  25:            tokenizer.ggml.padding_token_id u32              = 151645
llama_model_loader: - kv  26:                tokenizer.ggml.bos_token_id u32              = 151643
llama_model_loader: - kv  27:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  28:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
llama_model_loader: - kv  29:               general.quantization_version u32              = 2
llama_model_loader: - kv  30:                          general.file_type u32              = 17
llama_model_loader: - kv  31:                      quantize.imatrix.file str              = .\jp_calibration\imatrix.dat
llama_model_loader: - kv  32:                   quantize.imatrix.dataset str              = C:\Users\sub01\Server\Storage\QUANT_I...
llama_model_loader: - kv  33:             quantize.imatrix.entries_count i32              = 448
llama_model_loader: - kv  34:              quantize.imatrix.chunks_count i32              = 727
llama_model_loader: - type  f32:  321 tensors
llama_model_loader: - type q5_K:  385 tensors
llama_model_loader: - type q6_K:   65 tensors
llm_load_vocab: special tokens cache size = 22
llm_load_vocab: token to piece cache size = 0.9310 MB
llm_load_print_meta: format           = GGUF V3 (latest)
llm_load_print_meta: arch             = qwen2
llm_load_print_meta: vocab type       = BPE
llm_load_print_meta: n_vocab          = 152064
llm_load_print_meta: n_merges         = 151387
llm_load_print_meta: vocab_only       = 0
llm_load_print_meta: n_ctx_train      = 32768
llm_load_print_meta: n_embd           = 5120
llm_load_print_meta: n_layer          = 64
llm_load_print_meta: n_head           = 40
llm_load_print_meta: n_head_kv        = 8
llm_load_print_meta: n_rot            = 128
llm_load_print_meta: n_swa            = 0
llm_load_print_meta: n_embd_head_k    = 128
llm_load_print_meta: n_embd_head_v    = 128
llm_load_print_meta: n_gqa            = 5
llm_load_print_meta: n_embd_k_gqa     = 1024
llm_load_print_meta: n_embd_v_gqa     = 1024
llm_load_print_meta: f_norm_eps       = 0.0e+00
llm_load_print_meta: f_norm_rms_eps   = 1.0e-06
llm_load_print_meta: f_clamp_kqv      = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: f_logit_scale    = 0.0e+00
llm_load_print_meta: n_ff             = 27648
llm_load_print_meta: n_expert         = 0
llm_load_print_meta: n_expert_used    = 0
llm_load_print_meta: causal attn      = 1
llm_load_print_meta: pooling type     = 0
llm_load_print_meta: rope type        = 2
llm_load_print_meta: rope scaling     = linear
llm_load_print_meta: freq_base_train  = 1000000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn  = 32768
llm_load_print_meta: rope_finetuned   = unknown
llm_load_print_meta: ssm_d_conv       = 0
llm_load_print_meta: ssm_d_inner      = 0
llm_load_print_meta: ssm_d_state      = 0
llm_load_print_meta: ssm_dt_rank      = 0
llm_load_print_meta: ssm_dt_b_c_rms   = 0
llm_load_print_meta: model type       = 32B
llm_load_print_meta: model ftype      = Q5_K - Medium
llm_load_print_meta: model params     = 32.76 B
llm_load_print_meta: model size       = 21.66 GiB (5.68 BPW)
llm_load_print_meta: general.name     = n/a
llm_load_print_meta: BOS token        = 151643 '<|endoftext|>'
llm_load_print_meta: EOS token        = 151645 '<|im_end|>'
llm_load_print_meta: EOT token        = 151645 '<|im_end|>'
llm_load_print_meta: PAD token        = 151645 '<|im_end|>'
llm_load_print_meta: LF token         = 148848 'ÄĬ'
llm_load_print_meta: FIM PRE token    = 151659 '<|fim_prefix|>'
llm_load_print_meta: FIM SUF token    = 151661 '<|fim_suffix|>'
llm_load_print_meta: FIM MID token    = 151660 '<|fim_middle|>'
llm_load_print_meta: FIM PAD token    = 151662 '<|fim_pad|>'
llm_load_print_meta: FIM REP token    = 151663 '<|repo_name|>'
llm_load_print_meta: FIM SEP token    = 151664 '<|file_sep|>'
llm_load_print_meta: EOG token        = 151643 '<|endoftext|>'
llm_load_print_meta: EOG token        = 151645 '<|im_end|>'
llm_load_print_meta: EOG token        = 151662 '<|fim_pad|>'
llm_load_print_meta: EOG token        = 151663 '<|repo_name|>'
llm_load_print_meta: EOG token        = 151664 '<|file_sep|>'
llm_load_print_meta: max token length = 256
llm_load_tensors: offloading 64 repeating layers to GPU
llm_load_tensors: offloading output layer to GPU
llm_load_tensors: offloaded 65/65 layers to GPU
llm_load_tensors:          CPU model buffer size =   510.47 MiB
llm_load_tensors:        CUDA0 model buffer size = 20720.90 MiB
llm_load_tensors:        CUDA1 model buffer size =   947.45 MiB
llama_new_context_with_model: n_seq_max     = 1
llama_new_context_with_model: n_ctx         = 40960
llama_new_context_with_model: n_ctx_per_seq = 40960
llama_new_context_with_model: n_batch       = 512
llama_new_context_with_model: n_ubatch      = 512
llama_new_context_with_model: flash_attn    = 1
llama_new_context_with_model: freq_base     = 1000000.0
llama_new_context_with_model: freq_scale    = 1
llama_new_context_with_model: n_ctx_pre_seq (40960) > n_ctx_train (32768) -- possible training context overflow
llama_kv_cache_init: kv_size = 40960, offload = 1, type_k = 'q8_0', type_v = 'q8_0', n_layer = 64, can_shift = 1
ggml_backend_cuda_buffer_type_alloc_buffer: allocating 5355.00 MiB on device 0: cudaMalloc failed: out of memory
llama_kv_cache_init: failed to allocate buffer for kv cache
llama_new_context_with_model: llama_kv_cache_init() failed for self-attention cache
panic: unable to create llama context

Modelfile

FROM "./jp_calibration/Qwen2.5-32B-Instruct-q5_k_m-jp.gguf"

PARAMETER temperature 0.7
PARAMETER top_k 20
PARAMETER top_p 0.8
PARAMETER num_ctx 40960
PARAMETER num_gpu 99

TEMPLATE """
{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}

# Tools

You may call one or more functions to assist with the user query.

You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range .Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>

For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
{{- end }}<|im_end|>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{ else if eq .Role "assistant" }}<|im_start|>assistant
{{ if .Content }}{{ .Content }}
{{- else if .ToolCalls }}<tool_call>
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{ end }}</tool_call>
{{- end }}{{ if not $last }}<|im_end|>
{{ end }}
{{- else if eq .Role "tool" }}<|im_start|>user
<tool_response>
{{ .Content }}
</tool_response><|im_end|>
{{ end }}
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
{{ end }}
{{- end }}
{{- else }}
{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}
"""

PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"

Relevant log output

Llama.cpp Log:
(base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes
error: invalid argument: .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf
(base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe -m .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes
build: 4667 (d2fe216f) with MSVC 19.29.30158.0 for
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free
llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free
llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf (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.size_label str              = 33B
llama_model_loader: - kv   3:                            general.license str              = apache-2.0
llama_model_loader: - kv   4:                       general.license.link str              = https://huggingface.co/huihui-ai/Qwen...
llama_model_loader: - kv   5:                   general.base_model.count u32              = 1
llama_model_loader: - kv   6:                  general.base_model.0.name str              = Qwen2.5 32B Instruct
llama_model_loader: - kv   7:          general.base_model.0.organization str              = Qwen
llama_model_loader: - kv   8:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen2.5-3...
llama_model_loader: - kv   9:                               general.tags arr[str,4]       = ["chat", "abliterated", "uncensored",...
llama_model_loader: - kv  10:                          general.languages arr[str,1]       = ["en"]
llama_model_loader: - kv  11:                          qwen2.block_count u32              = 64
llama_model_loader: - kv  12:                       qwen2.context_length u32              = 32768
llama_model_loader: - kv  13:                     qwen2.embedding_length u32              = 5120
llama_model_loader: - kv  14:                  qwen2.feed_forward_length u32              = 27648
llama_model_loader: - kv  15:                 qwen2.attention.head_count u32              = 40
llama_model_loader: - kv  16:              qwen2.attention.head_count_kv u32              = 8
llama_model_loader: - kv  17:                       qwen2.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  18:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  19:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  20:                         tokenizer.ggml.pre str              = qwen2
llama_model_loader: - kv  21:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  22:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  23:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  24:                tokenizer.ggml.eos_token_id u32              = 151645
llama_model_loader: - kv  25:            tokenizer.ggml.padding_token_id u32              = 151645
llama_model_loader: - kv  26:                tokenizer.ggml.bos_token_id u32              = 151643
llama_model_loader: - kv  27:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  28:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
llama_model_loader: - kv  29:               general.quantization_version u32              = 2
llama_model_loader: - kv  30:                          general.file_type u32              = 16
llama_model_loader: - kv  31:                      quantize.imatrix.file str              = .\jp_calibration\imatrix.dat
llama_model_loader: - kv  32:                   quantize.imatrix.dataset str              = C:\Users\sub01\Server\Storage\QUANT_I...
llama_model_loader: - kv  33:             quantize.imatrix.entries_count i32              = 448
llama_model_loader: - kv  34:              quantize.imatrix.chunks_count i32              = 727
llama_model_loader: - type  f32:  321 tensors
llama_model_loader: - type q5_K:  449 tensors
llama_model_loader: - type q6_K:    1 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q5_K - Small
print_info: file size   = 21.08 GiB (5.53 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           = 5120
print_info: n_layer          = 64
print_info: n_head           = 40
print_info: n_head_kv        = 8
print_info: n_rot            = 128
print_info: n_swa            = 0
print_info: n_embd_head_k    = 128
print_info: n_embd_head_v    = 128
print_info: n_gqa            = 5
print_info: n_embd_k_gqa     = 1024
print_info: n_embd_v_gqa     = 1024
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: n_ff             = 27648
print_info: n_expert         = 0
print_info: n_expert_used    = 0
print_info: causal attn      = 1
print_info: pooling type     = 0
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       = 32B
print_info: model params     = 32.76 B
print_info: general.name     = n/a
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        = 151645 '<|im_end|>'
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 = true)
load_tensors: offloading 64 repeating layers to GPU
load_tensors: offloading output layer to GPU
load_tensors: offloaded 65/65 layers to GPU
load_tensors:        CUDA0 model buffer size = 15987.70 MiB
load_tensors:        CUDA1 model buffer size =  5085.66 MiB
load_tensors:   CPU_Mapped model buffer size =   510.47 MiB
.................................................................................................
llama_init_from_model: n_seq_max     = 1
llama_init_from_model: n_ctx         = 4096
llama_init_from_model: n_ctx_per_seq = 4096
llama_init_from_model: n_batch       = 2048
llama_init_from_model: n_ubatch      = 512
llama_init_from_model: flash_attn    = 0
llama_init_from_model: freq_base     = 1000000.0
llama_init_from_model: freq_scale    = 1
llama_init_from_model: n_ctx_per_seq (4096) < n_ctx_train (32768) -- the full capacity of the model will not be utilized
llama_kv_cache_init: kv_size = 4096, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 64, can_shift = 1
llama_kv_cache_init:      CUDA0 KV buffer size =   800.00 MiB
llama_kv_cache_init:      CUDA1 KV buffer size =   224.00 MiB
llama_init_from_model: KV self size  = 1024.00 MiB, K (f16):  512.00 MiB, V (f16):  512.00 MiB
llama_init_from_model:  CUDA_Host  output buffer size =     0.58 MiB
llama_init_from_model: pipeline parallelism enabled (n_copies=4)
llama_init_from_model:      CUDA0 compute buffer size =   432.01 MiB
llama_init_from_model:      CUDA1 compute buffer size =   432.02 MiB
llama_init_from_model:  CUDA_Host compute buffer size =    42.02 MiB
llama_init_from_model: graph nodes  = 2246
llama_init_from_model: graph splits = 3
common_init_from_params: setting dry_penalty_last_n to ctx_size = 4096
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
main: llama threadpool init, n_threads = 24
main: chat template is available, enabling conversation mode (disable it with -no-cnv)
main: chat template example:
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
Hello<|im_end|>
<|im_start|>assistant
Hi there<|im_end|>
<|im_start|>user
How are you?<|im_end|>
<|im_start|>assistant


system_info: n_threads = 24 (n_threads_batch = 24) / 32 | CUDA : ARCHS = 520,610,700,750 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 |

main: interactive mode on.
sampler seed: 1105860231
sampler params:
        repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.000
        dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 4096
        top_k = 40, top_p = 0.950, min_p = 0.050, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, temp = 0.800
        mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000
sampler chain: logits -> logit-bias -> penalties -> dry -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist
generate: n_ctx = 4096, n_batch = 2048, n_predict = -1, n_keep = 0

== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.
 - Using default system message. To change it, set a different value via -p PROMPT or -f FILE argument.

system
You are a helpful assistant



Ollama Log:
(base) PS C:\Users\sub01> ollama serve
2025/02/10 00:41:06 routes.go:1187: INFO server config env="map[CUDA_VISIBLE_DEVICES:GPU-6a8f1072-ea32-0f5b-6750-34c854c28566,GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:true OLLAMA_GPU_OVERHEAD:536870912 OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:2562047h47m16.854775807s OLLAMA_KV_CACHE_TYPE:q8_0 OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:C:\\Users\\sub01\\Server\\ollama\\models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 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://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]"
time=2025-02-10T00:41:06.438-05:00 level=INFO source=images.go:432 msg="total blobs: 29"
time=2025-02-10T00:41:06.439-05:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1238 msg="Listening on [::]:11434 (version 0.5.7)"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1267 msg="Dynamic LLM libraries" runners="[cpu_avx2 cuda_v11_avx cuda_v12_avx rocm_avx cpu cpu_avx]"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu.go:226 msg="looking for compatible GPUs"
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:167 msg=packages count=1
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:183 msg="efficiency cores detected" maxEfficiencyClass=1
time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=24 efficiency=16 threads=32
time=2025-02-10T00:41:06.609-05:00 level=INFO source=gpu.go:334 msg="detected OS VRAM overhead" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" overhead="1020.0 MiB"
time=2025-02-10T00:41:06.689-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda variant=v12 compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" total="24.0 GiB" available="22.8 GiB"
time=2025-02-10T00:41:06.690-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c library=cuda variant=v12 compute=8.9 driver=12.8 name="NVIDIA GeForce RTX 4070 Laptop GPU" total="8.0 GiB" available="6.9 GiB"
[GIN] 2025/02/10 - 00:41:19 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2025/02/10 - 00:41:19 | 200 |     73.6193ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2025/02/10 - 00:41:26 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2025/02/10 - 00:41:26 | 200 |     12.0953ms |       127.0.0.1 | POST     "/api/show"
time=2025-02-10T00:41:26.434-05:00 level=INFO source=server.go:104 msg="system memory" total="95.6 GiB" free="80.2 GiB" free_swap="92.4 GiB"
time=2025-02-10T00:41:26.468-05:00 level=INFO source=memory.go:356 msg="offload to cuda" layers.requested=99 layers.model=65 layers.offload=45 layers.split=43,2 memory.available="[22.8 GiB 6.4 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="36.0 GiB" memory.required.partial="27.6 GiB" memory.required.kv="5.0 GiB" memory.required.allocations="[22.0 GiB 5.7 GiB]" memory.weights.total="25.6 GiB" memory.weights.repeating="25.0 GiB" memory.weights.nonrepeating="609.1 MiB" memory.graph.full="4.0 GiB" memory.graph.partial="4.0 GiB"
time=2025-02-10T00:41:26.469-05:00 level=INFO source=server.go:223 msg="enabling flash attention"
time=2025-02-10T00:41:26.479-05:00 level=INFO source=server.go:376 msg="starting llama server" cmd="C:\\Users\\sub01\\AppData\\Local\\Programs\\Ollama\\lib\\ollama\\runners\\cuda_v12_avx\\ollama_llama_server.exe runner --model C:\\Users\\sub01\\Server\\ollama\\models\\blobs\\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d --ctx-size 40960 --batch-size 512 --n-gpu-layers 99 --threads 8 --flash-attn --kv-cache-type q8_0 --no-mmap --parallel 1 --tensor-split 43,2 --port 60489"
time=2025-02-10T00:41:26.481-05:00 level=INFO source=sched.go:449 msg="loaded runners" count=1
time=2025-02-10T00:41:26.481-05:00 level=INFO source=server.go:555 msg="waiting for llama runner to start responding"
time=2025-02-10T00:41:26.482-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server error"
time=2025-02-10T00:41:26.564-05:00 level=INFO source=runner.go:936 msg="starting go runner"
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes
time=2025-02-10T00:41:26.652-05:00 level=INFO source=runner.go:937 msg=system info="CUDA : ARCHS = 600,610,620,700,720,750,800,860,870,890,900 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | LLAMAFILE = 1 | AARCH64_REPACK = 1 | cgo(clang)" threads=8
time=2025-02-10T00:41:26.652-05:00 level=INFO source=.:0 msg="Server listening on 127.0.0.1:60489"
time=2025-02-10T00:41:26.733-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server loading model"
llama_load_model_from_file: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free
llama_load_model_from_file: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free
llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from C:\Users\sub01\Server\ollama\models\blobs\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d (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.size_label str              = 33B
llama_model_loader: - kv   3:                            general.license str              = apache-2.0
llama_model_loader: - kv   4:                       general.license.link str              = https://huggingface.co/huihui-ai/Qwen...
llama_model_loader: - kv   5:                   general.base_model.count u32              = 1
llama_model_loader: - kv   6:                  general.base_model.0.name str              = Qwen2.5 32B Instruct
llama_model_loader: - kv   7:          general.base_model.0.organization str              = Qwen
llama_model_loader: - kv   8:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen2.5-3...
llama_model_loader: - kv   9:                               general.tags arr[str,4]       = ["chat", "abliterated", "uncensored",...
llama_model_loader: - kv  10:                          general.languages arr[str,1]       = ["en"]
llama_model_loader: - kv  11:                          qwen2.block_count u32              = 64
llama_model_loader: - kv  12:                       qwen2.context_length u32              = 32768
llama_model_loader: - kv  13:                     qwen2.embedding_length u32              = 5120
llama_model_loader: - kv  14:                  qwen2.feed_forward_length u32              = 27648
llama_model_loader: - kv  15:                 qwen2.attention.head_count u32              = 40
llama_model_loader: - kv  16:              qwen2.attention.head_count_kv u32              = 8
llama_model_loader: - kv  17:                       qwen2.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  18:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  19:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  20:                         tokenizer.ggml.pre str              = qwen2
llama_model_loader: - kv  21:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  22:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  23:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  24:                tokenizer.ggml.eos_token_id u32              = 151645
llama_model_loader: - kv  25:            tokenizer.ggml.padding_token_id u32              = 151645
llama_model_loader: - kv  26:                tokenizer.ggml.bos_token_id u32              = 151643
llama_model_loader: - kv  27:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  28:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
llama_model_loader: - kv  29:               general.quantization_version u32              = 2
llama_model_loader: - kv  30:                          general.file_type u32              = 17
llama_model_loader: - kv  31:                      quantize.imatrix.file str              = .\jp_calibration\imatrix.dat
llama_model_loader: - kv  32:                   quantize.imatrix.dataset str              = C:\Users\sub01\Server\Storage\QUANT_I...
llama_model_loader: - kv  33:             quantize.imatrix.entries_count i32              = 448
llama_model_loader: - kv  34:              quantize.imatrix.chunks_count i32              = 727
llama_model_loader: - type  f32:  321 tensors
llama_model_loader: - type q5_K:  385 tensors
llama_model_loader: - type q6_K:   65 tensors
llm_load_vocab: special tokens cache size = 22
llm_load_vocab: token to piece cache size = 0.9310 MB
llm_load_print_meta: format           = GGUF V3 (latest)
llm_load_print_meta: arch             = qwen2
llm_load_print_meta: vocab type       = BPE
llm_load_print_meta: n_vocab          = 152064
llm_load_print_meta: n_merges         = 151387
llm_load_print_meta: vocab_only       = 0
llm_load_print_meta: n_ctx_train      = 32768
llm_load_print_meta: n_embd           = 5120
llm_load_print_meta: n_layer          = 64
llm_load_print_meta: n_head           = 40
llm_load_print_meta: n_head_kv        = 8
llm_load_print_meta: n_rot            = 128
llm_load_print_meta: n_swa            = 0
llm_load_print_meta: n_embd_head_k    = 128
llm_load_print_meta: n_embd_head_v    = 128
llm_load_print_meta: n_gqa            = 5
llm_load_print_meta: n_embd_k_gqa     = 1024
llm_load_print_meta: n_embd_v_gqa     = 1024
llm_load_print_meta: f_norm_eps       = 0.0e+00
llm_load_print_meta: f_norm_rms_eps   = 1.0e-06
llm_load_print_meta: f_clamp_kqv      = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: f_logit_scale    = 0.0e+00
llm_load_print_meta: n_ff             = 27648
llm_load_print_meta: n_expert         = 0
llm_load_print_meta: n_expert_used    = 0
llm_load_print_meta: causal attn      = 1
llm_load_print_meta: pooling type     = 0
llm_load_print_meta: rope type        = 2
llm_load_print_meta: rope scaling     = linear
llm_load_print_meta: freq_base_train  = 1000000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn  = 32768
llm_load_print_meta: rope_finetuned   = unknown
llm_load_print_meta: ssm_d_conv       = 0
llm_load_print_meta: ssm_d_inner      = 0
llm_load_print_meta: ssm_d_state      = 0
llm_load_print_meta: ssm_dt_rank      = 0
llm_load_print_meta: ssm_dt_b_c_rms   = 0
llm_load_print_meta: model type       = 32B
llm_load_print_meta: model ftype      = Q5_K - Medium
llm_load_print_meta: model params     = 32.76 B
llm_load_print_meta: model size       = 21.66 GiB (5.68 BPW)
llm_load_print_meta: general.name     = n/a
llm_load_print_meta: BOS token        = 151643 '<|endoftext|>'
llm_load_print_meta: EOS token        = 151645 '<|im_end|>'
llm_load_print_meta: EOT token        = 151645 '<|im_end|>'
llm_load_print_meta: PAD token        = 151645 '<|im_end|>'
llm_load_print_meta: LF token         = 148848 'ÄĬ'
llm_load_print_meta: FIM PRE token    = 151659 '<|fim_prefix|>'
llm_load_print_meta: FIM SUF token    = 151661 '<|fim_suffix|>'
llm_load_print_meta: FIM MID token    = 151660 '<|fim_middle|>'
llm_load_print_meta: FIM PAD token    = 151662 '<|fim_pad|>'
llm_load_print_meta: FIM REP token    = 151663 '<|repo_name|>'
llm_load_print_meta: FIM SEP token    = 151664 '<|file_sep|>'
llm_load_print_meta: EOG token        = 151643 '<|endoftext|>'
llm_load_print_meta: EOG token        = 151645 '<|im_end|>'
llm_load_print_meta: EOG token        = 151662 '<|fim_pad|>'
llm_load_print_meta: EOG token        = 151663 '<|repo_name|>'
llm_load_print_meta: EOG token        = 151664 '<|file_sep|>'
llm_load_print_meta: max token length = 256
llm_load_tensors: offloading 64 repeating layers to GPU
llm_load_tensors: offloading output layer to GPU
llm_load_tensors: offloaded 65/65 layers to GPU
llm_load_tensors:          CPU model buffer size =   510.47 MiB
llm_load_tensors:        CUDA0 model buffer size = 20720.90 MiB
llm_load_tensors:        CUDA1 model buffer size =   947.45 MiB
llama_new_context_with_model: n_seq_max     = 1
llama_new_context_with_model: n_ctx         = 40960
llama_new_context_with_model: n_ctx_per_seq = 40960
llama_new_context_with_model: n_batch       = 512
llama_new_context_with_model: n_ubatch      = 512
llama_new_context_with_model: flash_attn    = 1
llama_new_context_with_model: freq_base     = 1000000.0
llama_new_context_with_model: freq_scale    = 1
llama_new_context_with_model: n_ctx_pre_seq (40960) > n_ctx_train (32768) -- possible training context overflow
llama_kv_cache_init: kv_size = 40960, offload = 1, type_k = 'q8_0', type_v = 'q8_0', n_layer = 64, can_shift = 1
ggml_backend_cuda_buffer_type_alloc_buffer: allocating 5355.00 MiB on device 0: cudaMalloc failed: out of memory
llama_kv_cache_init: failed to allocate buffer for kv cache
llama_new_context_with_model: llama_kv_cache_init() failed for self-attention cache
panic: unable to create llama context

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

No response

Originally created by @Sub0X on GitHub (Feb 10, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8984 ### What is the issue? I've tried loading in Qwen2.5-32B-Instruct:q5_K_S (inference on GPU only which should work fine without offloading to memory) to `GPU 0: RTX 3090` and `GPU 1: RTX 4070 Laptop` which has 24gb and 8gb vram respectively. When I have tried loading the model with llama.cpp, Qwen2.5-32B-Instruct has loaded fine, fully allocating the model to both GPUs while Ollama only use 1/8th of the available memory in GPU 1 with the rest still free: ``` (base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe -m .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes error: invalid argument: .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf (base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe -m .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes build: 4667 (d2fe216f) with MSVC 19.29.30158.0 for main: llama backend init main: load the model and apply lora adapter, if any llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf (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.size_label str = 33B llama_model_loader: - kv 3: general.license str = apache-2.0 llama_model_loader: - kv 4: general.license.link str = https://huggingface.co/huihui-ai/Qwen... llama_model_loader: - kv 5: general.base_model.count u32 = 1 llama_model_loader: - kv 6: general.base_model.0.name str = Qwen2.5 32B Instruct llama_model_loader: - kv 7: general.base_model.0.organization str = Qwen llama_model_loader: - kv 8: general.base_model.0.repo_url str = https://huggingface.co/Qwen/Qwen2.5-3... llama_model_loader: - kv 9: general.tags arr[str,4] = ["chat", "abliterated", "uncensored",... llama_model_loader: - kv 10: general.languages arr[str,1] = ["en"] llama_model_loader: - kv 11: qwen2.block_count u32 = 64 llama_model_loader: - kv 12: qwen2.context_length u32 = 32768 llama_model_loader: - kv 13: qwen2.embedding_length u32 = 5120 llama_model_loader: - kv 14: qwen2.feed_forward_length u32 = 27648 llama_model_loader: - kv 15: qwen2.attention.head_count u32 = 40 llama_model_loader: - kv 16: qwen2.attention.head_count_kv u32 = 8 llama_model_loader: - kv 17: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 18: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001 llama_model_loader: - kv 19: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 20: tokenizer.ggml.pre str = qwen2 llama_model_loader: - kv 21: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 22: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 23: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 24: tokenizer.ggml.eos_token_id u32 = 151645 llama_model_loader: - kv 25: tokenizer.ggml.padding_token_id u32 = 151645 llama_model_loader: - kv 26: tokenizer.ggml.bos_token_id u32 = 151643 llama_model_loader: - kv 27: tokenizer.ggml.add_bos_token bool = false llama_model_loader: - kv 28: tokenizer.chat_template str = {%- if tools %}\n {{- '<|im_start|>... llama_model_loader: - kv 29: general.quantization_version u32 = 2 llama_model_loader: - kv 30: general.file_type u32 = 16 llama_model_loader: - kv 31: quantize.imatrix.file str = .\jp_calibration\imatrix.dat llama_model_loader: - kv 32: quantize.imatrix.dataset str = C:\Users\sub01\Server\Storage\QUANT_I... llama_model_loader: - kv 33: quantize.imatrix.entries_count i32 = 448 llama_model_loader: - kv 34: quantize.imatrix.chunks_count i32 = 727 llama_model_loader: - type f32: 321 tensors llama_model_loader: - type q5_K: 449 tensors llama_model_loader: - type q6_K: 1 tensors print_info: file format = GGUF V3 (latest) print_info: file type = Q5_K - Small print_info: file size = 21.08 GiB (5.53 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 = 5120 print_info: n_layer = 64 print_info: n_head = 40 print_info: n_head_kv = 8 print_info: n_rot = 128 print_info: n_swa = 0 print_info: n_embd_head_k = 128 print_info: n_embd_head_v = 128 print_info: n_gqa = 5 print_info: n_embd_k_gqa = 1024 print_info: n_embd_v_gqa = 1024 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: n_ff = 27648 print_info: n_expert = 0 print_info: n_expert_used = 0 print_info: causal attn = 1 print_info: pooling type = 0 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 = 32B print_info: model params = 32.76 B print_info: general.name = n/a 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 = 151645 '<|im_end|>' 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 = true) load_tensors: offloading 64 repeating layers to GPU load_tensors: offloading output layer to GPU load_tensors: offloaded 65/65 layers to GPU load_tensors: CUDA0 model buffer size = 15987.70 MiB load_tensors: CUDA1 model buffer size = 5085.66 MiB load_tensors: CPU_Mapped model buffer size = 510.47 MiB ................................................................................................. llama_init_from_model: n_seq_max = 1 llama_init_from_model: n_ctx = 4096 llama_init_from_model: n_ctx_per_seq = 4096 llama_init_from_model: n_batch = 2048 llama_init_from_model: n_ubatch = 512 llama_init_from_model: flash_attn = 0 llama_init_from_model: freq_base = 1000000.0 llama_init_from_model: freq_scale = 1 llama_init_from_model: n_ctx_per_seq (4096) < n_ctx_train (32768) -- the full capacity of the model will not be utilized llama_kv_cache_init: kv_size = 4096, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 64, can_shift = 1 llama_kv_cache_init: CUDA0 KV buffer size = 800.00 MiB llama_kv_cache_init: CUDA1 KV buffer size = 224.00 MiB llama_init_from_model: KV self size = 1024.00 MiB, K (f16): 512.00 MiB, V (f16): 512.00 MiB llama_init_from_model: CUDA_Host output buffer size = 0.58 MiB llama_init_from_model: pipeline parallelism enabled (n_copies=4) llama_init_from_model: CUDA0 compute buffer size = 432.01 MiB llama_init_from_model: CUDA1 compute buffer size = 432.02 MiB llama_init_from_model: CUDA_Host compute buffer size = 42.02 MiB llama_init_from_model: graph nodes = 2246 llama_init_from_model: graph splits = 3 common_init_from_params: setting dry_penalty_last_n to ctx_size = 4096 common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable) main: llama threadpool init, n_threads = 24 main: chat template is available, enabling conversation mode (disable it with -no-cnv) main: chat template example: <|im_start|>system You are a helpful assistant<|im_end|> <|im_start|>user Hello<|im_end|> <|im_start|>assistant Hi there<|im_end|> <|im_start|>user How are you?<|im_end|> <|im_start|>assistant system_info: n_threads = 24 (n_threads_batch = 24) / 32 | CUDA : ARCHS = 520,610,700,750 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 | main: interactive mode on. sampler seed: 1105860231 sampler params: repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.000 dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 4096 top_k = 40, top_p = 0.950, min_p = 0.050, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, temp = 0.800 mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000 sampler chain: logits -> logit-bias -> penalties -> dry -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist generate: n_ctx = 4096, n_batch = 2048, n_predict = -1, n_keep = 0 == Running in interactive mode. == - Press Ctrl+C to interject at any time. - Press Return to return control to the AI. - To return control without starting a new line, end your input with '/'. - If you want to submit another line, end your input with '\'. - Using default system message. To change it, set a different value via -p PROMPT or -f FILE argument. ``` However, when using ollama, it primarily allocates the model to GPU 0 and only 1GB of the memory in GPU 1 (unlike the 5GB from llama.cpp) resulting in a CUDA OOM error: ``` 2025/02/10 00:41:06 routes.go:1187: INFO server config env="map[CUDA_VISIBLE_DEVICES:GPU-6a8f1072-ea32-0f5b-6750-34c854c28566,GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:true OLLAMA_GPU_OVERHEAD:536870912 OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:2562047h47m16.854775807s OLLAMA_KV_CACHE_TYPE:q8_0 OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:C:\\Users\\sub01\\Server\\ollama\\models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 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://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]" time=2025-02-10T00:41:06.438-05:00 level=INFO source=images.go:432 msg="total blobs: 29" time=2025-02-10T00:41:06.439-05:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0" time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1238 msg="Listening on [::]:11434 (version 0.5.7)" time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1267 msg="Dynamic LLM libraries" runners="[cpu_avx2 cuda_v11_avx cuda_v12_avx rocm_avx cpu cpu_avx]" time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu.go:226 msg="looking for compatible GPUs" time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:167 msg=packages count=1 time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:183 msg="efficiency cores detected" maxEfficiencyClass=1 time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=24 efficiency=16 threads=32 time=2025-02-10T00:41:06.609-05:00 level=INFO source=gpu.go:334 msg="detected OS VRAM overhead" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" overhead="1020.0 MiB" time=2025-02-10T00:41:06.689-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda variant=v12 compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" total="24.0 GiB" available="22.8 GiB" time=2025-02-10T00:41:06.690-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c library=cuda variant=v12 compute=8.9 driver=12.8 name="NVIDIA GeForce RTX 4070 Laptop GPU" total="8.0 GiB" available="6.9 GiB" [GIN] 2025/02/10 - 00:41:19 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2025/02/10 - 00:41:19 | 200 | 73.6193ms | 127.0.0.1 | GET "/api/tags" [GIN] 2025/02/10 - 00:41:26 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2025/02/10 - 00:41:26 | 200 | 12.0953ms | 127.0.0.1 | POST "/api/show" time=2025-02-10T00:41:26.434-05:00 level=INFO source=server.go:104 msg="system memory" total="95.6 GiB" free="80.2 GiB" free_swap="92.4 GiB" time=2025-02-10T00:41:26.468-05:00 level=INFO source=memory.go:356 msg="offload to cuda" layers.requested=99 layers.model=65 layers.offload=45 layers.split=43,2 memory.available="[22.8 GiB 6.4 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="36.0 GiB" memory.required.partial="27.6 GiB" memory.required.kv="5.0 GiB" memory.required.allocations="[22.0 GiB 5.7 GiB]" memory.weights.total="25.6 GiB" memory.weights.repeating="25.0 GiB" memory.weights.nonrepeating="609.1 MiB" memory.graph.full="4.0 GiB" memory.graph.partial="4.0 GiB" time=2025-02-10T00:41:26.469-05:00 level=INFO source=server.go:223 msg="enabling flash attention" time=2025-02-10T00:41:26.479-05:00 level=INFO source=server.go:376 msg="starting llama server" cmd="C:\\Users\\sub01\\AppData\\Local\\Programs\\Ollama\\lib\\ollama\\runners\\cuda_v12_avx\\ollama_llama_server.exe runner --model C:\\Users\\sub01\\Server\\ollama\\models\\blobs\\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d --ctx-size 40960 --batch-size 512 --n-gpu-layers 99 --threads 8 --flash-attn --kv-cache-type q8_0 --no-mmap --parallel 1 --tensor-split 43,2 --port 60489" time=2025-02-10T00:41:26.481-05:00 level=INFO source=sched.go:449 msg="loaded runners" count=1 time=2025-02-10T00:41:26.481-05:00 level=INFO source=server.go:555 msg="waiting for llama runner to start responding" time=2025-02-10T00:41:26.482-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server error" time=2025-02-10T00:41:26.564-05:00 level=INFO source=runner.go:936 msg="starting go runner" ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes time=2025-02-10T00:41:26.652-05:00 level=INFO source=runner.go:937 msg=system info="CUDA : ARCHS = 600,610,620,700,720,750,800,860,870,890,900 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | LLAMAFILE = 1 | AARCH64_REPACK = 1 | cgo(clang)" threads=8 time=2025-02-10T00:41:26.652-05:00 level=INFO source=.:0 msg="Server listening on 127.0.0.1:60489" time=2025-02-10T00:41:26.733-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server loading model" llama_load_model_from_file: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free llama_load_model_from_file: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from C:\Users\sub01\Server\ollama\models\blobs\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d (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.size_label str = 33B llama_model_loader: - kv 3: general.license str = apache-2.0 llama_model_loader: - kv 4: general.license.link str = https://huggingface.co/huihui-ai/Qwen... llama_model_loader: - kv 5: general.base_model.count u32 = 1 llama_model_loader: - kv 6: general.base_model.0.name str = Qwen2.5 32B Instruct llama_model_loader: - kv 7: general.base_model.0.organization str = Qwen llama_model_loader: - kv 8: general.base_model.0.repo_url str = https://huggingface.co/Qwen/Qwen2.5-3... llama_model_loader: - kv 9: general.tags arr[str,4] = ["chat", "abliterated", "uncensored",... llama_model_loader: - kv 10: general.languages arr[str,1] = ["en"] llama_model_loader: - kv 11: qwen2.block_count u32 = 64 llama_model_loader: - kv 12: qwen2.context_length u32 = 32768 llama_model_loader: - kv 13: qwen2.embedding_length u32 = 5120 llama_model_loader: - kv 14: qwen2.feed_forward_length u32 = 27648 llama_model_loader: - kv 15: qwen2.attention.head_count u32 = 40 llama_model_loader: - kv 16: qwen2.attention.head_count_kv u32 = 8 llama_model_loader: - kv 17: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 18: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001 llama_model_loader: - kv 19: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 20: tokenizer.ggml.pre str = qwen2 llama_model_loader: - kv 21: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 22: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 23: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 24: tokenizer.ggml.eos_token_id u32 = 151645 llama_model_loader: - kv 25: tokenizer.ggml.padding_token_id u32 = 151645 llama_model_loader: - kv 26: tokenizer.ggml.bos_token_id u32 = 151643 llama_model_loader: - kv 27: tokenizer.ggml.add_bos_token bool = false llama_model_loader: - kv 28: tokenizer.chat_template str = {%- if tools %}\n {{- '<|im_start|>... llama_model_loader: - kv 29: general.quantization_version u32 = 2 llama_model_loader: - kv 30: general.file_type u32 = 17 llama_model_loader: - kv 31: quantize.imatrix.file str = .\jp_calibration\imatrix.dat llama_model_loader: - kv 32: quantize.imatrix.dataset str = C:\Users\sub01\Server\Storage\QUANT_I... llama_model_loader: - kv 33: quantize.imatrix.entries_count i32 = 448 llama_model_loader: - kv 34: quantize.imatrix.chunks_count i32 = 727 llama_model_loader: - type f32: 321 tensors llama_model_loader: - type q5_K: 385 tensors llama_model_loader: - type q6_K: 65 tensors llm_load_vocab: special tokens cache size = 22 llm_load_vocab: token to piece cache size = 0.9310 MB llm_load_print_meta: format = GGUF V3 (latest) llm_load_print_meta: arch = qwen2 llm_load_print_meta: vocab type = BPE llm_load_print_meta: n_vocab = 152064 llm_load_print_meta: n_merges = 151387 llm_load_print_meta: vocab_only = 0 llm_load_print_meta: n_ctx_train = 32768 llm_load_print_meta: n_embd = 5120 llm_load_print_meta: n_layer = 64 llm_load_print_meta: n_head = 40 llm_load_print_meta: n_head_kv = 8 llm_load_print_meta: n_rot = 128 llm_load_print_meta: n_swa = 0 llm_load_print_meta: n_embd_head_k = 128 llm_load_print_meta: n_embd_head_v = 128 llm_load_print_meta: n_gqa = 5 llm_load_print_meta: n_embd_k_gqa = 1024 llm_load_print_meta: n_embd_v_gqa = 1024 llm_load_print_meta: f_norm_eps = 0.0e+00 llm_load_print_meta: f_norm_rms_eps = 1.0e-06 llm_load_print_meta: f_clamp_kqv = 0.0e+00 llm_load_print_meta: f_max_alibi_bias = 0.0e+00 llm_load_print_meta: f_logit_scale = 0.0e+00 llm_load_print_meta: n_ff = 27648 llm_load_print_meta: n_expert = 0 llm_load_print_meta: n_expert_used = 0 llm_load_print_meta: causal attn = 1 llm_load_print_meta: pooling type = 0 llm_load_print_meta: rope type = 2 llm_load_print_meta: rope scaling = linear llm_load_print_meta: freq_base_train = 1000000.0 llm_load_print_meta: freq_scale_train = 1 llm_load_print_meta: n_ctx_orig_yarn = 32768 llm_load_print_meta: rope_finetuned = unknown llm_load_print_meta: ssm_d_conv = 0 llm_load_print_meta: ssm_d_inner = 0 llm_load_print_meta: ssm_d_state = 0 llm_load_print_meta: ssm_dt_rank = 0 llm_load_print_meta: ssm_dt_b_c_rms = 0 llm_load_print_meta: model type = 32B llm_load_print_meta: model ftype = Q5_K - Medium llm_load_print_meta: model params = 32.76 B llm_load_print_meta: model size = 21.66 GiB (5.68 BPW) llm_load_print_meta: general.name = n/a llm_load_print_meta: BOS token = 151643 '<|endoftext|>' llm_load_print_meta: EOS token = 151645 '<|im_end|>' llm_load_print_meta: EOT token = 151645 '<|im_end|>' llm_load_print_meta: PAD token = 151645 '<|im_end|>' llm_load_print_meta: LF token = 148848 'ÄĬ' llm_load_print_meta: FIM PRE token = 151659 '<|fim_prefix|>' llm_load_print_meta: FIM SUF token = 151661 '<|fim_suffix|>' llm_load_print_meta: FIM MID token = 151660 '<|fim_middle|>' llm_load_print_meta: FIM PAD token = 151662 '<|fim_pad|>' llm_load_print_meta: FIM REP token = 151663 '<|repo_name|>' llm_load_print_meta: FIM SEP token = 151664 '<|file_sep|>' llm_load_print_meta: EOG token = 151643 '<|endoftext|>' llm_load_print_meta: EOG token = 151645 '<|im_end|>' llm_load_print_meta: EOG token = 151662 '<|fim_pad|>' llm_load_print_meta: EOG token = 151663 '<|repo_name|>' llm_load_print_meta: EOG token = 151664 '<|file_sep|>' llm_load_print_meta: max token length = 256 llm_load_tensors: offloading 64 repeating layers to GPU llm_load_tensors: offloading output layer to GPU llm_load_tensors: offloaded 65/65 layers to GPU llm_load_tensors: CPU model buffer size = 510.47 MiB llm_load_tensors: CUDA0 model buffer size = 20720.90 MiB llm_load_tensors: CUDA1 model buffer size = 947.45 MiB llama_new_context_with_model: n_seq_max = 1 llama_new_context_with_model: n_ctx = 40960 llama_new_context_with_model: n_ctx_per_seq = 40960 llama_new_context_with_model: n_batch = 512 llama_new_context_with_model: n_ubatch = 512 llama_new_context_with_model: flash_attn = 1 llama_new_context_with_model: freq_base = 1000000.0 llama_new_context_with_model: freq_scale = 1 llama_new_context_with_model: n_ctx_pre_seq (40960) > n_ctx_train (32768) -- possible training context overflow llama_kv_cache_init: kv_size = 40960, offload = 1, type_k = 'q8_0', type_v = 'q8_0', n_layer = 64, can_shift = 1 ggml_backend_cuda_buffer_type_alloc_buffer: allocating 5355.00 MiB on device 0: cudaMalloc failed: out of memory llama_kv_cache_init: failed to allocate buffer for kv cache llama_new_context_with_model: llama_kv_cache_init() failed for self-attention cache panic: unable to create llama context ``` ### Modelfile ``` FROM "./jp_calibration/Qwen2.5-32B-Instruct-q5_k_m-jp.gguf" PARAMETER temperature 0.7 PARAMETER top_k 20 PARAMETER top_p 0.8 PARAMETER num_ctx 40960 PARAMETER num_gpu 99 TEMPLATE """ {{- if .Messages }} {{- if or .System .Tools }}<|im_start|>system {{- if .System }} {{ .System }} {{- end }} {{- if .Tools }} # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> {{- range .Tools }} {"type": "function", "function": {{ .Function }}} {{- end }} </tools> For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags: <tool_call> {"name": <function-name>, "arguments": <args-json-object>} </tool_call> {{- end }}<|im_end|> {{ end }} {{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1 -}} {{- if eq .Role "user" }}<|im_start|>user {{ .Content }}<|im_end|> {{ else if eq .Role "assistant" }}<|im_start|>assistant {{ if .Content }}{{ .Content }} {{- else if .ToolCalls }}<tool_call> {{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}} {{ end }}</tool_call> {{- end }}{{ if not $last }}<|im_end|> {{ end }} {{- else if eq .Role "tool" }}<|im_start|>user <tool_response> {{ .Content }} </tool_response><|im_end|> {{ end }} {{- if and (ne .Role "assistant") $last }}<|im_start|>assistant {{ end }} {{- end }} {{- else }} {{- if .System }}<|im_start|>system {{ .System }}<|im_end|> {{ end }}{{ if .Prompt }}<|im_start|>user {{ .Prompt }}<|im_end|> {{ end }}<|im_start|>assistant {{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }} """ PARAMETER stop "<|im_start|>" PARAMETER stop "<|im_end|>" ``` ### Relevant log output ```shell Llama.cpp Log: (base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes error: invalid argument: .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf (base) PS C:\Users\sub01\Server\Storage\Qwen2.5-32B_Translate\jp_calibration> llama-cli.exe -m .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf -ngl 99 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes build: 4667 (d2fe216f) with MSVC 19.29.30158.0 for main: llama backend init main: load the model and apply lora adapter, if any llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from .\Qwen2.5-32B-Instruct-q5_k_s-jp.gguf (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.size_label str = 33B llama_model_loader: - kv 3: general.license str = apache-2.0 llama_model_loader: - kv 4: general.license.link str = https://huggingface.co/huihui-ai/Qwen... llama_model_loader: - kv 5: general.base_model.count u32 = 1 llama_model_loader: - kv 6: general.base_model.0.name str = Qwen2.5 32B Instruct llama_model_loader: - kv 7: general.base_model.0.organization str = Qwen llama_model_loader: - kv 8: general.base_model.0.repo_url str = https://huggingface.co/Qwen/Qwen2.5-3... llama_model_loader: - kv 9: general.tags arr[str,4] = ["chat", "abliterated", "uncensored",... llama_model_loader: - kv 10: general.languages arr[str,1] = ["en"] llama_model_loader: - kv 11: qwen2.block_count u32 = 64 llama_model_loader: - kv 12: qwen2.context_length u32 = 32768 llama_model_loader: - kv 13: qwen2.embedding_length u32 = 5120 llama_model_loader: - kv 14: qwen2.feed_forward_length u32 = 27648 llama_model_loader: - kv 15: qwen2.attention.head_count u32 = 40 llama_model_loader: - kv 16: qwen2.attention.head_count_kv u32 = 8 llama_model_loader: - kv 17: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 18: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001 llama_model_loader: - kv 19: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 20: tokenizer.ggml.pre str = qwen2 llama_model_loader: - kv 21: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 22: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 23: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 24: tokenizer.ggml.eos_token_id u32 = 151645 llama_model_loader: - kv 25: tokenizer.ggml.padding_token_id u32 = 151645 llama_model_loader: - kv 26: tokenizer.ggml.bos_token_id u32 = 151643 llama_model_loader: - kv 27: tokenizer.ggml.add_bos_token bool = false llama_model_loader: - kv 28: tokenizer.chat_template str = {%- if tools %}\n {{- '<|im_start|>... llama_model_loader: - kv 29: general.quantization_version u32 = 2 llama_model_loader: - kv 30: general.file_type u32 = 16 llama_model_loader: - kv 31: quantize.imatrix.file str = .\jp_calibration\imatrix.dat llama_model_loader: - kv 32: quantize.imatrix.dataset str = C:\Users\sub01\Server\Storage\QUANT_I... llama_model_loader: - kv 33: quantize.imatrix.entries_count i32 = 448 llama_model_loader: - kv 34: quantize.imatrix.chunks_count i32 = 727 llama_model_loader: - type f32: 321 tensors llama_model_loader: - type q5_K: 449 tensors llama_model_loader: - type q6_K: 1 tensors print_info: file format = GGUF V3 (latest) print_info: file type = Q5_K - Small print_info: file size = 21.08 GiB (5.53 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 = 5120 print_info: n_layer = 64 print_info: n_head = 40 print_info: n_head_kv = 8 print_info: n_rot = 128 print_info: n_swa = 0 print_info: n_embd_head_k = 128 print_info: n_embd_head_v = 128 print_info: n_gqa = 5 print_info: n_embd_k_gqa = 1024 print_info: n_embd_v_gqa = 1024 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: n_ff = 27648 print_info: n_expert = 0 print_info: n_expert_used = 0 print_info: causal attn = 1 print_info: pooling type = 0 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 = 32B print_info: model params = 32.76 B print_info: general.name = n/a 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 = 151645 '<|im_end|>' 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 = true) load_tensors: offloading 64 repeating layers to GPU load_tensors: offloading output layer to GPU load_tensors: offloaded 65/65 layers to GPU load_tensors: CUDA0 model buffer size = 15987.70 MiB load_tensors: CUDA1 model buffer size = 5085.66 MiB load_tensors: CPU_Mapped model buffer size = 510.47 MiB ................................................................................................. llama_init_from_model: n_seq_max = 1 llama_init_from_model: n_ctx = 4096 llama_init_from_model: n_ctx_per_seq = 4096 llama_init_from_model: n_batch = 2048 llama_init_from_model: n_ubatch = 512 llama_init_from_model: flash_attn = 0 llama_init_from_model: freq_base = 1000000.0 llama_init_from_model: freq_scale = 1 llama_init_from_model: n_ctx_per_seq (4096) < n_ctx_train (32768) -- the full capacity of the model will not be utilized llama_kv_cache_init: kv_size = 4096, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 64, can_shift = 1 llama_kv_cache_init: CUDA0 KV buffer size = 800.00 MiB llama_kv_cache_init: CUDA1 KV buffer size = 224.00 MiB llama_init_from_model: KV self size = 1024.00 MiB, K (f16): 512.00 MiB, V (f16): 512.00 MiB llama_init_from_model: CUDA_Host output buffer size = 0.58 MiB llama_init_from_model: pipeline parallelism enabled (n_copies=4) llama_init_from_model: CUDA0 compute buffer size = 432.01 MiB llama_init_from_model: CUDA1 compute buffer size = 432.02 MiB llama_init_from_model: CUDA_Host compute buffer size = 42.02 MiB llama_init_from_model: graph nodes = 2246 llama_init_from_model: graph splits = 3 common_init_from_params: setting dry_penalty_last_n to ctx_size = 4096 common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable) main: llama threadpool init, n_threads = 24 main: chat template is available, enabling conversation mode (disable it with -no-cnv) main: chat template example: <|im_start|>system You are a helpful assistant<|im_end|> <|im_start|>user Hello<|im_end|> <|im_start|>assistant Hi there<|im_end|> <|im_start|>user How are you?<|im_end|> <|im_start|>assistant system_info: n_threads = 24 (n_threads_batch = 24) / 32 | CUDA : ARCHS = 520,610,700,750 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 | main: interactive mode on. sampler seed: 1105860231 sampler params: repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.000 dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 4096 top_k = 40, top_p = 0.950, min_p = 0.050, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, temp = 0.800 mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000 sampler chain: logits -> logit-bias -> penalties -> dry -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist generate: n_ctx = 4096, n_batch = 2048, n_predict = -1, n_keep = 0 == Running in interactive mode. == - Press Ctrl+C to interject at any time. - Press Return to return control to the AI. - To return control without starting a new line, end your input with '/'. - If you want to submit another line, end your input with '\'. - Using default system message. To change it, set a different value via -p PROMPT or -f FILE argument. system You are a helpful assistant Ollama Log: (base) PS C:\Users\sub01> ollama serve 2025/02/10 00:41:06 routes.go:1187: INFO server config env="map[CUDA_VISIBLE_DEVICES:GPU-6a8f1072-ea32-0f5b-6750-34c854c28566,GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:true OLLAMA_GPU_OVERHEAD:536870912 OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:2562047h47m16.854775807s OLLAMA_KV_CACHE_TYPE:q8_0 OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:C:\\Users\\sub01\\Server\\ollama\\models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 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://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]" time=2025-02-10T00:41:06.438-05:00 level=INFO source=images.go:432 msg="total blobs: 29" time=2025-02-10T00:41:06.439-05:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0" time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1238 msg="Listening on [::]:11434 (version 0.5.7)" time=2025-02-10T00:41:06.441-05:00 level=INFO source=routes.go:1267 msg="Dynamic LLM libraries" runners="[cpu_avx2 cuda_v11_avx cuda_v12_avx rocm_avx cpu cpu_avx]" time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu.go:226 msg="looking for compatible GPUs" time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:167 msg=packages count=1 time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:183 msg="efficiency cores detected" maxEfficiencyClass=1 time=2025-02-10T00:41:06.441-05:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=24 efficiency=16 threads=32 time=2025-02-10T00:41:06.609-05:00 level=INFO source=gpu.go:334 msg="detected OS VRAM overhead" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" overhead="1020.0 MiB" time=2025-02-10T00:41:06.689-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-6a8f1072-ea32-0f5b-6750-34c854c28566 library=cuda variant=v12 compute=8.6 driver=12.8 name="NVIDIA GeForce RTX 3090" total="24.0 GiB" available="22.8 GiB" time=2025-02-10T00:41:06.690-05:00 level=INFO source=types.go:131 msg="inference compute" id=GPU-ebe144c7-8414-71f7-d3b4-74e447ca227c library=cuda variant=v12 compute=8.9 driver=12.8 name="NVIDIA GeForce RTX 4070 Laptop GPU" total="8.0 GiB" available="6.9 GiB" [GIN] 2025/02/10 - 00:41:19 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2025/02/10 - 00:41:19 | 200 | 73.6193ms | 127.0.0.1 | GET "/api/tags" [GIN] 2025/02/10 - 00:41:26 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2025/02/10 - 00:41:26 | 200 | 12.0953ms | 127.0.0.1 | POST "/api/show" time=2025-02-10T00:41:26.434-05:00 level=INFO source=server.go:104 msg="system memory" total="95.6 GiB" free="80.2 GiB" free_swap="92.4 GiB" time=2025-02-10T00:41:26.468-05:00 level=INFO source=memory.go:356 msg="offload to cuda" layers.requested=99 layers.model=65 layers.offload=45 layers.split=43,2 memory.available="[22.8 GiB 6.4 GiB]" memory.gpu_overhead="512.0 MiB" memory.required.full="36.0 GiB" memory.required.partial="27.6 GiB" memory.required.kv="5.0 GiB" memory.required.allocations="[22.0 GiB 5.7 GiB]" memory.weights.total="25.6 GiB" memory.weights.repeating="25.0 GiB" memory.weights.nonrepeating="609.1 MiB" memory.graph.full="4.0 GiB" memory.graph.partial="4.0 GiB" time=2025-02-10T00:41:26.469-05:00 level=INFO source=server.go:223 msg="enabling flash attention" time=2025-02-10T00:41:26.479-05:00 level=INFO source=server.go:376 msg="starting llama server" cmd="C:\\Users\\sub01\\AppData\\Local\\Programs\\Ollama\\lib\\ollama\\runners\\cuda_v12_avx\\ollama_llama_server.exe runner --model C:\\Users\\sub01\\Server\\ollama\\models\\blobs\\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d --ctx-size 40960 --batch-size 512 --n-gpu-layers 99 --threads 8 --flash-attn --kv-cache-type q8_0 --no-mmap --parallel 1 --tensor-split 43,2 --port 60489" time=2025-02-10T00:41:26.481-05:00 level=INFO source=sched.go:449 msg="loaded runners" count=1 time=2025-02-10T00:41:26.481-05:00 level=INFO source=server.go:555 msg="waiting for llama runner to start responding" time=2025-02-10T00:41:26.482-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server error" time=2025-02-10T00:41:26.564-05:00 level=INFO source=runner.go:936 msg="starting go runner" ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes Device 1: NVIDIA GeForce RTX 4070 Laptop GPU, compute capability 8.9, VMM: yes time=2025-02-10T00:41:26.652-05:00 level=INFO source=runner.go:937 msg=system info="CUDA : ARCHS = 600,610,620,700,720,750,800,860,870,890,900 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | LLAMAFILE = 1 | AARCH64_REPACK = 1 | cgo(clang)" threads=8 time=2025-02-10T00:41:26.652-05:00 level=INFO source=.:0 msg="Server listening on 127.0.0.1:60489" time=2025-02-10T00:41:26.733-05:00 level=INFO source=server.go:589 msg="waiting for server to become available" status="llm server loading model" llama_load_model_from_file: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free llama_load_model_from_file: using device CUDA1 (NVIDIA GeForce RTX 4070 Laptop GPU) - 7056 MiB free llama_model_loader: loaded meta data with 35 key-value pairs and 771 tensors from C:\Users\sub01\Server\ollama\models\blobs\sha256-85631d76aa0b3ca88d17ab3594ef7f93279082ac642196c9abf4f5725aa0d37d (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.size_label str = 33B llama_model_loader: - kv 3: general.license str = apache-2.0 llama_model_loader: - kv 4: general.license.link str = https://huggingface.co/huihui-ai/Qwen... llama_model_loader: - kv 5: general.base_model.count u32 = 1 llama_model_loader: - kv 6: general.base_model.0.name str = Qwen2.5 32B Instruct llama_model_loader: - kv 7: general.base_model.0.organization str = Qwen llama_model_loader: - kv 8: general.base_model.0.repo_url str = https://huggingface.co/Qwen/Qwen2.5-3... llama_model_loader: - kv 9: general.tags arr[str,4] = ["chat", "abliterated", "uncensored",... llama_model_loader: - kv 10: general.languages arr[str,1] = ["en"] llama_model_loader: - kv 11: qwen2.block_count u32 = 64 llama_model_loader: - kv 12: qwen2.context_length u32 = 32768 llama_model_loader: - kv 13: qwen2.embedding_length u32 = 5120 llama_model_loader: - kv 14: qwen2.feed_forward_length u32 = 27648 llama_model_loader: - kv 15: qwen2.attention.head_count u32 = 40 llama_model_loader: - kv 16: qwen2.attention.head_count_kv u32 = 8 llama_model_loader: - kv 17: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 18: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001 llama_model_loader: - kv 19: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 20: tokenizer.ggml.pre str = qwen2 llama_model_loader: - kv 21: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 22: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 23: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 24: tokenizer.ggml.eos_token_id u32 = 151645 llama_model_loader: - kv 25: tokenizer.ggml.padding_token_id u32 = 151645 llama_model_loader: - kv 26: tokenizer.ggml.bos_token_id u32 = 151643 llama_model_loader: - kv 27: tokenizer.ggml.add_bos_token bool = false llama_model_loader: - kv 28: tokenizer.chat_template str = {%- if tools %}\n {{- '<|im_start|>... llama_model_loader: - kv 29: general.quantization_version u32 = 2 llama_model_loader: - kv 30: general.file_type u32 = 17 llama_model_loader: - kv 31: quantize.imatrix.file str = .\jp_calibration\imatrix.dat llama_model_loader: - kv 32: quantize.imatrix.dataset str = C:\Users\sub01\Server\Storage\QUANT_I... llama_model_loader: - kv 33: quantize.imatrix.entries_count i32 = 448 llama_model_loader: - kv 34: quantize.imatrix.chunks_count i32 = 727 llama_model_loader: - type f32: 321 tensors llama_model_loader: - type q5_K: 385 tensors llama_model_loader: - type q6_K: 65 tensors llm_load_vocab: special tokens cache size = 22 llm_load_vocab: token to piece cache size = 0.9310 MB llm_load_print_meta: format = GGUF V3 (latest) llm_load_print_meta: arch = qwen2 llm_load_print_meta: vocab type = BPE llm_load_print_meta: n_vocab = 152064 llm_load_print_meta: n_merges = 151387 llm_load_print_meta: vocab_only = 0 llm_load_print_meta: n_ctx_train = 32768 llm_load_print_meta: n_embd = 5120 llm_load_print_meta: n_layer = 64 llm_load_print_meta: n_head = 40 llm_load_print_meta: n_head_kv = 8 llm_load_print_meta: n_rot = 128 llm_load_print_meta: n_swa = 0 llm_load_print_meta: n_embd_head_k = 128 llm_load_print_meta: n_embd_head_v = 128 llm_load_print_meta: n_gqa = 5 llm_load_print_meta: n_embd_k_gqa = 1024 llm_load_print_meta: n_embd_v_gqa = 1024 llm_load_print_meta: f_norm_eps = 0.0e+00 llm_load_print_meta: f_norm_rms_eps = 1.0e-06 llm_load_print_meta: f_clamp_kqv = 0.0e+00 llm_load_print_meta: f_max_alibi_bias = 0.0e+00 llm_load_print_meta: f_logit_scale = 0.0e+00 llm_load_print_meta: n_ff = 27648 llm_load_print_meta: n_expert = 0 llm_load_print_meta: n_expert_used = 0 llm_load_print_meta: causal attn = 1 llm_load_print_meta: pooling type = 0 llm_load_print_meta: rope type = 2 llm_load_print_meta: rope scaling = linear llm_load_print_meta: freq_base_train = 1000000.0 llm_load_print_meta: freq_scale_train = 1 llm_load_print_meta: n_ctx_orig_yarn = 32768 llm_load_print_meta: rope_finetuned = unknown llm_load_print_meta: ssm_d_conv = 0 llm_load_print_meta: ssm_d_inner = 0 llm_load_print_meta: ssm_d_state = 0 llm_load_print_meta: ssm_dt_rank = 0 llm_load_print_meta: ssm_dt_b_c_rms = 0 llm_load_print_meta: model type = 32B llm_load_print_meta: model ftype = Q5_K - Medium llm_load_print_meta: model params = 32.76 B llm_load_print_meta: model size = 21.66 GiB (5.68 BPW) llm_load_print_meta: general.name = n/a llm_load_print_meta: BOS token = 151643 '<|endoftext|>' llm_load_print_meta: EOS token = 151645 '<|im_end|>' llm_load_print_meta: EOT token = 151645 '<|im_end|>' llm_load_print_meta: PAD token = 151645 '<|im_end|>' llm_load_print_meta: LF token = 148848 'ÄĬ' llm_load_print_meta: FIM PRE token = 151659 '<|fim_prefix|>' llm_load_print_meta: FIM SUF token = 151661 '<|fim_suffix|>' llm_load_print_meta: FIM MID token = 151660 '<|fim_middle|>' llm_load_print_meta: FIM PAD token = 151662 '<|fim_pad|>' llm_load_print_meta: FIM REP token = 151663 '<|repo_name|>' llm_load_print_meta: FIM SEP token = 151664 '<|file_sep|>' llm_load_print_meta: EOG token = 151643 '<|endoftext|>' llm_load_print_meta: EOG token = 151645 '<|im_end|>' llm_load_print_meta: EOG token = 151662 '<|fim_pad|>' llm_load_print_meta: EOG token = 151663 '<|repo_name|>' llm_load_print_meta: EOG token = 151664 '<|file_sep|>' llm_load_print_meta: max token length = 256 llm_load_tensors: offloading 64 repeating layers to GPU llm_load_tensors: offloading output layer to GPU llm_load_tensors: offloaded 65/65 layers to GPU llm_load_tensors: CPU model buffer size = 510.47 MiB llm_load_tensors: CUDA0 model buffer size = 20720.90 MiB llm_load_tensors: CUDA1 model buffer size = 947.45 MiB llama_new_context_with_model: n_seq_max = 1 llama_new_context_with_model: n_ctx = 40960 llama_new_context_with_model: n_ctx_per_seq = 40960 llama_new_context_with_model: n_batch = 512 llama_new_context_with_model: n_ubatch = 512 llama_new_context_with_model: flash_attn = 1 llama_new_context_with_model: freq_base = 1000000.0 llama_new_context_with_model: freq_scale = 1 llama_new_context_with_model: n_ctx_pre_seq (40960) > n_ctx_train (32768) -- possible training context overflow llama_kv_cache_init: kv_size = 40960, offload = 1, type_k = 'q8_0', type_v = 'q8_0', n_layer = 64, can_shift = 1 ggml_backend_cuda_buffer_type_alloc_buffer: allocating 5355.00 MiB on device 0: cudaMalloc failed: out of memory llama_kv_cache_init: failed to allocate buffer for kv cache llama_new_context_with_model: llama_kv_cache_init() failed for self-attention cache panic: unable to create llama context ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-12 17:10:33 -05:00
Author
Owner

@rick-github commented on GitHub (Feb 10, 2025):

You are requesting a lot more VRAM with ollama than llama.cpp because the context size is different: 4k for llama.cpp, 40k for ollama.

<!-- gh-comment-id:2647525376 --> @rick-github commented on GitHub (Feb 10, 2025): You are requesting a lot more VRAM with ollama than llama.cpp because the context size is different: 4k for llama.cpp, 40k for ollama.
Author
Owner

@Sub0X commented on GitHub (Feb 10, 2025):

Got it! Thank you! Forgot that I had an extra 0 inside!

<!-- gh-comment-id:2648623995 --> @Sub0X commented on GitHub (Feb 10, 2025): Got it! Thank you! Forgot that I had an extra 0 inside!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5832