[GH-ISSUE #9129] ollama do not use all my gpus. #67994

Closed
opened 2026-05-04 12:13:36 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @l00n00l on GitHub (Feb 15, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9129

What is the issue?

My gpus

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.01              Driver Version: 565.57.01      CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  Tesla P40                      Off |   00000000:01:00.0 Off |                  Off |
| N/A   32C    P0             54W /  250W |   23151MiB /  24576MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  Tesla M40 24GB                 Off |   00000000:04:00.0 Off |                  Off |
| N/A   37C    P8             15W /  250W |       7MiB /  24576MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

My serve commond

OLLAMA_SCHED_SPREAD=1 CUDA_VISIBLE_DEVICES=0,1 ollama serve

My run command

ollama run deepseek-r1:70b

The output log

2025/02/15 16:07:41 routes.go:1186: INFO server config env="map[CUDA_VISIBLE_DEVICES:0,1 GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/media/aaa/data/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:true ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]"
time=2025-02-15T16:07:41.156+08:00 level=INFO source=images.go:432 msg="total blobs: 22"
time=2025-02-15T16:07:41.156+08:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0"
time=2025-02-15T16:07:41.156+08:00 level=INFO source=routes.go:1237 msg="Listening on 127.0.0.1:11434 (version 0.5.10)"
time=2025-02-15T16:07:41.156+08:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs"
time=2025-02-15T16:07:41.366+08:00 level=WARN source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory"
time=2025-02-15T16:07:41.366+08:00 level=INFO source=amd_linux.go:296 msg="unsupported Radeon iGPU detected skipping" id=0 total="512.0 MiB"
time=2025-02-15T16:07:41.366+08:00 level=INFO source=amd_linux.go:402 msg="no compatible amdgpu devices detected"
time=2025-02-15T16:07:41.366+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-3bb8d0f1-7fbd-75ee-1589-b2d6866f8fae library=cuda variant=v12 compute=6.1 driver=12.7 name="Tesla P40" total="23.9 GiB" available="23.7 GiB"
time=2025-02-15T16:07:41.366+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-01a87dbe-0079-88b7-2a43-5d879a6ef155 library=cuda variant=v11 compute=5.2 driver=12.7 name="Tesla M40 24GB" total="23.9 GiB" available="23.8 GiB"
[GIN] 2025/02/15 - 16:08:33 | 200 |       39.98µs |       127.0.0.1 | HEAD     "/"
[GIN] 2025/02/15 - 16:08:33 | 200 |    14.85932ms |       127.0.0.1 | POST     "/api/show"
time=2025-02-15T16:08:34.221+08:00 level=INFO source=server.go:100 msg="system memory" total="93.6 GiB" free="88.2 GiB" free_swap="15.7 GiB"
time=2025-02-15T16:08:34.222+08:00 level=INFO source=memory.go:356 msg="offload to cuda" layers.requested=-1 layers.model=81 layers.offload=44 layers.split="" memory.available="[23.7 GiB]" memory.gpu_overhead="0 B" memory.required.full="42.7 GiB" memory.required.partial="23.4 GiB" memory.required.kv="640.0 MiB" memory.required.allocations="[23.4 GiB]" memory.weights.total="38.9 GiB" memory.weights.repeating="38.1 GiB" memory.weights.nonrepeating="822.0 MiB" memory.graph.full="324.0 MiB" memory.graph.partial="1.1 GiB"
time=2025-02-15T16:08:34.223+08:00 level=INFO source=server.go:381 msg="starting llama server" cmd="/usr/local/bin/ollama runner --model /media/aaa/data/ollama_models/blobs/sha256-4cd576d9aa16961244012223abf01445567b061f1814b57dfef699e4cf8df339 --ctx-size 2048 --batch-size 512 --n-gpu-layers 44 --threads 8 --parallel 1 --port 45131"
time=2025-02-15T16:08:34.223+08:00 level=INFO source=sched.go:449 msg="loaded runners" count=1
time=2025-02-15T16:08:34.223+08:00 level=INFO source=server.go:558 msg="waiting for llama runner to start responding"
time=2025-02-15T16:08:34.223+08:00 level=INFO source=server.go:592 msg="waiting for server to become available" status="llm server error"
time=2025-02-15T16:08:34.234+08:00 level=INFO source=runner.go:936 msg="starting go runner"
time=2025-02-15T16:08:34.234+08:00 level=INFO source=runner.go:937 msg=system info="CPU : LLAMAFILE = 1 | CPU : LLAMAFILE = 1 | cgo(gcc)" threads=8
time=2025-02-15T16:08:34.234+08:00 level=INFO source=runner.go:995 msg="Server listening on 127.0.0.1:45131"
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
  Device 0: Tesla P40, compute capability 6.1, VMM: yes
load_backend: loaded CUDA backend from /usr/local/lib/ollama/cuda_v12/libggml-cuda.so
load_backend: loaded CPU backend from /usr/local/lib/ollama/libggml-cpu-haswell.so
llama_load_model_from_file: using device CUDA0 (Tesla P40) - 24286 MiB free
llama_model_loader: loaded meta data with 30 key-value pairs and 724 tensors from /media/aaa/data/ollama_models/blobs/sha256-4cd576d9aa16961244012223abf01445567b061f1814b57dfef699e4cf8df339 (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              = llama
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = DeepSeek R1 Distill Llama 70B
llama_model_loader: - kv   3:                           general.basename str              = DeepSeek-R1-Distill-Llama
llama_model_loader: - kv   4:                         general.size_label str              = 70B
llama_model_loader: - kv   5:                          llama.block_count u32              = 80
llama_model_loader: - kv   6:                       llama.context_length u32              = 131072
llama_model_loader: - kv   7:                     llama.embedding_length u32              = 8192
llama_model_loader: - kv   8:                  llama.feed_forward_length u32              = 28672
llama_model_loader: - kv   9:                 llama.attention.head_count u32              = 64
llama_model_loader: - kv  10:              llama.attention.head_count_kv u32              = 8
llama_model_loader: - kv  11:                       llama.rope.freq_base f32              = 500000.000000
llama_model_loader: - kv  12:     llama.attention.layer_norm_rms_epsilon f32              = 0.000010
llama_model_loader: - kv  13:                 llama.attention.key_length u32              = 128
llama_model_loader: - kv  14:               llama.attention.value_length u32              = 128
llama_model_loader: - kv  15:                          general.file_type u32              = 15
llama_model_loader: - kv  16:                           llama.vocab_size u32              = 128256
llama_model_loader: - kv  17:                 llama.rope.dimension_count u32              = 128
llama_model_loader: - kv  18:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  19:                         tokenizer.ggml.pre str              = llama-bpe
llama_model_loader: - kv  20:                      tokenizer.ggml.tokens arr[str,128256]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  21:                  tokenizer.ggml.token_type arr[i32,128256]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  22:                      tokenizer.ggml.merges arr[str,280147]  = ["Ġ Ġ", "Ġ ĠĠĠ", "ĠĠ ĠĠ", "...
llama_model_loader: - kv  23:                tokenizer.ggml.bos_token_id u32              = 128000
llama_model_loader: - kv  24:                tokenizer.ggml.eos_token_id u32              = 128001
llama_model_loader: - kv  25:            tokenizer.ggml.padding_token_id u32              = 128001
llama_model_loader: - kv  26:               tokenizer.ggml.add_bos_token bool             = true
llama_model_loader: - kv  27:               tokenizer.ggml.add_eos_token bool             = false
llama_model_loader: - kv  28:                    tokenizer.chat_template str              = {% if not add_generation_prompt is de...
llama_model_loader: - kv  29:               general.quantization_version u32              = 2
llama_model_loader: - type  f32:  162 tensors
llama_model_loader: - type q4_K:  441 tensors
llama_model_loader: - type q5_K:   40 tensors
llama_model_loader: - type q6_K:   81 tensors
time=2025-02-15T16:08:34.474+08:00 level=INFO source=server.go:592 msg="waiting for server to become available" status="llm server loading model"
llm_load_vocab: special_eos_id is not in special_eog_ids - the tokenizer config may be incorrect
llm_load_vocab: special tokens cache size = 256
llm_load_vocab: token to piece cache size = 0.7999 MB
llm_load_print_meta: format           = GGUF V3 (latest)
llm_load_print_meta: arch             = llama
llm_load_print_meta: vocab type       = BPE
llm_load_print_meta: n_vocab          = 128256
llm_load_print_meta: n_merges         = 280147
llm_load_print_meta: vocab_only       = 0
llm_load_print_meta: n_ctx_train      = 131072
llm_load_print_meta: n_embd           = 8192
llm_load_print_meta: n_layer          = 80
llm_load_print_meta: n_head           = 64
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            = 8
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-05
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             = 28672
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        = 0
llm_load_print_meta: rope scaling     = linear
llm_load_print_meta: freq_base_train  = 500000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn  = 131072
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       = 70B
llm_load_print_meta: model ftype      = Q4_K - Medium
llm_load_print_meta: model params     = 70.55 B
llm_load_print_meta: model size       = 39.59 GiB (4.82 BPW) 
llm_load_print_meta: general.name     = DeepSeek R1 Distill Llama 70B
llm_load_print_meta: BOS token        = 128000 '<|begin▁of▁sentence|>'
llm_load_print_meta: EOS token        = 128001 '<|end▁of▁sentence|>'
llm_load_print_meta: EOT token        = 128009 '<|eot_id|>'
llm_load_print_meta: EOM token        = 128008 '<|eom_id|>'
llm_load_print_meta: PAD token        = 128001 '<|end▁of▁sentence|>'
llm_load_print_meta: LF token         = 128 'Ä'
llm_load_print_meta: EOG token        = 128001 '<|end▁of▁sentence|>'
llm_load_print_meta: EOG token        = 128008 '<|eom_id|>'
llm_load_print_meta: EOG token        = 128009 '<|eot_id|>'
llm_load_print_meta: max token length = 256
llm_load_tensors: offloading 44 repeating layers to GPU
llm_load_tensors: offloaded 44/81 layers to GPU
llm_load_tensors:        CUDA0 model buffer size = 21536.63 MiB
llm_load_tensors:   CPU_Mapped model buffer size = 19006.48 MiB
llama_new_context_with_model: n_seq_max     = 1
llama_new_context_with_model: n_ctx         = 2048
llama_new_context_with_model: n_ctx_per_seq = 2048
llama_new_context_with_model: n_batch       = 512
llama_new_context_with_model: n_ubatch      = 512
llama_new_context_with_model: flash_attn    = 0
llama_new_context_with_model: freq_base     = 500000.0
llama_new_context_with_model: freq_scale    = 1
llama_new_context_with_model: n_ctx_per_seq (2048) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
llama_kv_cache_init: kv_size = 2048, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 80, can_shift = 1
llama_kv_cache_init:      CUDA0 KV buffer size =   352.00 MiB
llama_kv_cache_init:        CPU KV buffer size =   288.00 MiB
llama_new_context_with_model: KV self size  =  640.00 MiB, K (f16):  320.00 MiB, V (f16):  320.00 MiB
llama_new_context_with_model:        CPU  output buffer size =     0.52 MiB
llama_new_context_with_model:      CUDA0 compute buffer size =  1088.45 MiB
llama_new_context_with_model:  CUDA_Host compute buffer size =    20.01 MiB
llama_new_context_with_model: graph nodes  = 2566
llama_new_context_with_model: graph splits = 401 (with bs=512), 3 (with bs=1)
time=2025-02-15T16:08:41.752+08:00 level=INFO source=server.go:597 msg="llama runner started in 7.53 seconds"
[GIN] 2025/02/15 - 16:08:41 | 200 |   7.89437029s |       127.0.0.1 | POST     "/api/generate"```

### Relevant log output

```shell

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.5.11

Originally created by @l00n00l on GitHub (Feb 15, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9129 ### What is the issue? My gpus ``` +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 565.57.01 Driver Version: 565.57.01 CUDA Version: 12.7 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 Tesla P40 Off | 00000000:01:00.0 Off | Off | | N/A 32C P0 54W / 250W | 23151MiB / 24576MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ | 1 Tesla M40 24GB Off | 00000000:04:00.0 Off | Off | | N/A 37C P8 15W / 250W | 7MiB / 24576MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ ``` My serve commond ``` OLLAMA_SCHED_SPREAD=1 CUDA_VISIBLE_DEVICES=0,1 ollama serve ``` My run command ``` ollama run deepseek-r1:70b ``` The output log ``` 2025/02/15 16:07:41 routes.go:1186: INFO server config env="map[CUDA_VISIBLE_DEVICES:0,1 GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/media/aaa/data/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:true ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]" time=2025-02-15T16:07:41.156+08:00 level=INFO source=images.go:432 msg="total blobs: 22" time=2025-02-15T16:07:41.156+08:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0" time=2025-02-15T16:07:41.156+08:00 level=INFO source=routes.go:1237 msg="Listening on 127.0.0.1:11434 (version 0.5.10)" time=2025-02-15T16:07:41.156+08:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs" time=2025-02-15T16:07:41.366+08:00 level=WARN source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory" time=2025-02-15T16:07:41.366+08:00 level=INFO source=amd_linux.go:296 msg="unsupported Radeon iGPU detected skipping" id=0 total="512.0 MiB" time=2025-02-15T16:07:41.366+08:00 level=INFO source=amd_linux.go:402 msg="no compatible amdgpu devices detected" time=2025-02-15T16:07:41.366+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-3bb8d0f1-7fbd-75ee-1589-b2d6866f8fae library=cuda variant=v12 compute=6.1 driver=12.7 name="Tesla P40" total="23.9 GiB" available="23.7 GiB" time=2025-02-15T16:07:41.366+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-01a87dbe-0079-88b7-2a43-5d879a6ef155 library=cuda variant=v11 compute=5.2 driver=12.7 name="Tesla M40 24GB" total="23.9 GiB" available="23.8 GiB" [GIN] 2025/02/15 - 16:08:33 | 200 | 39.98µs | 127.0.0.1 | HEAD "/" [GIN] 2025/02/15 - 16:08:33 | 200 | 14.85932ms | 127.0.0.1 | POST "/api/show" time=2025-02-15T16:08:34.221+08:00 level=INFO source=server.go:100 msg="system memory" total="93.6 GiB" free="88.2 GiB" free_swap="15.7 GiB" time=2025-02-15T16:08:34.222+08:00 level=INFO source=memory.go:356 msg="offload to cuda" layers.requested=-1 layers.model=81 layers.offload=44 layers.split="" memory.available="[23.7 GiB]" memory.gpu_overhead="0 B" memory.required.full="42.7 GiB" memory.required.partial="23.4 GiB" memory.required.kv="640.0 MiB" memory.required.allocations="[23.4 GiB]" memory.weights.total="38.9 GiB" memory.weights.repeating="38.1 GiB" memory.weights.nonrepeating="822.0 MiB" memory.graph.full="324.0 MiB" memory.graph.partial="1.1 GiB" time=2025-02-15T16:08:34.223+08:00 level=INFO source=server.go:381 msg="starting llama server" cmd="/usr/local/bin/ollama runner --model /media/aaa/data/ollama_models/blobs/sha256-4cd576d9aa16961244012223abf01445567b061f1814b57dfef699e4cf8df339 --ctx-size 2048 --batch-size 512 --n-gpu-layers 44 --threads 8 --parallel 1 --port 45131" time=2025-02-15T16:08:34.223+08:00 level=INFO source=sched.go:449 msg="loaded runners" count=1 time=2025-02-15T16:08:34.223+08:00 level=INFO source=server.go:558 msg="waiting for llama runner to start responding" time=2025-02-15T16:08:34.223+08:00 level=INFO source=server.go:592 msg="waiting for server to become available" status="llm server error" time=2025-02-15T16:08:34.234+08:00 level=INFO source=runner.go:936 msg="starting go runner" time=2025-02-15T16:08:34.234+08:00 level=INFO source=runner.go:937 msg=system info="CPU : LLAMAFILE = 1 | CPU : LLAMAFILE = 1 | cgo(gcc)" threads=8 time=2025-02-15T16:08:34.234+08:00 level=INFO source=runner.go:995 msg="Server listening on 127.0.0.1:45131" ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 1 CUDA devices: Device 0: Tesla P40, compute capability 6.1, VMM: yes load_backend: loaded CUDA backend from /usr/local/lib/ollama/cuda_v12/libggml-cuda.so load_backend: loaded CPU backend from /usr/local/lib/ollama/libggml-cpu-haswell.so llama_load_model_from_file: using device CUDA0 (Tesla P40) - 24286 MiB free llama_model_loader: loaded meta data with 30 key-value pairs and 724 tensors from /media/aaa/data/ollama_models/blobs/sha256-4cd576d9aa16961244012223abf01445567b061f1814b57dfef699e4cf8df339 (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 = llama llama_model_loader: - kv 1: general.type str = model llama_model_loader: - kv 2: general.name str = DeepSeek R1 Distill Llama 70B llama_model_loader: - kv 3: general.basename str = DeepSeek-R1-Distill-Llama llama_model_loader: - kv 4: general.size_label str = 70B llama_model_loader: - kv 5: llama.block_count u32 = 80 llama_model_loader: - kv 6: llama.context_length u32 = 131072 llama_model_loader: - kv 7: llama.embedding_length u32 = 8192 llama_model_loader: - kv 8: llama.feed_forward_length u32 = 28672 llama_model_loader: - kv 9: llama.attention.head_count u32 = 64 llama_model_loader: - kv 10: llama.attention.head_count_kv u32 = 8 llama_model_loader: - kv 11: llama.rope.freq_base f32 = 500000.000000 llama_model_loader: - kv 12: llama.attention.layer_norm_rms_epsilon f32 = 0.000010 llama_model_loader: - kv 13: llama.attention.key_length u32 = 128 llama_model_loader: - kv 14: llama.attention.value_length u32 = 128 llama_model_loader: - kv 15: general.file_type u32 = 15 llama_model_loader: - kv 16: llama.vocab_size u32 = 128256 llama_model_loader: - kv 17: llama.rope.dimension_count u32 = 128 llama_model_loader: - kv 18: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 19: tokenizer.ggml.pre str = llama-bpe llama_model_loader: - kv 20: tokenizer.ggml.tokens arr[str,128256] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 21: tokenizer.ggml.token_type arr[i32,128256] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 22: tokenizer.ggml.merges arr[str,280147] = ["Ġ Ġ", "Ġ ĠĠĠ", "ĠĠ ĠĠ", "... llama_model_loader: - kv 23: tokenizer.ggml.bos_token_id u32 = 128000 llama_model_loader: - kv 24: tokenizer.ggml.eos_token_id u32 = 128001 llama_model_loader: - kv 25: tokenizer.ggml.padding_token_id u32 = 128001 llama_model_loader: - kv 26: tokenizer.ggml.add_bos_token bool = true llama_model_loader: - kv 27: tokenizer.ggml.add_eos_token bool = false llama_model_loader: - kv 28: tokenizer.chat_template str = {% if not add_generation_prompt is de... llama_model_loader: - kv 29: general.quantization_version u32 = 2 llama_model_loader: - type f32: 162 tensors llama_model_loader: - type q4_K: 441 tensors llama_model_loader: - type q5_K: 40 tensors llama_model_loader: - type q6_K: 81 tensors time=2025-02-15T16:08:34.474+08:00 level=INFO source=server.go:592 msg="waiting for server to become available" status="llm server loading model" llm_load_vocab: special_eos_id is not in special_eog_ids - the tokenizer config may be incorrect llm_load_vocab: special tokens cache size = 256 llm_load_vocab: token to piece cache size = 0.7999 MB llm_load_print_meta: format = GGUF V3 (latest) llm_load_print_meta: arch = llama llm_load_print_meta: vocab type = BPE llm_load_print_meta: n_vocab = 128256 llm_load_print_meta: n_merges = 280147 llm_load_print_meta: vocab_only = 0 llm_load_print_meta: n_ctx_train = 131072 llm_load_print_meta: n_embd = 8192 llm_load_print_meta: n_layer = 80 llm_load_print_meta: n_head = 64 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 = 8 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-05 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 = 28672 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 = 0 llm_load_print_meta: rope scaling = linear llm_load_print_meta: freq_base_train = 500000.0 llm_load_print_meta: freq_scale_train = 1 llm_load_print_meta: n_ctx_orig_yarn = 131072 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 = 70B llm_load_print_meta: model ftype = Q4_K - Medium llm_load_print_meta: model params = 70.55 B llm_load_print_meta: model size = 39.59 GiB (4.82 BPW) llm_load_print_meta: general.name = DeepSeek R1 Distill Llama 70B llm_load_print_meta: BOS token = 128000 '<|begin▁of▁sentence|>' llm_load_print_meta: EOS token = 128001 '<|end▁of▁sentence|>' llm_load_print_meta: EOT token = 128009 '<|eot_id|>' llm_load_print_meta: EOM token = 128008 '<|eom_id|>' llm_load_print_meta: PAD token = 128001 '<|end▁of▁sentence|>' llm_load_print_meta: LF token = 128 'Ä' llm_load_print_meta: EOG token = 128001 '<|end▁of▁sentence|>' llm_load_print_meta: EOG token = 128008 '<|eom_id|>' llm_load_print_meta: EOG token = 128009 '<|eot_id|>' llm_load_print_meta: max token length = 256 llm_load_tensors: offloading 44 repeating layers to GPU llm_load_tensors: offloaded 44/81 layers to GPU llm_load_tensors: CUDA0 model buffer size = 21536.63 MiB llm_load_tensors: CPU_Mapped model buffer size = 19006.48 MiB llama_new_context_with_model: n_seq_max = 1 llama_new_context_with_model: n_ctx = 2048 llama_new_context_with_model: n_ctx_per_seq = 2048 llama_new_context_with_model: n_batch = 512 llama_new_context_with_model: n_ubatch = 512 llama_new_context_with_model: flash_attn = 0 llama_new_context_with_model: freq_base = 500000.0 llama_new_context_with_model: freq_scale = 1 llama_new_context_with_model: n_ctx_per_seq (2048) < n_ctx_train (131072) -- the full capacity of the model will not be utilized llama_kv_cache_init: kv_size = 2048, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 80, can_shift = 1 llama_kv_cache_init: CUDA0 KV buffer size = 352.00 MiB llama_kv_cache_init: CPU KV buffer size = 288.00 MiB llama_new_context_with_model: KV self size = 640.00 MiB, K (f16): 320.00 MiB, V (f16): 320.00 MiB llama_new_context_with_model: CPU output buffer size = 0.52 MiB llama_new_context_with_model: CUDA0 compute buffer size = 1088.45 MiB llama_new_context_with_model: CUDA_Host compute buffer size = 20.01 MiB llama_new_context_with_model: graph nodes = 2566 llama_new_context_with_model: graph splits = 401 (with bs=512), 3 (with bs=1) time=2025-02-15T16:08:41.752+08:00 level=INFO source=server.go:597 msg="llama runner started in 7.53 seconds" [GIN] 2025/02/15 - 16:08:41 | 200 | 7.89437029s | 127.0.0.1 | POST "/api/generate"``` ### Relevant log output ```shell ``` ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.5.11
GiteaMirror added the bug label 2026-05-04 12:13:36 -05:00
Author
Owner

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

The M40 has a compute capacity of 5.2 which is currently not supported in cuda_v12 runner, #8567 may fix that. In the meantime you can try setting OLLAMA_LLM_LIBRARY=cuda_v11 in the server environment to see if that will use both cards.

<!-- gh-comment-id:2660892872 --> @rick-github commented on GitHub (Feb 15, 2025): The M40 has a compute capacity of 5.2 which is currently not supported in cuda_v12 runner, #8567 may fix that. In the meantime you can try setting `OLLAMA_LLM_LIBRARY=cuda_v11` in the server environment to see if that will use both cards.
Author
Owner

@l00n00l commented on GitHub (Feb 16, 2025):

[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=/media/aaa/data/softs/miniconda3/bin:/media/aaa/data/softs/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin"
Environment="CUDA_VISIBLE_DEVICES=1,0"
Environment="OLLAMA_SCHED_SPREAD=1"
Environment="OLLAMA_LLM_LIBRARY=cuda_v11"
Environment="OLLAMA_MODELS=/media/aaa/data/ollama_models"
[Install]
WantedBy=default.target

I added OLLAMA_llibrary=cuda_v11 to the environment, but it didn't work.

<!-- gh-comment-id:2661185749 --> @l00n00l commented on GitHub (Feb 16, 2025): ``` [Unit] Description=Ollama Service After=network-online.target [Service] ExecStart=/usr/local/bin/ollama serve User=ollama Group=ollama Restart=always RestartSec=3 Environment="PATH=/media/aaa/data/softs/miniconda3/bin:/media/aaa/data/softs/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin" Environment="CUDA_VISIBLE_DEVICES=1,0" Environment="OLLAMA_SCHED_SPREAD=1" Environment="OLLAMA_LLM_LIBRARY=cuda_v11" Environment="OLLAMA_MODELS=/media/aaa/data/ollama_models" [Install] WantedBy=default.target ``` I added `OLLAMA_llibrary=cuda_v11` to the environment, but it didn't work.
Author
Owner

@AmberHan commented on GitHub (Jul 14, 2025):

have fix it?

<!-- gh-comment-id:3068645531 --> @AmberHan commented on GitHub (Jul 14, 2025): have fix it?
Author
Owner

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

#8567 has been merged so presumably yes, fixed.

<!-- gh-comment-id:3068658734 --> @rick-github commented on GitHub (Jul 14, 2025): #8567 has been merged so presumably yes, fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#67994