Repository navigation
Closed
Labels
bug-unconfirmedcritical severityUsed to report critical severity bugs in llama.cpp (e.g. Crashing, Corrupted, Dataloss)stale
Description
What happened?
Native API failed. Native API returns: -999 (Unknown PI error) -999 (Unknown PI error)
Exception caught at file:D:/a/llama.cpp/llama.cpp/ggml/src/ggml-sycl.cpp, line:4207, func:operator()
SYCL error: CHECK_TRY_ERROR((*stream).memcpy((char *)tensor->data + offset, host_buf, size) .wait()): Meet error in this line code!
in function ggml_backend_sycl_buffer_set_tensor at D:/a/llama.cpp/llama.cpp/ggml/src/ggml-sycl.cpp:4207
D:\a\llama.cpp\llama.cpp\ggml\src\ggml-sycl\common.hpp:107: SYCL error
Name and Version
version: 3616 (11b84eb)
built with MSVC 19.40.33813.0 for
What operating system are you seeing the problem on?
windows11 23H2
Relevant log output
Active code page: 65001
:: initializing oneAPI environment...
Initializing Visual Studio command-line environment...
Visual Studio version 17.11.0 environment configured.
"C:\Program Files\Microsoft Visual Studio\2022\Community\"
Visual Studio command-line environment initialized for: 'x64'
: advisor -- latest
: compiler -- latest
: dal -- latest
: debugger -- latest
: dev-utilities -- latest
: dnnl -- latest
: dpcpp-ct -- latest
: dpl -- latest
: ipp -- latest
: ippcp -- latest
: mkl -- latest
: ocloc -- latest
: tbb -- latest
: vtune -- latest
:: oneAPI environment initialized ::
INFO [ main] build info | tid="22908" timestamp=1724947942 build=3616 commit="11b84eb4"
INFO [ main] system info | tid="22908" timestamp=1724947942 n_threads=6 n_threads_batch=-1 total_threads=12 system_info="AVX = 1 | AVX_VNNI = 0 | AVX2 = 1 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | AVX512_BF16 = 0 | FMA = 1 | NEON = 0 | SVE = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 | LLAMAFILE = 1 | "
INFO [ main] HTTP server is listening | tid="22908" timestamp=1724947942 hostname="0.0.0.0" port="8080" n_threads_http="11"
INFO [ main] loading model | tid="22908" timestamp=1724947942 hostname="0.0.0.0" port="8080" n_threads_http="11"
llama_model_loader: loaded meta data with 20 key-value pairs and 483 tensors from F:\llama.cpp\models\qwen1.5-14b-vntl.Q4_K_S.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = qwen2
llama_model_loader: - kv 1: general.name str = Qwen1.5-14B-Chat-jp2zh-fp16
llama_model_loader: - kv 2: qwen2.block_count u32 = 40
llama_model_loader: - kv 3: qwen2.context_length u32 = 32768
llama_model_loader: - kv 4: qwen2.embedding_length u32 = 5120
llama_model_loader: - kv 5: qwen2.feed_forward_length u32 = 13696
llama_model_loader: - kv 6: qwen2.attention.head_count u32 = 40
llama_model_loader: - kv 7: qwen2.attention.head_count_kv u32 = 40
llama_model_loader: - kv 8: qwen2.rope.freq_base f32 = 1000000.000000
llama_model_loader: - kv 9: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001
llama_model_loader: - kv 10: general.file_type u32 = 14
llama_model_loader: - kv 11: tokenizer.ggml.model str = gpt2
llama_model_loader: - kv 12: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv 13: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv 14: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv 15: tokenizer.ggml.eos_token_id u32 = 151645
llama_model_loader: - kv 16: tokenizer.ggml.padding_token_id u32 = 151643
llama_model_loader: - kv 17: tokenizer.ggml.bos_token_id u32 = 151643
llama_model_loader: - kv 18: tokenizer.chat_template str = {% for message in messages %}{% if lo...
llama_model_loader: - kv 19: general.quantization_version u32 = 2
llama_model_loader: - type f32: 201 tensors
llama_model_loader: - type q5_0: 35 tensors
llama_model_loader: - type q5_1: 5 tensors
llama_model_loader: - type q4_K: 237 tensors
llama_model_loader: - type q5_K: 4 tensors
llama_model_loader: - type q6_K: 1 tensors
llm_load_vocab: missing pre-tokenizer type, using: 'default'
llm_load_vocab:
llm_load_vocab: ************************************
llm_load_vocab: GENERATION QUALITY WILL BE DEGRADED!
llm_load_vocab: CONSIDER REGENERATING THE MODEL
llm_load_vocab: ************************************
llm_load_vocab:
llm_load_vocab: special tokens cache size = 421
llm_load_vocab: token to piece cache size = 0.9352 MB
llm_load_print_meta: format = GGUF V3 (latest)
llm_load_print_meta: arch = qwen2
llm_load_print_meta: vocab type = BPE
llm_load_print_meta: n_vocab = 152064
llm_load_print_meta: n_merges = 151387
llm_load_print_meta: vocab_only = 0
llm_load_print_meta: n_ctx_train = 32768
llm_load_print_meta: n_embd = 5120
llm_load_print_meta: n_layer = 40
llm_load_print_meta: n_head = 40
llm_load_print_meta: n_head_kv = 40
llm_load_print_meta: n_rot = 128
llm_load_print_meta: n_swa = 0
llm_load_print_meta: n_embd_head_k = 128
llm_load_print_meta: n_embd_head_v = 128
llm_load_print_meta: n_gqa = 1
llm_load_print_meta: n_embd_k_gqa = 5120
llm_load_print_meta: n_embd_v_gqa = 5120
llm_load_print_meta: f_norm_eps = 0.0e+00
llm_load_print_meta: f_norm_rms_eps = 1.0e-06
llm_load_print_meta: f_clamp_kqv = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: f_logit_scale = 0.0e+00
llm_load_print_meta: n_ff = 13696
llm_load_print_meta: n_expert = 0
llm_load_print_meta: n_expert_used = 0
llm_load_print_meta: causal attn = 1
llm_load_print_meta: pooling type = 0
llm_load_print_meta: rope type = 2
llm_load_print_meta: rope scaling = linear
llm_load_print_meta: freq_base_train = 1000000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn = 32768
llm_load_print_meta: rope_finetuned = unknown
llm_load_print_meta: ssm_d_conv = 0
llm_load_print_meta: ssm_d_inner = 0
llm_load_print_meta: ssm_d_state = 0
llm_load_print_meta: ssm_dt_rank = 0
llm_load_print_meta: ssm_dt_b_c_rms = 0
llm_load_print_meta: model type = 13B
llm_load_print_meta: model ftype = Q4_K - Small
llm_load_print_meta: model params = 14.17 B
llm_load_print_meta: model size = 7.97 GiB (4.83 BPW)
llm_load_print_meta: general.name = Qwen1.5-14B-Chat-jp2zh-fp16
llm_load_print_meta: BOS token = 151643 '<|endoftext|>'
llm_load_print_meta: EOS token = 151645 '<|im_end|>'
llm_load_print_meta: PAD token = 151643 '<|endoftext|>'
llm_load_print_meta: LF token = 148848 'ÄĬ'
llm_load_print_meta: EOT token = 151645 '<|im_end|>'
llm_load_print_meta: max token length = 256
ggml_sycl_init: GGML_SYCL_FORCE_MMQ: no
ggml_sycl_init: SYCL_USE_XMX: yes
ggml_sycl_init: found 2 SYCL devices:
llm_load_tensors: ggml ctx size = 0.64 MiB
llm_load_tensors: offloading 40 repeating layers to GPU
llm_load_tensors: offloading non-repeating layers to GPU
llm_load_tensors: offloaded 41/41 layers to GPU
llm_load_tensors: SYCL0 buffer size = 5005.04 MiB
llm_load_tensors: SYCL1 buffer size = 2739.81 MiB
llm_load_tensors: CPU buffer size = 417.66 MiB
.........................................................................................
llama_new_context_with_model: n_ctx = 32768
llama_new_context_with_model: n_batch = 2048
llama_new_context_with_model: n_ubatch = 512
llama_new_context_with_model: flash_attn = 0
llama_new_context_with_model: freq_base = 1000000.0
llama_new_context_with_model: freq_scale = 1
[SYCL] call ggml_check_sycl
ggml_check_sycl: GGML_SYCL_DEBUG: 0
ggml_check_sycl: GGML_SYCL_F16: no
found 2 SYCL devices:
| | | | |Max | |Max |Global |
|
| | | | |compute|Max work|sub |mem |
|
|ID| Device Type| Name|Version|units |group |group|size | Driver version|
|--|-------------------|---------------------------------------|-------|-------|--------|-----|-------|---------------------|
| 0| [level_zero:gpu:0]| Intel Arc A770 Graphics| 1.5| 512| 1024| 32| 16704M| 1.3.30398|
| 1| [level_zero:gpu:1]| Intel Arc A750 Graphics| 1.5| 448| 1024| 32| 8319M| 1.3.30398|
llama_kv_cache_init: SYCL0 KV buffer size = 17920.00 MiB
llama_kv_cache_init: SYCL1 KV buffer size = 7680.00 MiB
llama_new_context_with_model: KV self size = 25600.00 MiB, K (f16): 12800.00 MiB, V (f16): 12800.00 MiB
llama_new_context_with_model: SYCL_Host output buffer size = 1.16 MiB
llama_new_context_with_model: SYCL0 compute buffer size = 2664.00 MiB
llama_new_context_with_model: SYCL1 compute buffer size = 2664.00 MiB
llama_new_context_with_model: SYCL_Host compute buffer size = 74.01 MiB
llama_new_context_with_model: graph nodes = 1406
llama_new_context_with_model: graph splits = 3
Native API failed. Native API returns: -999 (Unknown PI error) -999 (Unknown PI error)
Exception caught at file:D:/a/llama.cpp/llama.cpp/ggml/src/ggml-sycl.cpp, line:4207, func:operator()
SYCL error: CHECK_TRY_ERROR((*stream).memcpy((char *)tensor->data + offset, host_buf, size) .wait()): Meet error in this line code!
in function ggml_backend_sycl_buffer_set_tensor at D:/a/llama.cpp/llama.cpp/ggml/src/ggml-sycl.cpp:4207
D:\a\llama.cpp\llama.cpp\ggml\src\ggml-sycl\common.hpp:107: SYCL errorMetadata
Metadata
Assignees
Labels
bug-unconfirmedcritical severityUsed to report critical severity bugs in llama.cpp (e.g. Crashing, Corrupted, Dataloss)stale
Activity
NeoZhangJianyu commentedon Aug 30, 2024
Could you share the whole cmd line and the link of GGUF file?
DDXDB commentedon Aug 31, 2024
This is a complete CMD cil, GGUF is https://huggingface.co/Qwen/Qwen1.5-14B-Chat-GGUF
But I don't think there's a problem with GGUF, plus the final "D:\a\llama.cpp\llama.cpp\ggml\src\ggml-sycl\common.hpp" doesn't seem to exist on my computer
qnixsynapse commentedon Sep 2, 2024
It's from here: https://github.com/ggerganov/llama.cpp/blob/master/ggml%2Fsrc%2Fggml-sycl%2Fcommon.hpp#L107
NeoZhangJianyu commentedon Sep 3, 2024
@DDXDB
I wan to know whole CMD with parameters.
DDXDB commentedon Sep 6, 2024
github-actions commentedon Oct 21, 2024
This issue was closed because it has been inactive for 14 days since being marked as stale.
aaricantto commentedon Jan 11, 2026
Quick question since this looks very similar to what I’m seeing now:
Did you ever check whether “Above 4G Decoding” was enabled in your motherboard BIOS?
I’ve run into the same kind of SYCL / device memory errors, and this setting can cause exactly these failures on multi-GPU systems if it’s disabled.
edit: additional context
Failure
NeoZhangJianyu commentedon Jan 11, 2026
@aaricantto
“Above 4G Decoding” is mandatory requirement to support 4GB+ memory on GPU.
It also supports to access the GPU memory by CPU quickly (with ResizeBar feature).
SYCL backend doesn't check this parameter of BIOS.
I think the GPU memory size checking by SYCL is the physical memory size, instead of accessible memory size.
So, it detect and get 24GB memory, but meet error when access the memory out of 4GB.
Let me check if there is simple method to detect the values of “Above 4G Decoding” and "ResizeBar".
Thank you for your sharing and suggestion.
aaricantto commentedon Jan 13, 2026
After checking the BIOS I can confirm that "resizable bar" setting was disabled -
After enabling in the BIOS the intel graphics driver now recognizes ReBAR BUT one of the GPUs still just will not work!
Any additional advice would help!
EDIT 1:
Enabling / disabling the display adapter from Device Manager enables Inference on each card.
LLAMA CPP logs:
OLLAMA LOGS:
NeoZhangJianyu commentedon Jan 13, 2026
@aaricantto
Let me check this LLM granite-4.0-h-micro-Q4_K_M.gguf.
It askes more memory by the error log.
Thank you!
NeoZhangJianyu commentedon Jan 13, 2026
@aaricantto
I run this model with latest llama.cpp SYCL backend on Arc770 Ubuntu 22.04. It's passed.
When I unset ONEAPI_DEVICE_SELECTOR, I meet the similar error because there are dGPU and iGPU in my PC.
Looks like there is an issue in the case of multiple GPUs with this LLM.
set ONEAPI_DEVICE_SELECTOR=level_zero:x
Run xxx\build-x64-windows-sycl-release\bin\sycl-ls.exe
Confirm the only a B60 is enabled.
Share the log to me.
Could you run the parameters like examples\sycl\win-run-llama2.bat? It provides more debug info.
Then share the whole log.
The llama.cpp in it is close source.
We can't check the source code for the info of the log.
The log can't help for debug.
Please use llama.cpp SYCL backend and provide the release info.
It's easy to debug.
Thank you!
10 remaining items
aaricantto commentedon Jan 15, 2026
Intel Arc Multi-GPU SYCL Layer Offload Issue Report
To report additional behaviour I tested various GPU and Model Layer allocations:
GPU: 2x ARC B60 dGPU (physical PCIe separation)
RELEASE: llama-b5377-bin-win-sycl-x64
MODEL: Qwen2.5-3B-Instruct-Q4_K_M.gguf # 37 total Layers
Intro: Three Tests
GPU.0, GPU.1, and GPU.1 again, with 36/37 loaded weights
Both SYCL devices are enabled via
ONEAPI_DEVICE_SELECTORParameter Definitions
-ngl(--gpu-layers) # number of GPU layers to offload (including output layer)-mg(--main-gpu) # 0 or 1 in my case (0 being the device closest to the CPU)-sm(--split-mode) # 'layer' for 2xGPU, else exclude-ts(--tensor-split) # models to offload to (e.g.,-ts 1,1for even split)1. SINGLE GPU - GPU.0 - (-sm none -mg 0 -ngl 37) [Working]
load_tensors: offloaded 37/37 layers to GPU → Model generates completely fine
✅ Beautiful [ gpu.0 ]
2. SINGLE GPU - GPU.1 - (-sm none -mg 1 -ngl 37) [Broken]
❌ CRASH [ gpu.1 ]
3. SINGLE GPU - GPU.1 - (-sm none -mg 1 -ngl 36) [Workaround]
!!! load_tensors: offloaded 36/37 layers to GPU
Semi Conclusion
Underloading layers on device level_zero:1 - cannot run all weights on GPU.1
And it works a Charm → SO it's not really a problem with loading model weights into multiple Intel GPUs, rather the second/last GPU has issues with the output layer.
From the logs above, the missing layer on the second card costs me ~20 TPS during eval on single card inference.
Pipeline Parallel Case
Intel config:
ONEAPI_DEVICE_SELECTOR=gpullama.cpp config:
-sm layer -ts 1,1The multi-GPU case only amplifies this TPS degradation:
Performance Impact: 77% throughput degradation (58.18 → 13.63 t/s)
Final Conclusion
GPU.0 (Primary) handles full 37/37 layer offload perfectly. GPU.1 (Secondary) crashes with SYCL error when loading all 37 layers, specifically failing on the output layer.
Workaround: Limit GPU.1 to 36/37 layers (output on CPU) for stability, accepting ~32% performance loss in single-GPU mode and ~77% loss in pipeline parallel mode.
NOTE: only works in "llama-b5377-bin-win-sycl-x64"
I have also tested the windows release
llama-b7740-bin-win-sycl-x64and also built from source today:EDIT - version I built from src is same as latest release "llama-b5377-bin-win-sycl-x64" works in this strange model weight offloading case
C:\llama_cpp>llama-from-src\build\bin\llama-cli.exe --version
version: 7740 (cff777f)
built with IntelLLVM 2025.3.0 for Windows AMD64
aaricantto commentedon Jan 15, 2026
Update: Cause Identified Between b7464 → b7470 ?
TL;DR
The issue is NOT in the layer counting logic changes (those happened earlier and still worked). The breaking change is in memory allocation strategy between b7464 (working) and b7470 (broken).
keep in mind this is only for the n-1/n mult-GPU solution, and does not yet resolve n/n weight loading - but will at least allow for separate servers running 37/37 and 36/37 on newer builds
My Testing Timeline
I've been systematically bisecting builds to find the exact breaking point:
"WORKING" builds (GPU.1 @ 36/37 layers):
BROKEN builds (GPU.1 fails even at 36/37):
What Changed Between b7464 and b7470
I extracted the diff focusing on model loading code:
The key changes appear to be in
llama-mmap.cppandllama-model-loader.cpp- specifically around:Why This Matters
Before b7470 (working):
After b7470 (broken):
UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORYggml_backend_sycl_get_tensor_asyncTheory
The b7470 changes likely introduced:
GPU.0 (primary) has priority DMA access and handles everything fine.
GPU.1 (secondary) hits driver limits with the new allocation strategy.
Request for Help
@NeoZhangJianyu - Could you check the
llama-mmap.cppandllama-model-loader.cppchanges between b7464 and b7470?Specifically looking for:
I'm not familiar enough with the C++ codebase to patch this myself, but I can continue testing any potential fixes on my dual Arc B60 setup.
Hardware: 2× Intel Arc Pro B60 (separate PCIe slots)
Driver: Level Zero 1.13.35716
Models tested: Qwen2.5-3B (37 layers), Qwen3-Coder-30B (49 layers)
Consistent behavior: GPU.0 perfect, GPU.1 OOM crash with latest builds
aaricantto commentedon Jan 15, 2026
Patch that re-enabled 36/37 on GPU.1 -> unfortunately still does not enable 37/37 GPU.1 or multi GPU
NeoZhangJianyu commentedon Jan 16, 2026
@aaricantto
There are several PRs between 7464-7470.
Could you help narrow down the detailed PR to impact your case?
I can't reproduce this issue in my PC.
Thank you!
aaricantto commentedon Jan 16, 2026
The "n-1/n weights on GPU1" trick breaks at 57c1e05 "llama: offload output layer to GPU first (#18148)"
works on 9cff4cc
NeoZhangJianyu commentedon Jan 16, 2026
@aaricantto
I add comment to the PR and ask the author to check it. #18148 (comment)
Thank you!.
aaricantto commentedon Jan 16, 2026
Thanks - here is my final reasoning:
I suspect the crux of the issue here is the output layer in the second GPU
Reversing the order of the weight loading (putting the output layer first) means that (for 36 repeating + 1 output layer)
PRE 57c1e05
set LLAMA_ARG_N_GPU_LAYERS=36 -> output layer loaded last, output layer loaded into CPU -> n-1 workaround
set LLAMA_ARG_N_GPU_LAYERS=37 -> output layer loaded last, attempted load in GPU -> SYCL Error
POST 57c1e05
set LLAMA_ARG_N_GPU_LAYERS=1 (of 37) -> output layer loaded first, attempted load in GPU -> SYCL Error
set LLAMA_ARG_N_GPU_LAYERS=0 (of 37) -> output layer loaded first, output layer loaded into CPU -> THIS WORKS
GPU1 cannot host the output layer tensor without triggering Level Zero OOM. -> bug has existed as far back as b5377 -> pre 57c1e05 the bug could be avoided by forcing output layer onto CPU (36/37) -> after inverting the order of output layer loading workaround breaks.
aaricantto commentedon Jan 16, 2026
Another Helpful Flag:
-ot "token_embd.weight=CPU"Ok I cannot tell you why this fixed it unfortunately, but this flag has completely resolved my problems. And it works on latest build.
Multi-GPU Pipeline Parallel [2x B60] - latest build b7470
Single GPU1 - pre 57c1e05 build with b7464 (n-1/n worked here)
Inference speeds are great, and all is working now! I'm not sure what else to comment on for the Devs, as I suspect this error will be on a per-model basis depending on the structure of the output layer. But the logs did make note that
So perhaps instead of causing a memcpy error perhaps attempt cpu offload first for the multi-gpu systems!?
I'm also still unsure why GPU1 requires this, but GPU0 does not.
Special thanks to @NeoZhangJianyu and looking forward to see this project evolve more!
edit 1:
For larger models I am also forced offload output.weight
Qwen 7b does load -> but TPS is degraded unlike qwen3b above
Qwen 30B coder won't even load with this setup (loaded fine pre 57ce7ae47 using the n-1/n trick)
NeoZhangJianyu commentedon Jan 16, 2026
@aaricantto
Thank you for your checking and share!
I think this workaround can avoid to trigger the error to load the output layer to GPU.
I think the llama.cpp should work well with multiple GPUs without special parameters, like ""token_embd.weight=CPU".
I will check and study the solution to restore to support GPUs the smoothly.
The debug cost is huge for the architecture issue.
aaricantto commentedon Jan 19, 2026
Resolved?
Ok I have a fix, the bug is related to SYCL malloc contexts. I will refine my diff and make a PR this week as well as clean up my previous messages in this issue - this is not a level zero error and should be reopened
You will see from the llama.cpp exit statistics below:
Tests
Is this the first ever llama.cpp deployment for multiple Intel GPUs using the SYCL backend? lol
Parameters
Split Tensor
SYCL1
SYCL0
aaricantto commentedon Jan 20, 2026
Maybe someone with a better understand of shared malloc contexts in sycl could have a look at this... and optimize - working on 6df686b
PATCH (with logging and comments)
sycl-multigpu-fix.patch
it would be interesting to see if this fixes your iGPU case as well @NeoZhangJianyu
NeoZhangJianyu commentedon Jan 20, 2026
@aaricantto
It's great to see your patch.
In SYCL, the memory copy of device to device must be in same context.
It's known limitation.
In base code, I use a workaround: copy data from device-host-device.
Since your patch fixed the issue, that means there is code to copy from device to device.
It's forbidden if both devices are not in same context.
I will fix this issue based on your patch.
And I need you support to verify it after it's ready.
It's also needed to consider the case that iGPU+dGPU in same time. I will test for it.
Thank you very much!
arthw commentedon Jan 21, 2026
@aaricantto
Could you test the PR: #18992?
Thank you!
aaricantto commentedon Jan 21, 2026
I get the Same build error presenting in "windows-latest-cmake-sycl'
arthw commentedon Jan 22, 2026
Sorry, I forgot to test on windows.
I will fix it.
Thank you!