Skip to content

Eval bug: DeepSeek V4 Flash crash on CUDA + AMD BLIS (AOCL-BLAS), "illegal memory access" in ggml_backend_cuda_synchronize #25598

Description

@vbooka1

Name and Version

build 9977 https://github.com/ggml-org/llama.cpp/releases/tag/b9977
also tested on 9950, same crash

Operating systems

Linux

GGML backends

CUDA

Hardware

AMD EPYC4 + NVIDIA RTX PRO 6000
CUDA : ARCHS = 1200 | FORCE_CUBLAS = 1 | USE_GRAPHS = 1 | BLACKWELL_NATIVE_FP4 = 1 | 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 | OPENMP = 1 | REPACK = 1

Models

DeepSeek V4 Flash UD-Q8_K_X from https://huggingface.co/unsloth/DeepSeek-V4-Flash-GGUF/tree/main/UD-Q8_K_XL

Problem description & steps to reproduce

The model loads correctly except a few warnings:

0.42.404.971 W llama_kv_cache_iswa: using full-size SWA cache (ref: https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
0.42.452.100 W resolve_fused_ops: layer 2 is assigned to device CUDA0 but Lightning Indexer is assigned to device CPU (usually due to missing support)
0.42.452.106 W resolve_fused_ops: Lightning Indexer not supported, set to disabled

But crashes on the very first request, "CUDA error: an illegal memory access was encountered", "in function ggml_backend_cuda_synchronize at llama.cpp-b9977/ggml/src/ggml-cuda/ggml-cuda.cu:2388"

./llama-server -m DeepSeek-V4-Flash-UD-Q8_K_XL-00001-of-00005.gguf --ctx-size 65536 --n-gpu-layers 99 --flash-attn on --no-mmap --mlock --swa-full --parallel 1 --direct-io --jinja --reasoning off --fit off -ot "long override string........" 

First Bad Commit

No response

Relevant log output

Logs
0.00.265.723 I cmn  common_param: common_params_print_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
0.00.381.272 I srv    load_model: loading model 'DeepSeek-V4-Flash-UD-Q8_K_XL-00001-of-00005.gguf'
0.42.404.971 W llama_kv_cache_iswa: using full-size SWA cache (ref: https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
0.42.452.100 W resolve_fused_ops: layer 2 is assigned to device CUDA0 but Lightning Indexer is assigned to device CPU (usually due to missing support)
0.42.452.106 W resolve_fused_ops: Lightning Indexer not supported, set to disabled
0.42.716.877 W srv    load_model: swa_full is not supported by this model, it will be disabled
0.42.933.509 I srv    load_model: initializing, n_slots = 1, n_ctx_slot = 65536, kv_unified = 'false'
0.42.955.146 I srv  llama_server: model loaded
0.42.955.154 I srv  llama_server: listening on http://...:8080
1.46.950.861 I slot get_availabl: id  0 | task -1 | selected slot by LRU, t_last = -1
1.46.951.156 I slot launch_slot_: id  0 | task 0 | processing task, is_child = 0
llama.cpp-b9977/ggml/src/ggml-cuda/ggml-cuda.cu:104: CUDA error
1.48.044.118 E CUDA error: an illegal memory access was encountered
1.48.044.125 E   current device: 0, in function ggml_backend_cuda_synchronize at llama.cpp-b9977/ggml/src/ggml-cuda/ggml-cuda.cu:2388
1.48.044.126 E   cudaStreamSynchronize(cuda_ctx->stream())
[New LWP 208793]
...
[New LWP 208678]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fffed8a69ee in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#0  0x00007fffed8a69ee in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fffed89b668 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007fffed89b6ad in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007fffed9067c7 in wait4 () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x000000000187a8cb in ggml_print_backtrace ()
#5  0x000000000187aa18 in ggml_abort ()
#6  0x0000000000bd7cf3 in ggml_cuda_error(char const*, char const*, char const*, int, char const*) ()
#7  0x0000000000bd9306 in ggml_backend_cuda_synchronize(ggml_backend*) ()
#8  0x000000000189ad95 in ggml_backend_sched_compute_splits(ggml_backend_sched*) ()
#9  0x000000000094d9c1 in llama_context::graph_compute(ggml_cgraph*, bool) ()
#10 0x000000000095362a in llama_context::process_ubatch(llama_ubatch const&, llm_graph_type, llama_memory_context_i*, ggml_status&) ()
#11 0x000000000095a485 in llama_context::decode(llama_batch const&) ()
#12 0x000000000095bcab in llama_decode ()
#13 0x0000000000604ec4 in server_context_impl::decode(int&, int, llama_batch&) ()
#14 0x0000000000607373 in server_context_impl::update_slots() ()
#15 0x00000000005b5911 in server_queue::start_loop(long) ()
#16 0x000000000055db83 in llama_server(common_params&, int, char**) ()
#17 0x000000000055f92f in llama_server(int, char**) ()
#18 0x00007fffed835ca8 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#19 0x00007fffed835d65 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#20 0x00000000005561e1 in _start ()
[Inferior 1 (process 208677) detached]

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