Skip to content

ggml-backend-meta: multi buffers are unsupported leading to vulkan segfault #22197

Description

@mattngaw

Name and Version

version: 8863 (9789512)
built with GNU 13.3.0 for Linux x86_64

Operating systems

Linux

GGML backends

Vulkan

Hardware

Intel(R) Xeon(R) CPU E5-2630L v3
2× AMD Radeon RX 480 (Polaris10, 4 GB each, 8 GB aggregate VRAM)
Linux 6.8.0-110-generic (Ubuntu 24.04)
Mesa 25.2.8 / RADV driver
No peer-to-peer; PCIe 3.0 x16

Models

Llama 3.2 3B (unsloth/Llama-3.2-3B-Instruct-GGUF:Q4_K_M)

Problem description & steps to reproduce

Summary

llama-cli segfaults during model load when using --split-mode tensor on Vulkan unless the user explicitly passes -c with a "small" context size.

Repro

./build/bin/llama-cli \
  -hf unsloth/Llama-3.2-3B-Instruct-GGUF:Q4_K_M \
  -ngl 99 -dev Vulkan0,Vulkan1 -sm tensor -fa 1

Result: Segmentation fault (core dumped) after "Loading model..." spinner.

Workaround

Any small -c avoids the crash, this works fine:

./build/bin/llama-cli ... -c 2048

First Bad Commit

No response

Relevant log output

Logs
$ gdb --args ./build/bin/llama-cli -hf unsloth/Llama-3.2-3B-Instruct-GGUF:Q4_K_M     -ngl 99 -dev Vulkan0,Vulkan1 -sm tensor -fa 1
GNU gdb (Ubuntu 15.1-1ubuntu1~24.04.1) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/bin/llama-cli...
(No debugging symbols found in ./build/bin/llama-cli)
(gdb) r
Starting program: /home/matto/llama.cpp/build/bin/llama-cli -hf unsloth/Llama-3.2-3B-Instruct-GGUF:Q4_K_M -ngl 99 -dev Vulkan0,Vulkan1 -sm tensor -fa 1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe29ff6c0 (LWP 366687)]
[New Thread 0x7fffe21fe6c0 (LWP 366688)]
[New Thread 0x7fffe18bc6c0 (LWP 366689)]
[New Thread 0x7fffe0f7a6c0 (LWP 366690)]
[New Thread 0x7fffd3fff6c0 (LWP 366692)]
[Thread 0x7fffd3fff6c0 (LWP 366692) exited]

[New Thread 0x7fffd3fff6c0 (LWP 366693)]
[Thread 0x7fffd3fff6c0 (LWP 366693) exited]
[New Thread 0x7fffd3fff6c0 (LWP 366694)]
[Thread 0x7fffd3fff6c0 (LWP 366694) exited]
[New Thread 0x7fffd3fff6c0 (LWP 366695)]
Loading model... |[New Thread 0x7fffd37fe6c0 (LWP 366696)]
/[New Thread 0x7fffd08886c0 (LWP 366743)]
[Thread 0x7fffd08886c0 (LWP 366743) exited]
[New Thread 0x7fffd08886c0 (LWP 366744)]
[Thread 0x7fffd08886c0 (LWP 366744) exited]
[New Thread 0x7fffd08886c0 (LWP 366745)]
[Thread 0x7fffd08886c0 (LWP 366745) exited]
[New Thread 0x7fffd08886c0 (LWP 366746)]
[Thread 0x7fffd08886c0 (LWP 366746) exited]
-
Thread 1 "llama-cli" received signal SIGSEGV, Segmentation fault.
0x00007ffff3970fb0 in ggml_backend_vk_graph_compute(ggml_backend*, ggml_cgraph*) () from /home/matto/llama.cpp/build/bin/libggml-vulkan.so.0
(gdb) bt full
#0  0x00007ffff3970fb0 in ggml_backend_vk_graph_compute(ggml_backend*, ggml_cgraph*) () from /home/matto/llama.cpp/build/bin/libggml-vulkan.so.0
No symbol table info available.
#1  0x00007ffff797fcb5 in ggml_backend_meta_graph_compute(ggml_backend*, ggml_cgraph*) () from /home/matto/llama.cpp/build/bin/libggml-base.so.0
No symbol table info available.
#2  0x00007ffff7975877 in ggml_backend_sched_graph_compute_async () from /home/matto/llama.cpp/build/bin/libggml-base.so.0
No symbol table info available.
#3  0x00007ffff76bc461 in llama_context::graph_compute(ggml_cgraph*, bool) () from /home/matto/llama.cpp/build/bin/libllama.so.0
No symbol table info available.
#4  0x00007ffff76be574 in llama_context::process_ubatch(llama_ubatch const&, llm_graph_type, llama_memory_context_i*, ggml_status&) () from /home/matto/llama.cpp/build/bin/libllama.so.0
No symbol table info available.
#5  0x00007ffff76c5920 in llama_context::decode(llama_batch const&) () from /home/matto/llama.cpp/build/bin/libllama.so.0
No symbol table info available.
#6  0x00007ffff76c73ef in llama_decode () from /home/matto/llama.cpp/build/bin/libllama.so.0
No symbol table info available.
#7  0x00007ffff7bfa59f in common_init_from_params(common_params&) () from /home/matto/llama.cpp/build/bin/libllama-common.so.0
No symbol table info available.
#8  0x0000555555673068 in server_context_impl::load_model(common_params&) ()
No symbol table info available.
#9  0x00005555555a082e in main ()
No symbol table info available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions