Skip to content

Eval bug: In function launch_fattn: CUDA ERROR: Invalid configuration #19487

Closed

Description

@lee-b

Name and Version

Linux, CUDA 13.1

$ docker run -ti ghcr.io/ggml-org/llama.cpp:server-cuda --version
ggml_cuda_init: found 5 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 2: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 3: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 4: NVIDIA GeForce RTX 3070, compute capability 8.6, VMM: yes
load_backend: loaded CUDA backend from /app/libggml-cuda.so
load_backend: loaded CPU backend from /app/libggml-cpu-zen4.so
version: 7964 (b83111815)
built with GNU 11.4.0 for Linux x86_64

Operating systems

Linux

GGML backends

CUDA

Hardware

Ryzen 7950X, 4x3090.

Models

Step 3.5 Flash @ IQ3_XS:

      - --port
      - "8080"
      - --alias
      - local/large
      - -m
      - /models/llms/stepfun-ai_Step-3.5-Flash-GGUF/stepfun-ai_Step-3.5-Flash-IQ3_XS/stepfun-ai_Step-3.5-Flash-IQ3_XS-00001-of-00003.gguf
      - -ngl
      - "999"
      - -fa
      - "on"
      - -np
      - "2"
      - -c
      - "184320"
      - --fit-ctx
      - "184320"
      - --jinja
      - -ctk
      - q8_0
      - -ctv
      - q8_0
      - --chat-template-file
      - /models/llms/stepfun-ai_Step-3.5-Flash-GGUF/chat_template.jinja
      - --backend-sampling
      - --cache-ram
      - "16384"

Problem description & steps to reproduce

CUDA error: invalid configuration arguments.

First Bad Commit

No response

Relevant log output

Logs
llama-cpp--local-large-1  | /app/ggml/src/ggml-cuda/ggml-cuda.cu:97: CUDA error
llama-cpp--local-large-1  | CUDA error: invalid configuration argument
llama-cpp--local-large-1  |   current device: 0, in function launch_fattn at /app/ggml/src/ggml-cuda/template-instances/../fattn-common.cuh:913
llama-cpp--local-large-1  |   cudaGetLastError()
llama-cpp--local-large-1  | libggml-base.so.0(+0x1848b)[0x7fa42a52e48b]
llama-cpp--local-large-1  | libggml-base.so.0(ggml_print_backtrace+0x21f)[0x7fa42a52e8ef]
llama-cpp--local-large-1  | libggml-base.so.0(ggml_abort+0x152)[0x7fa42a52eac2]
llama-cpp--local-large-1  | /app/libggml-cuda.so(+0x1798d6)[0x7fa40e9858d6]
llama-cpp--local-large-1  | /app/libggml-cuda.so(_Z12launch_fattnILi128ELi8ELi8EEvR25ggml_backend_cuda_contextP11ggml_tensorPFvPKcS5_S5_S5_S5_PKiPfP6float2ffffjfi5uint3iiiiiiiiiiiliiliiiiilEimibbbi+0xbe4)[0x7fa40ecd33d4]
llama-cpp--local-large-1  | /app/libggml-cuda.so(_Z37ggml_cuda_flash_attn_ext_mma_f16_caseILi128ELi128ELi8ELi8EEvR25ggml_backend_cuda_contextP11ggml_tensor+0x206)[0x7fa40ecd4496]
llama-cpp--local-large-1  | /app/libggml-cuda.so(+0x189f2f)[0x7fa40e995f2f]
llama-cpp--local-large-1  | /app/libggml-cuda.so(+0x18cf3e)[0x7fa40e998f3e]
llama-cpp--local-large-1  | /app/libggml-cuda.so(+0x18f3d5)[0x7fa40e99b3d5]
llama-cpp--local-large-1  | libggml-base.so.0(ggml_backend_sched_graph_compute_async+0x81f)[0x7fa42a54babf]
llama-cpp--local-large-1  | libllama.so.0(_ZN13llama_context13graph_computeEP11ggml_cgraphb+0xa1)[0x7fa42a684201]
llama-cpp--local-large-1  | libllama.so.0(_ZN13llama_context14process_ubatchERK12llama_ubatch14llm_graph_typeP22llama_memory_context_iR11ggml_status+0x115)[0x7fa42a684645]
llama-cpp--local-large-1  | libllama.so.0(_ZN13llama_context6decodeERK11llama_batch+0x383)[0x7fa42a68c623]
llama-cpp--local-large-1  | libllama.so.0(llama_decode+0x10)[0x7fa42a68dbe0]
llama-cpp--local-large-1  | /app/llama-server(+0x141e02)[0x55d5244cde02]
llama-cpp--local-large-1  | /app/llama-server(+0x17e876)[0x55d52450a876]
llama-cpp--local-large-1  | /app/llama-server(+0x9fb3e)[0x55d52442bb3e]
llama-cpp--local-large-1  | /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7fa429fe3d90]
llama-cpp--local-large-1  | /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7fa429fe3e40]
llama-cpp--local-large-1  | /app/llama-server(+0xa3695)[0x55d52442f695]

Activity

  1. am17an commented on Feb 10, 2026

    @am17an
    Contributor

    can you try without --backend-sampling?

  2. changed the title [-]Eval bug: CUDA ERROR: Invalid configuration[/-] [+]Eval bug: In function launch_fattn: CUDA ERROR: Invalid configuration[/+] on Feb 10, 2026
  3. lee-b commented on Feb 10, 2026

    @lee-b
    Author

    can you try without --backend-sampling?

    Will try, but it does log that backend-sampling is unused anyway:

    llama-cpp--local-large-1  | common_sampler_init: backend sampling is not compatible with grammar, disabling
    
  4. am17an commented on Feb 10, 2026

    @am17an
    Contributor

    Okay, did this configuration ever work for you? if it did, a bisect would help

  5. lee-b commented on Feb 10, 2026

    @lee-b
    Author

    Okay, did this configuration ever work for you? if it did, a bisect would help

    Yes, the crash is infrequent, it mostly works. I'm tailing the logs with 2>&1 | grep -C 20 'CUDA error' to check for recurrences.

  6. pwilkin commented on Feb 10, 2026

    @pwilkin
    Member

    Some people reported it in the autoparser branch as well (that I recently rebased on top of master), so it's something new.

  7. added
    bug
    regression
    CUDA
    and removed on Feb 10, 2026
  8. omkarsharma9817293193-creator commented on Feb 17, 2026

    @omkarsharma9817293193-creator
  9. tlaerm commented on Feb 26, 2026

    @tlaerm

    I hit this too.

    llama-cpp-server0    |0m main: NOTE: router mode is experimental
    llama-cpp-server0    |0m main:       it is not recommended to use this mode in untrusted environments
    llama-cpp-server0    |0m srv  ensure_model: model name=qwen3-coder is not loaded, loading...
    llama-cpp-server0    |0m srv          load: spawning server instance with name=qwen3-coder on port 55847
    llama-cpp-server0    |0m srv          load: spawning server instance with args:
    llama-cpp-server0    |0m srv          load:   /app/llama-server
    llama-cpp-server0    |0m srv          load:   --host
    llama-cpp-server0    |0m srv          load:   127.0.0.1
    llama-cpp-server0    |0m srv          load:   --jinja
    llama-cpp-server0    |0m srv          load:   --min-p
    llama-cpp-server0    |0m srv          load:   0.0
    llama-cpp-server0    |0m srv          load:   --port
    llama-cpp-server0    |0m srv          load:   55847
    llama-cpp-server0    |0m srv          load:   --repeat-penalty
    llama-cpp-server0    |0m srv          load:   1.05
    llama-cpp-server0    |0m srv          load:   --sleep-idle-seconds
    llama-cpp-server0    |0m srv          load:   1800
    llama-cpp-server0    |0m srv          load:   --temperature
    llama-cpp-server0    |0m srv          load:   0.7
    llama-cpp-server0    |0m srv          load:   --top-k
    llama-cpp-server0    |0m srv          load:   20
    llama-cpp-server0    |0m srv          load:   --top-p
    llama-cpp-server0    |0m srv          load:   0.8
    llama-cpp-server0    |0m srv          load:   --no-warmup
    llama-cpp-server0    |0m srv          load:   --alias
    llama-cpp-server0    |0m srv          load:   qwen3-coder
    llama-cpp-server0    |0m srv          load:   --batch-size
    llama-cpp-server0    |0m srv          load:   6144
    llama-cpp-server0    |0m srv          load:   --ctx-size
    llama-cpp-server0    |0m srv          load:   184320
    llama-cpp-server0    |0m srv          load:   --cont-batching
    llama-cpp-server0    |0m srv          load:   --cache-type-k
    llama-cpp-server0    |0m srv          load:   q8_0
    llama-cpp-server0    |0m srv          load:   --cache-type-v
    llama-cpp-server0    |0m srv          load:   q8_0
    llama-cpp-server0    |0m srv          load:   --flash-attn
    llama-cpp-server0    |0m srv          load:   auto
    llama-cpp-server0    |0m srv          load:   --fit
    llama-cpp-server0    |0m srv          load:   off
    llama-cpp-server0    |0m srv          load:   --model
    llama-cpp-server0    |0m srv          load:   /models/Qwen3-Coder-30B-A3B-Instruct-IQ4_XS-4.20bpw.gguf
    llama-cpp-server0    |0m srv          load:   --n-cpu-moe
    llama-cpp-server0    |0m srv          load:   0
    llama-cpp-server0    |0m srv          load:   --n-gpu-layers
    llama-cpp-server0    |0m srv          load:   999
    llama-cpp-server0    |0m srv          load:   --parallel
    llama-cpp-server0    |0m srv          load:   2
    llama-cpp-server0    |0m srv          load:   --split-mode
    llama-cpp-server0    |0m srv          load:   layer
    llama-cpp-server0    |0m srv          load:   --threads
    llama-cpp-server0    |0m srv          load:   32
    llama-cpp-server0    |0m srv          load:   --threads-batch
    llama-cpp-server0    |0m srv          load:   32
    llama-cpp-server0    |0m srv          load:   --ubatch-size
    llama-cpp-server0    |0m srv          load:   3072
    ...
    llama-cpp-server0    | [55847] slot launch_slot_: id  0 | task 28277 | processing task, is_child = 0
    llama-cpp-server0    | [55847] slot update_slots: id  0 | task 28277 | new prompt, n_ctx_slot = 92160, n_keep = 0, task.n_tokens = 1632
    llama-cpp-server0    | [55847] slot update_slots: id  0 | task 28277 | n_tokens = 30, memory_seq_rm [30, end)
    llama-cpp-server0    | [55847] slot init_sampler: id  0 | task 28277 | init sampler, took 0.46 ms, tokens: text = 1632, total = 1632
    llama-cpp-server0    | [55847] slot update_slots: id  0 | task 28277 | prompt processing done, n_tokens = 1632, batch.n_tokens = 1602
    llama-cpp-server0    | [55847] slot update_slots: id  1 | task 28264 | n_tokens = 73758, memory_seq_rm [73758, end)
    llama-cpp-server0    | [55847] slot update_slots: id  1 | task 28264 | prompt processing progress, n_tokens = 78300, batch.n_tokens = 6144, progress = 0.974948
    llama-cpp-server0    | [55847] CUDA error: invalid configuration argument
    llama-cpp-server0    | [55847]   current device: 0, in function launch_fattn at /app/ggml/src/ggml-cuda/template-instances/../fattn-common.cuh:913
    llama-cpp-server0    | [55847]   cudaGetLastError()
    llama-cpp-server0    | [55847] /app/ggml/src/ggml-cuda/ggml-cuda.cu:97: CUDA error
    llama-cpp-server0    | [55847] libggml-base.so.0(+0x1837b)[0x7efe1fbe537b]
    llama-cpp-server0    | [55847] libggml-base.so.0(ggml_print_backtrace+0x21f)[0x7efe1fbe57df]
    llama-cpp-server0    | [55847] libggml-base.so.0(ggml_abort+0x152)[0x7efe1fbe59b2]
    llama-cpp-server0    | [55847] /app/libggml-cuda.so(+0x17cae6)[0x7efdc6094ae6]
    llama-cpp-server0    | [55847] /app/libggml-cuda.so(_Z12launch_fattnILi128ELi4ELi8EEvR25ggml_backend_cuda_contextP11ggml_tensorPFvPKcS5_S5_S5_S5_PKiPfP6float2ffffjfi5uint3iiiiiiiiiiiliiliiiiilEimibbbi+0xbe4)[0x7efdc6256024]
    llama-cpp-server0    | [55847] /app/libggml-cuda.so(_Z37ggml_cuda_flash_attn_ext_mma_f16_caseILi128ELi128ELi4ELi8EEvR25ggml_backend_cuda_contextP11ggml_tensor+0x206)[0x7efdc63b47c6]
    llama-cpp-server0    | [55847] /app/libggml-cuda.so(+0x18d13f)[0x7efdc60a513f]
    llama-cpp-server0    | [55847] /app/libggml-cuda.so(+0x19023e)[0x7efdc60a823e]
    llama-cpp-server0    | [55847] /app/libggml-cuda.so(+0x1925ca)[0x7efdc60aa5ca]
    llama-cpp-server0    | [55847] libggml-base.so.0(ggml_backend_sched_graph_compute_async+0x81f)[0x7efe1fc02b2f]
    llama-cpp-server0    | [55847] libllama.so.0(_ZN13llama_context13graph_computeEP11ggml_cgraphb+0xa1)[0x7efe1fd3e761]
    llama-cpp-server0    | [55847] libllama.so.0(_ZN13llama_context14process_ubatchERK12llama_ubatch14llm_graph_typeP22llama_memory_context_iR11ggml_status+0x115)[0x7efe1fd3eb95]
    llama-cpp-server0    | [55847] libllama.so.0(_ZN13llama_context6decodeERK11llama_batch+0x383)[0x7efe1fd468e3]
    llama-cpp-server0    | [55847] libllama.so.0(llama_decode+0x10)[0x7efe1fd47f20]
    llama-cpp-server0    | [55847] /app/llama-server(+0x145e02)[0x55f484e5be02]
    llama-cpp-server0    | [55847] /app/llama-server(+0x182486)[0x55f484e98486]
    llama-cpp-server0    | [55847] /app/llama-server(+0xa18ee)[0x55f484db78ee]
    llama-cpp-server0    | [55847] /usr/lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7efe1f69bd90]
    llama-cpp-server0    | [55847] /usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7efe1f69be40]
    llama-cpp-server0    | [55847] /app/llama-server(+0xa5445)[0x55f484dbb445]
    llama-cpp-server0    | srv    operator(): http client error: Failed to read connection
    llama-cpp-server0    | srv  log_server_r: done request: POST /v1/chat/completions 10.142.124.248 500
    llama-cpp-server0    | srv    operator(): http client error: Failed to read connection
    llama-cpp-server0    | srv  proxy_reques: proxying request to model qwen3-coder on port 55847
    llama-cpp-server0    | srv    operator(): http client error: Could not establish connection
    llama-cpp-server0    | srv  log_server_r: done request: POST /v1/chat/completions 10.142.124.248 500
    llama-cpp-server0    | srv  proxy_reques: proxying request to model qwen3-coder on port 55847
    llama-cpp-server0    | srv    operator(): http client error: Could not establish connection
    llama-cpp-server0    | srv  log_server_r: done request: POST /v1/chat/completions 10.142.124.248 500
    llama-cpp-server0    | srv  proxy_reques: proxying request to model qwen3-coder on port 55847
    llama-cpp-server0    | srv    operator(): http client error: Could not establish connection
    llama-cpp-server0    | srv  log_server_r: done request: POST /v1/chat/completions 10.142.124.248 500
    llama-cpp-server0    | srv  proxy_reques: proxying request to model qwen3-coder on port 55847
    

    Server is as follows:

    llama-cpp-server0    |0m load_backend: loaded BLAS backend from /app/libggml-blas.so
    llama-cpp-server0    |0m ggml_cuda_init: found 2 CUDA devices:
    llama-cpp-server0    |0m   Device 0: Tesla T4, compute capability 7.5, VMM: yes
    llama-cpp-server0    |0m   Device 1: Tesla T4, compute capability 7.5, VMM: yes
    llama-cpp-server0    |0m load_backend: loaded CUDA backend from /app/libggml-cuda.so
    llama-cpp-server0    |0m load_backend: loaded CPU backend from /app/libggml-cpu-haswell.so
    llama-cpp-server0    |0m warn: LLAMA_ARG_HOST environment variable is set, but will be overwritten by command line argument --host
    llama-cpp-server0    |0m main: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true
    llama-cpp-server0    |0m build: 8156 (3769fe6eb) with GNU 11.4.0 for Linux x86_64
    llama-cpp-server0    |0m system info: n_threads = 48, n_threads_batch = 48, total_threads = 96
    llama-cpp-server0    |0m
    llama-cpp-server0    |0m system_info: n_threads = 48 (n_threads_batch = 48) / 96 | CUDA : ARCHS = 500,610,700,750,800,860,890 | USE_GRAPHS =
     1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK
    = 1 |
    
  10. am17an commented on Feb 26, 2026

    @am17an
    Contributor

    If possible provide steps to reproduce. It is most likely that the flash attention kernel is requesting more resources than are available

  11. tlaerm commented on Mar 1, 2026

    @tlaerm

    I tried to reproduce but was not reliably able to. But I think you are right as it only happened when I maxed out the context to fill the VRAM with fit off. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CUDAbugregression

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions