Skip to content

Misc. bug: E llama_init_from_model: failed to initialize the context: Gemma4Assistant #24343

Closed as not planned

Description

@AndrewDBN

Name and Version

version: 9110 (ef22b3e)
built with GNU 12.3.0 for Linux x86_64

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

llama-server

Command line

~/projects/llama.cpp/build/bin/llama-server   -m ./models/gemma-4-12B-it-qat-UD-Q4_K_XL.gguf   --model-draft ./models/gemma-4-12B-it-qat-assistant-MTP-Q8_0.gguf   --spec-type draft-mtp   --spec-draft-n-max 4   --parallel 1 --ctx-size 131072   --temp 1.0   --top-p 0.95   --top-k 64 --tools all --webui-mcp-proxy --jinja --chat-template-file ~/AI/models/jinja_templates/custom_pub_chat_template_gemma4.jinja

Problem description & steps to reproduce

I get this error when launching llama-server:
E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this is normal during memory fitting)
Note the error goes away if I add -fit off to the command line above.

First Bad Commit

No response

Relevant log output

Logs

```0.00.123.654 I log_info: verbosity = 3 (adjust with the -lv N CLI arg)
0.00.123.657 I device_info:
0.00.215.039 I - CUDA0 : NVIDIA GeForce RTX 3080 Ti (11912 MiB, 11640 MiB free)
0.00.215.049 I - CPU : 12th Gen Intel(R) Core(TM) i7-12700K (62986 MiB, 62986 MiB free)
0.00.215.124 I system_info: n_threads = 8 (n_threads_batch = 8) / 20 | CUDA : ARCHS = 860 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX_VNNI = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
0.00.215.165 I srv init: running without SSL
0.00.215.188 I srv init: using 19 threads for HTTP server
0.00.215.273 W srv llama_server: -----------------
0.00.215.274 W srv llama_server: CORS proxy is enabled, do not expose server to untrusted environments
0.00.215.274 W srv llama_server: This feature is EXPERIMENTAL and may be removed or changed in future versions
0.00.215.274 W srv llama_server: -----------------
0.00.215.280 W srv llama_server: -----------------
0.00.215.280 W srv llama_server: Built-in tools are enabled, do not expose server to untrusted environments
0.00.215.281 W srv llama_server: This feature is EXPERIMENTAL and may be changed in the future
0.00.215.281 W srv llama_server: -----------------
0.00.215.284 I srv start: binding port with default address family
0.00.216.449 I srv llama_server: loading model
0.00.216.464 I srv load_model: loading model './models/gemma-4-12B-it-qat-UD-Q4_K_XL.gguf'
0.00.613.937 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this is normal during memory fitting)
0.00.657.037 W srv load_model: [spec] failed to measure draft model memory: failed to create llama_context from model
0.00.657.049 I common_init_result: fitting params to device memory ...
0.00.657.049 I common_init_result: (for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on)
0.01.369.923 W load: control-looking token: 212 '' was not control-type; this is probably a bug in the model. its type will be overridden
0.01.370.244 W load: control-looking token: 50 '<|tool_response>' was not control-type; this is probably a bug in the model. its type will be overridden
0.01.389.089 W load: special_eog_ids contains '<|tool_response>', removing '' token from EOG list
0.02.349.477 W llama_context: n_ctx_seq (131072) < n_ctx_train (262144) -- the full capacity of the model will not be utilized

</details>

<!-- Long logs that you upload as files go here, outside the "console" area -->

Activity

  1. edt-xx commented on Jun 10, 2026

    @edt-xx

    I also see this with b9587 using unsloth/gemma-4-31B-it-Q4_0-MTP.gguf, --fit off is not helping in this case.

    llama-server --models-preset ~/.cache/lm-studio/models/llm/preset.ini --port 8088 --parallel 1 --ctx-checkpoints 16 --checkpoint_min_step 2048 --cache-ram 32768 --slots --metrics --fit off
    lsfg-vk: something went wrong during lsfg-vk layer initialization:
    - unsupported configuration version
    0.00.107.132 I log_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
    0.00.107.147 I system_info: n_threads = 8 (n_threads_batch = 8) / 16 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | AVX512 = 1 | AVX512_VBMI = 1 | AVX512_VNNI = 1 | AVX512_BF16 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 | 
    0.00.107.177 I srv          init: running without SSL
    0.00.107.194 I srv          init: using 15 threads for HTTP server
    0.00.107.880 I srv   load_models: Loaded 0 cached model presets
    0.00.108.212 I srv   load_models: Loaded 4 custom model presets from /home/ed/.cache/lm-studio/models/llm/preset.ini
    0.00.108.864 I srv    operator(): Available models (4) (*: custom preset)
    0.00.108.866 I srv    operator():   * Gemma4-31B
    0.00.108.866 I srv    operator():   * Qwen3.6-27B
    0.00.108.866 I srv    operator():   * Qwen3.6-35B
    0.00.108.866 I srv    operator():   * nomic-embed-text-v1.5
    0.00.108.955 I srv  llama_server: starting router server, no model will be loaded in this process
    0.00.108.956 I srv         start: binding port with default address family
    0.00.110.104 I srv  llama_server: router server is listening on http://127.0.0.1:8088
    0.00.110.106 W srv  llama_server: NOTE: router mode is experimental
    0.00.110.106 W srv  llama_server:       it is not recommended to use this mode in untrusted environments
    0.06.698.701 I srv          load: spawning server instance with name=Gemma4-31B on port 46437
    0.06.698.722 I srv          load: spawning server instance with args:
    0.06.698.723 I srv          load:   /usr/bin/llama-server
    0.06.698.723 I srv          load:   --host
    0.06.698.723 I srv          load:   127.0.0.1
    0.06.698.724 I srv          load:   --jinja
    0.06.698.724 I srv          load:   --keep
    0.06.698.724 I srv          load:   -1
    0.06.698.725 I srv          load:   --metrics
    0.06.698.726 I srv          load:   --no-mmap
    0.06.698.726 I srv          load:   --no-mmproj-offload
    0.06.698.726 I srv          load:   --port
    0.06.698.726 I srv          load:   46437
    0.06.698.727 I srv          load:   --slots
    0.06.698.727 I srv          load:   --spec-draft-n-max
    0.06.698.727 I srv          load:   3
    0.06.698.727 I srv          load:   --cache-type-k-draft
    0.06.698.727 I srv          load:   q5_1
    0.06.698.727 I srv          load:   --cache-type-v-draft
    0.06.698.728 I srv          load:   q4_1
    0.06.698.728 I srv          load:   --spec-type
    0.06.698.728 I srv          load:   draft-mtp
    0.06.698.728 I srv          load:   --temperature
    0.06.698.728 I srv          load:   1.0
    0.06.698.728 I srv          load:   --top-k
    0.06.698.728 I srv          load:   64
    0.06.698.728 I srv          load:   --top-p
    0.06.698.729 I srv          load:   0.95
    0.06.698.729 I srv          load:   --webui-mcp-proxy
    0.06.698.729 I srv          load:   --alias
    0.06.698.729 I srv          load:   Gemma4-31B
    0.06.698.729 I srv          load:   --ctx-size
    0.06.698.730 I srv          load:   262144
    0.06.698.730 I srv          load:   --checkpoint-min-step
    0.06.698.730 I srv          load:   2048
    0.06.698.730 I srv          load:   --cache-ram
    0.06.698.730 I srv          load:   32768
    0.06.698.731 I srv          load:   --cache-type-k
    0.06.698.731 I srv          load:   q5_1
    0.06.698.732 I srv          load:   --cache-type-v
    0.06.698.733 I srv          load:   q4_1
    0.06.698.733 I srv          load:   --swa-checkpoints
    0.06.698.733 I srv          load:   16
    0.06.698.733 I srv          load:   --direct-io
    0.06.698.733 I srv          load:   --fit
    0.06.698.733 I srv          load:   off
    0.06.698.734 I srv          load:   --model
    0.06.698.734 I srv          load:   /home/ed/.cache/lm-studio/models/llm/Gemma4-31B/gemma-4-31B-it-Q4_0-MTP.gguf
    0.06.698.734 I srv          load:   --mmproj
    0.06.698.734 I srv          load:   /home/ed/.cache/lm-studio/models/llm/Gemma4-31B/mmproj-F32.gguf
    0.06.698.734 I srv          load:   --parallel
    0.06.698.734 I srv          load:   1
    0.06.698.734 I srv          load:   --threads
    0.06.698.735 I srv          load:   8
    [46437] lsfg-vk: something went wrong during lsfg-vk layer initialization:
    [46437] - unsupported configuration version
    [46437] 0.00.107.817 I log_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
    [46437] 0.00.107.819 I device_info:
    [46437] 0.00.107.886 I   - Vulkan0 : AMD Radeon RX 7900 XT (RADV NAVI31) (20464 MiB, 18313 MiB free)
    [46437] 0.00.107.890 I   - CPU     : AMD Ryzen 7 7700 8-Core Processor (96108 MiB, 96108 MiB free)
    [46437] 0.00.108.057 I system_info: n_threads = 8 (n_threads_batch = 8) / 16 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | AVX512 = 1 | AVX512_VBMI = 1 | AVX512_VNNI = 1 | AVX512_BF16 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 | 
    [46437] 0.00.108.116 I srv          init: running without SSL
    [46437] 0.00.108.155 I srv          init: using 15 threads for HTTP server
    [46437] 0.00.108.330 W srv  llama_server: -----------------
    [46437] 0.00.108.332 W srv  llama_server: CORS proxy is enabled, do not expose server to untrusted environments
    [46437] 0.00.108.332 W srv  llama_server: This feature is EXPERIMENTAL and may be removed or changed in future versions
    [46437] 0.00.108.332 W srv  llama_server: -----------------
    [46437] 0.00.108.335 I srv         start: binding port with default address family
    [46437] 0.00.109.465 I srv  llama_server: loading model
    [46437] 0.00.109.472 I srv    load_model: loading model '/home/ed/.cache/lm-studio/models/llm/Gemma4-31B/gemma-4-31B-it-Q4_0-MTP.gguf'
    [46437] 0.00.454.544 W load: control-looking token:    212 '</s>' was not control-type; this is probably a bug in the model. its type will be overridden
    [46437] 0.00.454.958 W load: control-looking token:     50 '<|tool_response>' was not control-type; this is probably a bug in the model. its type will be overridden
    [46437] 0.00.481.944 W load: special_eog_ids contains '<|tool_response>', removing '</s>' token from EOG list
    

    [46437] 0.00.634.848 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this is normal during memory fitting)

    [46437] 0.00.634.852 E common_init_result: failed to create context with model '/home/ed/.cache/lm-studio/models/llm/Gemma4-31B/gemma-4-31B-it-Q4_0-MTP.gguf'
    [46437] 0.00.634.852 E common_init_from_params: failed to create context with model '/home/ed/.cache/lm-studio/models/llm/Gemma4-31B/gemma-4-31B-it-Q4_0-MTP.gguf'
    
  2. goupdate commented on Jun 10, 2026

    @goupdate

    C:\ai-llama>llama-server --reasoning off --model C:\ai-koboldcpp\gemma-4-12B-it-qat-UD-Q4_K_XL.gguf --model-draft C:\ai-koboldcpp\mtp-gemma-4-12B-it.gguf -c 262144 -n 131072 --temp 1.0 --top-p 0.95 --top-k 64

    ←[34m0.00.354.624←[0m ←[32mI ←[0mlog_info: verbosity = 3 (adjust with the -lv N CLI arg)
    ←[34m0.00.354.642←[0m ←[32mI ←[0mdevice_info:
    ←[34m0.00.356.149←[0m ←[32mI ←[0m - Vulkan0 : NVIDIA GeForce RTX 4080 SUPER (16261 MiB, 15491 MiB free)
    ←[34m0.00.356.162←[0m ←[32mI ←[0m - CPU : Intel(R) Xeon(R) CPU E5-2698 v3 @ 2.30GHz (65440 MiB, 46792 MiB free)
    ←[34m0.00.356.319←[0m ←[32mI ←[0msystem_info: n_threads = 32 (n_threads_batch = 32) / 64 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 | ←[34m0.00.356.352←[0m ←[32mI ←[0msrv llama_server: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true ←[34m0.00.356.536←[0m ←[32mI ←[0msrv init: running without SSL ←[34m0.00.356.671←[0m ←[32mI ←[0msrv init: using 63 threads for HTTP server ←[34m0.00.357.336←[0m ←[32mI ←[0msrv start: binding port with default address family ←[34m0.00.373.286←[0m ←[32mI ←[0msrv llama_server: loading model ←[34m0.00.373.313←[0m ←[32mI ←[0msrv load_model: loading model 'C:\ai-koboldcpp\gemma-4-12B-it-qat-UD-Q4_K_XL.gguf' ←[34m0.02.710.101←[0m ←[31mE llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this is normal during memory fitting) ←[0m←[34m0.02.849.821←[0m ←[35mW srv load_model: [spec] failed to measure draft model memory: failed to create llama_context from model ←[0m←[34m0.02.849.862←[0m ←[32mI ←[0mcommon_init_result: fitting params to device memory ...

  3. nhtua commented on Jun 18, 2026

    @nhtua

    I saw this issue too

    [42767] 0.00.276.123 I system_info: n_threads = 16 (n_threads_batch = 16) / 32 | ROCm : NO_VMM = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | AVX512 = 1 | AVX512_VBMI = 1 | AVX512_VNNI = 1 | AVX512_BF16 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
    [42767] 0.00.276.126 I srv  llama_server: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true
    [42767] 0.00.276.146 I srv          init: running without SSL
    [42767] 0.00.276.183 I srv          init: using 31 threads for HTTP server
    [42767] 0.00.276.329 I srv         start: binding port with default address family
    [42767] 0.00.277.449 I srv  llama_server: loading model
    [42767] 0.00.277.459 I srv    load_model: loading model '/home/liam/models/unsloth/gemma-4-31B-it-GGUF/gemma-4-31B-it-Q8_0-MTP.gguf'
    [42767] 0.00.277.485 I common_init_result: fitting params to device memory ...
    [42767] 0.00.277.486 I common_init_result: (for bugs during this step, try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on)
    0.10.079.781 I srv  ensure_model: waiting until model name=unsloth/gemma-4-31B-it-GGUF/gemma-4-31B-it-Q8_0-MTP.gguf is fully loaded...
    [42767] 0.00.608.810 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    [42767] 0.00.653.386 E common_fit_params: encountered an error while trying to fit params to free device memory: failed to create llama_context from model
    [42767] 0.00.890.880 W load: control-looking token:    212 '</s>' was not control-type; this is probably a bug in the model. its type will be overridden
    [42767] 0.00.891.130 W load: control-looking token:     50 '<|tool_response>' was not control-type; this is probably a bug in the model. its type will be overridden
    [42767] 0.00.906.355 W load: special_eog_ids contains '<|tool_response>', removing '</s>' token from EOG list
    [42767] 0.00.979.095 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    [42767] 0.00.979.098 E common_init_result: failed to create context with model '/home/liam/models/unsloth/gemma-4-31B-it-GGUF/gemma-4-31B-it-Q8_0-MTP.gguf'
    
  4. rchildre3 commented on Jun 22, 2026

    @rchildre3

    hitting this now with on llama.cpp version:

    52b3df002 (tag: b9754) common/peg : implement ac parser for stricter grammar generation (#24869)

    built with:

    cmake \
      -G Ninja \
      -B build \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_CXX_FLAGS="-march=native" \
      -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
      -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=1 \
      -DGGML_VULKAN=1 \
      -DGGML_NATIVE=1

    Hitting a segfault with:

    gdb -q --args ./build/bin/llama-server -hf unsloth/gemma-4-E2B-it-qat-GGUF:Q4_0 --threads 3 --spec-type draft-mtp --spec-draft-n-max 2

    load_model: loading model '$HOME/.cache/huggingface/hub/models--unsloth--gemma-4-E2B-it-qat-GGUF/snapshots/db01ae3ceeca98487bf3569814f832f5023cd48c/MTP/gemma-4-E2B-it-Q4_0-MTP.gguf'
    ...
    0.09.031.094 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    0.09.031.099 E common_init_result: failed to create context with model '$HOME/.cache/huggingface/hub/models--unsloth--gemma-4-E2B-it-qat-GGUF/snapshots/db01ae3ceeca98487bf3569814f832f5023cd48c/MTP/gemma-4-E2B-it-Q4_0-MTP.gguf'
    0.09.031.103 E common_init_from_params: failed to create context with model '$HOME/.cache/huggingface/hub/models--unsloth--gemma-4-E2B-it-qat-GGUF/snapshots/db01ae3ceeca98487bf3569814f832f5023cd48c/MTP/gemma-4-E2B-it-Q4_0-MTP.gguf'
    
    Thread 1 "llama-server" received signal SIGSEGV, Segmentation fault.
    llama_context::n_ctx (this=0x0) at $HOME/llama.cpp/src/llama-context.cpp:731
    731         return cparams.n_ctx;
    
    (gdb) bt
    #0  llama_context::n_ctx (this=0x0) at $HOME/llama.cpp/src/llama-context.cpp:731
    #1  0x00007ffff7b41b33 in server_context_impl::load_model (this=<optimized out>, params=...)
        at $HOME/llama.cpp/tools/server/server-context.cpp:1167
    #2  0x00007ffff7ace83d in llama_server (argc=<optimized out>, argv=<optimized out>) at $HOME/llama.cpp/tools/server/server.cpp:317
    #3  0x00007ffff762a601 in __libc_start_call_main (main=main@entry=0x555555555060 <main(int, char**)>, argc=argc@entry=9,
        argv=argv@entry=0x7fffffffdd58) at ../sysdeps/nptl/libc_start_call_main.h:59
    #4  0x00007ffff762a718 in __libc_start_main_impl (main=0x555555555060 <main(int, char**)>, argc=9, argv=0x7fffffffdd58, init=<optimized out>,
        fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd48) at ../csu/libc-start.c:360
    #5  0x0000555555555095 in _start ()
    
    (gdb) p cparams
    ❌️ Cannot access memory at address 0x8
    
  5. rchildre3 commented on Jun 23, 2026

    @rchildre3

    Still hitting this on:

    be4a6a63e (HEAD -> master, tag: b9775) server : check draft context creation error (#24922)

    (even with #24922 merged in)

    ./build/bin/llama-server -hf unsloth/gemma-4-E2B-it-qat-GGUF:Q4_0
    0.00.160.231 I device_info:
    0.00.160.840 I   - Vulkan0 : Intel(R) HD Graphics 520 (SKL GT2) (5453 MiB, 3720 MiB free)
    0.00.160.865 I   - CPU     : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz (7270 MiB, 7270 MiB free)
    ...
    0.01.492.103 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    0.01.626.997 E common_fit_params: encountered an error while trying to fit params to free device memory: failed to create llama_context from model
    Segmentation fault         (core dumped)
    
    Thread 1 "llama-server" received signal SIGSEGV, Segmentation fault.
    llama_context::n_ctx (this=0x0) at src/llama-context.cpp:731
    731         return cparams.n_ctx;
    (gdb) bt
    #0  llama_context::n_ctx (this=0x0) at src/llama-context.cpp:731
    #1  in server_context_impl::load_model (this=<optimized out>, params=...)
        at tools/server/server-context.cpp:1171
    #2  in llama_server (argc=<optimized out>, argv=<optimized out>)
        at tools/server/server.cpp:339
    
    
  6. jmorth commented on Jun 25, 2026

    @jmorth

    Also seeing this with the latest llama-server and Gemma4 31B:

    llama.cpp/llama-server \
            -hf unsloth/gemma-4-31b-it-GGUF:UD-Q4_K_XL \
            --alias gemma4 \
            --host 0.0.0.0 \
            --port 8081 \
            --split-mode tensor \
            --flash-attn on \
            --spec-type draft-mtp \
            --spec-draft-n-max 2 \
            --cache-type-k q8_0 \
            --cache-type-v q8_0 \
            --kv-offload \
            --temp 1.0 \
            --top-p 0.95 \
            --top-k 64 \
            --parallel 1 \
            --ctx-size 262144 \
            --jinja \
            --metrics
    
    0.01.519.100 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    0.01.584.302 W srv    load_model: [spec] failed to measure draft model memory: failed to create llama_context from model
    0.01.584.312 I common_init_result: fitting params to device memory ...
    0.01.584.312 I common_init_result: (for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on)
    0.01.584.316 W common_fit_params: failed to fit params to free device memory: llama_params_fit is not implemented for SPLIT_MODE_TENSOR, abort
    0.01.951.567 W load: control-looking token:    212 '</s>' was not control-type; this is probably a bug in the model. its type will be overridden
    0.01.952.030 W load: control-looking token:     50 '<|tool_response>' was not control-type; this is probably a bug in the model. its type will be overridden
    0.01.958.378 W load: control-looking token:      1 '<eos>' was not control-type; this is probably a bug in the model. its type will be overridden
    0.01.977.067 W load: special_eog_ids contains '<|tool_response>', removing '</s>' token from EOG list
    0.14.099.258 W NCCL not compiled in; falling back to internal AllReduce.  Recompile with -DGGML_CUDA_NCCL=ON for best multi-GPU performance.
    ~/llama.cpp/ggml/src/ggml-backend-meta.cpp:1512: GGML_ASSERT(bufs.back() != nullptr) failed
    0.14.264.670 E ggml_backend_cuda_buffer_type_alloc_buffer: allocating 2391.80 MiB on device 0: cudaMalloc failed: out of memory
    llama.cpp/llama-server(+0x15cb2eb)[0x560efea802eb]
    llama.cpp/llama-server(+0x15cb8cf)[0x560efea808cf]
    llama.cpp/llama-server(+0x15cba9e)[0x560efea80a9e]
    llama.cpp/llama-server(+0x15f2831)[0x560efeaa7831]
    llama.cpp/llama-server(+0x15e3841)[0x560efea98841]
    llama.cpp/llama-server(+0x15ebfc4)[0x560efeaa0fc4]
    llama.cpp/llama-server(+0x5870e0)[0x560efda3c0e0]
    llama.cpp/llama-server(+0x5878e0)[0x560efda3c8e0]
    llama.cpp/llama-server(+0x58bd4a)[0x560efda40d4a]
    llama.cpp/llama-server(+0x58cf5f)[0x560efda41f5f]
    llama.cpp/llama-server(+0x33e104)[0x560efd7f3104]
    llama.cpp/llama-server(+0x33f08c)[0x560efd7f408c]
    llama.cpp/llama-server(+0x248dab)[0x560efd6fddab]
    llama.cpp/llama-server(+0x17f91c)[0x560efd63491c]
    /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7fb9aa6f7d90]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7fb9aa6f7e40]
    llama.cpp/llama-server(+0x1793e5)[0x560efd62e3e5]
    
  7. khimaros commented on Jul 2, 2026

    @khimaros
    Contributor

    seeing this with all gemma4 MTP models from unsloth with vulkan

    0.02.014.700 D create_tensor: loading tensor blk.3.post_ffw_norm.weight
    0.02.014.740 D done_getting_tensors: tensor 'token_embd.weight' (q8_0) (and 0 others) cannot be used with preferred buffer type Vulkan_Host,
     using CPU instead
    0.02.037.003 I load_tensors: offloading output layer to GPU
    0.02.037.007 I load_tensors: offloading 3 repeating layers to GPU
    0.02.037.007 I load_tensors: offloaded 5/5 layers to GPU
    0.02.037.012 I load_tensors:   CPU_Mapped model buffer size =   272.00 MiB
    0.02.037.013 I load_tensors:      Vulkan0 model buffer size =   428.53 MiB                                                                 |0.02.078.744 I cmn  common_init_: added <eos> logit bias = -inf
    0.02.078.748 I cmn  common_init_: added <|tool_response> logit bias = -inf
    0.02.078.749 I cmn  common_init_: added <turn|> logit bias = -inf
    0.02.079.945 I llama_context: constructing llama_context
    0.02.079.974 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal
     during memory fitting)
    0.02.079.977 E cmn  common_init_: failed to create context with model '/home/.cache/huggingface/hub/models--unsloth--gemma-4-12B-it-
    GGUF/snapshots/3249fa54d5efa384afc552cc6700ad091efd5c39/MTP/gemma-4-12b-it-Q8_0-MTP.gguf'
    0.02.079.980 E cmn  common_init_: failed to create context with model '/home/.cache/huggingface/hub/models--unsloth--gemma-4-12B-it-
    GGUF/snapshots/3249fa54d5efa384afc552cc6700ad091efd5c39/MTP/gemma-4-12b-it-Q8_0-MTP.gguf'
    Segmentation fault         llama-cli -lv 5 --hf-repo unsloth/gemma-4-12B-it-GGUF:Q8_0
    
  8. emk commented on Jul 4, 2026

    @emk

    Confirmed with CUDA on b9871-ef2d77011.

    ❯ llama-cli -hf unsloth/gemma-4-31B-it-GGUF:Q8_0 --spec-type draft-mtp --spec-draft-n-max 4 --single-turn --prompt "Testing 1,2,3"
    
    Loading model... |0.00.614.173 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    \0.00.942.908 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    |0.01.004.979 E common_fit_params: encountered an error while trying to fit params to free device memory: failed to create llama_context from model
    \0.01.327.731 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    0.01.327.736 E cmn  common_init_: failed to create context with model '/home/$USER/.cache/huggingface/hub/models--unsloth--gemma-4-31B-it-GGUF/snapshots/8906b3db2e669a0b1d6293c315d3f9fbf934a86d/MTP/gemma-4-31B-it-Q8_0-MTP.gguf'
    0.01.327.738 E cmn  common_init_: failed to create context with model '/home/$USER/.cache/huggingface/hub/models--unsloth--gemma-4-31B-it-GGUF/snapshots/8906b3db2e669a0b1d6293c315d3f9fbf934a86d/MTP/gemma-4-31B-it-Q8_0-MTP.gguf'
    fish: Job 1, 'llama-cli -hf unsloth/gemma-4-3…' terminated by signal SIGSEGV (Address boundary error)
    

    But the 26B A4B works fine, with just the first non-fatal warning:

    ❯ llama-cli -hf unsloth/gemma-4-26B-A4B-it-qat-GGUF:UD-Q4_K_XL --spec-type draft-mtp --spec-draft-n-max 4
    
    Loading model... |0.00.678.573 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)
    
    
    
    ▄▄ ▄▄
    ██ ██
    ██ ██  ▀▀█▄ ███▄███▄  ▀▀█▄    ▄████ ████▄ ████▄
    ██ ██ ▄█▀██ ██ ██ ██ ▄█▀██    ██    ██ ██ ██ ██
    ██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀
                                        ██    ██
                                        ▀▀    ▀▀
    
    build      : b9871-ef2d77011
    model      : unsloth/gemma-4-26B-A4B-it-qat-GGUF:UD-Q4_K_XL
    ftype      : Q4_0
    modalities : text, vision
    
  9. Snegovik commented on Jul 10, 2026

    @Snegovik

    Тоже имею эту проблему с Gemma-4-26B-A4B-qat. requires ctx_other to be set

  10. AlvaroBalbin commented on Jul 11, 2026

    @AlvaroBalbin

    The error is coming from the memory-fitting probe, not from real context init. In common/fit.cpp the fit routine loads the draft model and calls llama_init_from_model with cparams.ctx_other == nullptr just to measure its footprint, and for this arch the LLM_ARCH_GEMMA4_ASSISTANT branch in src/llama-context.cpp (around line 119) deliberately throws "requires ctx_other to be set", because the target context only gets wired up later in common_speculative_init_result. That is why -fit off makes it go away: it skips the probe. So the E line is expected and non-fatal, and there's already a TODO right above the throw to turn it into a non-printing exception so it stops showing up as an error. Can you confirm whether the server actually fails to start, or does it log this line and then continue serving normally? If it continues, this is just misleading log noise rather than a real init failure.

  11. pamaral-git commented on Jul 20, 2026

    @pamaral-git

    @AlvaroBalbin at least for me the server still runs and I'm able to continue almost always

     llama-cli -m /Users/.../models/gemma-4-12B-it-qat-UD-Q4_K_XL.gguf \ 
      --jinja -ngl 99 --flash-attn on \
      --ctx-size 40000 \
      --model-draft /Users/.../models/mtp-gemma-4-12B-it-Q8_0.gguf \
      --spec-type draft-mtp --spec-draft-n-max 3 \
      --cache-type-k q8_0 --cache-type-v q8_0 \
      --temp 0.6 --top-p 0.92 --min-p 0.05
    
    
    **Loading model... \0.00.318.691 E llama_init_from_model: failed to initialize the context: Gemma4Assistant requires ctx_other to be set (this warning is normal during memory fitting)**
     
    
    ▄▄ ▄▄
    ██ ██
    ██ ██  ▀▀█▄ ███▄███▄  ▀▀█▄    ▄████ ████▄ ████▄
    ██ ██ ▄█▀██ ██ ██ ██ ▄█▀██    ██    ██ ██ ██ ██
    ██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀
                                        ██    ██
                                        ▀▀    ▀▀
    
    build      : b9960-a935fbffe
    model      : /Users/.../models/gemma-4-12B-it-qat-UD-Q4_K_XL.gguf
    ftype      : Q4_0
    modalities : text
    
    available commands:
      /exit or Ctrl+C     stop or exit
      /regen              regenerate the last response
      /clear              clear the chat history
      /read <file>        add a text file
      /glob <pattern>     add text files using globbing pattern
    
    
    
    > /read /Users/.../Documents/AI-Files/notes.md
    Loaded text from '/Users/.../Documents/AI-Files/notes.md'
    
    > suggest a new improved writing of the file ...
    
    [Start thinking] (...)
    
  12. controlaltnerd commented on Aug 13, 2026

    @controlaltnerd

    The error is coming from the memory-fitting probe, not from real context init. In common/fit.cpp the fit routine loads the draft model and calls llama_init_from_model with cparams.ctx_other == nullptr just to measure its footprint, and for this arch the LLM_ARCH_GEMMA4_ASSISTANT branch in src/llama-context.cpp (around line 119) deliberately throws "requires ctx_other to be set", because the target context only gets wired up later in common_speculative_init_result. That is why -fit off makes it go away: it skips the probe. So the E line is expected and non-fatal, and there's already a TODO right above the throw to turn it into a non-printing exception so it stops showing up as an error. Can you confirm whether the server actually fails to start, or does it log this line and then continue serving normally? If it continues, this is just misleading log noise rather than a real init failure.

    I can confirm this appears to be a real init failure with Meta Muse Glimmer's draft assistant model, based on the logs I get in LM Studio:

    2026-08-13 19:02:38 [DEBUG]
    							LMSTUDIO_STARTUP_ERROR:{"schemaVersion":1,"code":"model_load_failed","message":"Failed to initialize the context: dflash requires ctx_other to be set (this warning is normal during memory fitting)"}
    							0.00.951.571 E llama_init_from_model: failed to initialize the context: dflash requires ctx_other to be set (this warning is normal during memory fitting)
    							0.00.951.575 E cmn  common_init_: failed to create context with model '/Users/me/.lmstudio/models/meta-models/Muse-Glimmer-30B-GGUF/dflash-Muse-Glimmer-30B-Q4_K_M.gguf'
    							0.00.951.576 E cmn  common_init_: failed to create context with model '/Users/me/.lmstudio/models/meta-models/Muse-Glimmer-30B-GGUF/dflash-Muse-Glimmer-30B-Q4_K_M.gguf'
    							0.00.951.578 E srv    load_model: failed to create context with model '/Users/me/.lmstudio/models/meta-models/Muse-Glimmer-30B-GGUF/dflash-Muse-Glimmer-30B-Q4_K_M.gguf': Failed to initialize the context: dflash requires ctx_other to be set (this warning is normal during memory fitting)
    							0.00.951.597 I srv    operator(): operator(): cleaning up before exit...
    2026-08-13 19:02:38 [DEBUG]
    							0.00.951.991 E srv  llama_server: exiting due to model loading error
    

    I brought it up with the LM Studio devs directly before realizing it was probably happening with llama.ccp itself.

  13. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions