[GH-ISSUE #4284] Multiple GPU allocate compute buffer error #80357

Closed
opened 2026-05-09 08:46:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @cashlo on GitHub (May 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4284

What is the issue?

I have a 3090 ti and a 1070, when I try to run llama3:70b-instruct-q3_K_S
I got this error

ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090 Ti, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce GTX 1070, compute capability 6.1, VMM: yes
llm_load_tensors: ggml ctx size =    1.10 MiB
llm_load_tensors: offloading 80 repeating layers to GPU
llm_load_tensors: offloading non-repeating layers to GPU
llm_load_tensors: offloaded 81/81 layers to GPU
llm_load_tensors:        CPU buffer size =   430.55 MiB
llm_load_tensors:      CUDA0 buffer size = 21517.75 MiB
llm_load_tensors:      CUDA1 buffer size =  7524.23 MiB
..................................................................................................
llama_new_context_with_model: n_ctx      = 2048
llama_new_context_with_model: n_batch    = 512
llama_new_context_with_model: n_ubatch   = 512
llama_new_context_with_model: freq_base  = 500000.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init:      CUDA0 KV buffer size =   488.00 MiB
llama_kv_cache_init:      CUDA1 KV buffer size =   152.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:  CUDA_Host  output buffer size =     0.52 MiB
llama_new_context_with_model: pipeline parallelism enabled (n_copies=4)
ggml_backend_cuda_buffer_type_alloc_buffer: allocating 400.02 MiB on device 1: cudaMalloc failed: out of memory
ggml_gallocr_reserve_n: failed to allocate CUDA1 buffer of size 419446784
llama_new_context_with_model: failed to allocate compute buffers
llama_init_from_gpt_params: error: failed to create context with model '/home/cashlo/.ollama/models/blobs/sha256-fa8b357d6f63d2f2415ff3c3c903cde370728ccd8a86a5ee2f18117815fe2f72'
{"function":"load_model","level":"ERR","line":410,"model":"/home/cashlo/.ollama/models/blobs/sha256-fa8b357d6f63d2f2415ff3c3c903cde370728ccd8a86a5ee2f18117815fe2f72","msg":"unable to load model","tid":"139979899854848","timestamp":1715253376}
time=2024-05-09T20:23:34.811+09:00 level=ERROR source=sched.go:332 msg="error loading llama server" error="timed out waiting for llama runner to start: error:failed to create context with model '/home/cashlo/.ollama/models/blobs/sha256-fa8b357d6f63d2f2415ff3c3c903cde370728ccd8a86a5ee2f18117815fe2f72'"

the model works when I uplug the 1070, or if I use a model file to set num_gpu to 80

OS

Linux

GPU

Nvidia

CPU

No response

Ollama version

0.1.34

Originally created by @cashlo on GitHub (May 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4284 ### What is the issue? I have a 3090 ti and a 1070, when I try to run llama3:70b-instruct-q3_K_S I got this error ``` ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 3090 Ti, compute capability 8.6, VMM: yes Device 1: NVIDIA GeForce GTX 1070, compute capability 6.1, VMM: yes llm_load_tensors: ggml ctx size = 1.10 MiB llm_load_tensors: offloading 80 repeating layers to GPU llm_load_tensors: offloading non-repeating layers to GPU llm_load_tensors: offloaded 81/81 layers to GPU llm_load_tensors: CPU buffer size = 430.55 MiB llm_load_tensors: CUDA0 buffer size = 21517.75 MiB llm_load_tensors: CUDA1 buffer size = 7524.23 MiB .................................................................................................. llama_new_context_with_model: n_ctx = 2048 llama_new_context_with_model: n_batch = 512 llama_new_context_with_model: n_ubatch = 512 llama_new_context_with_model: freq_base = 500000.0 llama_new_context_with_model: freq_scale = 1 llama_kv_cache_init: CUDA0 KV buffer size = 488.00 MiB llama_kv_cache_init: CUDA1 KV buffer size = 152.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: CUDA_Host output buffer size = 0.52 MiB llama_new_context_with_model: pipeline parallelism enabled (n_copies=4) ggml_backend_cuda_buffer_type_alloc_buffer: allocating 400.02 MiB on device 1: cudaMalloc failed: out of memory ggml_gallocr_reserve_n: failed to allocate CUDA1 buffer of size 419446784 llama_new_context_with_model: failed to allocate compute buffers llama_init_from_gpt_params: error: failed to create context with model '/home/cashlo/.ollama/models/blobs/sha256-fa8b357d6f63d2f2415ff3c3c903cde370728ccd8a86a5ee2f18117815fe2f72' {"function":"load_model","level":"ERR","line":410,"model":"/home/cashlo/.ollama/models/blobs/sha256-fa8b357d6f63d2f2415ff3c3c903cde370728ccd8a86a5ee2f18117815fe2f72","msg":"unable to load model","tid":"139979899854848","timestamp":1715253376} time=2024-05-09T20:23:34.811+09:00 level=ERROR source=sched.go:332 msg="error loading llama server" error="timed out waiting for llama runner to start: error:failed to create context with model '/home/cashlo/.ollama/models/blobs/sha256-fa8b357d6f63d2f2415ff3c3c903cde370728ccd8a86a5ee2f18117815fe2f72'" ``` the model works when I uplug the 1070, or if I use a model file to set num_gpu to 80 ### OS Linux ### GPU Nvidia ### CPU _No response_ ### Ollama version 0.1.34
GiteaMirror added the bug label 2026-05-09 08:46:38 -05:00
Author
Owner

@jmorganca commented on GitHub (May 9, 2024):

Merging with https://github.com/ollama/ollama/issues/1947 (thanks for the issue!)

<!-- gh-comment-id:2103524431 --> @jmorganca commented on GitHub (May 9, 2024): Merging with https://github.com/ollama/ollama/issues/1947 (thanks for the issue!)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#80357