Repository navigation
Compile bug: ggml_backend_sycl_device_get_memory aborts with "failed to get device memory size" on Intel Arc Pro B60 (Battlemage) #28515
Description
Git commit
Environment
GPU: Sparkle Arc Pro B60 24GB (Battlemage G21, PCI device 8086:e211)
OS: Ubuntu 26.04 LTS (Resolute), fresh install
Kernel: 7.0.0-31-generic
Kernel GPU driver: xe (confirmed correct driver for Battlemage — i915 does NOT support Battlemage compute, only basic display)
GuC firmware: xe/bmg_guc_70.bin version 70.58.0 (loaded successfully, confirmed via dmesg)
HuC firmware: xe/bmg_huc.bin version 8.2.10 (loaded successfully)
Compute stack: libze-intel-gpu1 / intel-opencl-icd 26.31.39395.13-126.04ppa1 (kobuk-team/intel-graphics PPA)
oneAPI: 2026.1 (intel-oneapi-compiler-dpcpp-cpp, intel-oneapi-mkl-devel)
llama.cpp: built from master branch, same-day checkout, SYCL backend (-DGGML_SYCL=ON -DGGML_SYCL_F16=ON, icx/icpx compilers)
Operating systems
Linux
GGML backends
SYCL
Problem description & steps to reproduce
sycl-ls confirms the device is correctly detected before running llama.cpp: [level_zero:gpu][level_zero:0] Intel(R) oneAPI Unified Runtime over Level-Zero V2, Intel(R) Arc(TM) Pro B60 Graphics 20.1.0 [1.17.39395+13]
[opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Arc(TM) Pro B60 Graphics OpenCL 3.0 NEO [26.31.39395.13]
llama-server (and presumably llama-cli) aborts immediately on model load with: /home/geo/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp:6101: [ggml_backend_sycl_device_get_memory] failed to get device memory size
Full backtrace:
/home/geo/llama.cpp/build/bin/libggml-base.so.0(+0x17d48) [0x7031cbe31d48]
/home/geo/llama.cpp/build/bin/libggml-base.so.0(ggml_print_backtrace+0x285) [0x7031cbe31d25]
/home/geo/llama.cpp/build/bin/libggml-base.so.0(ggml_abort+0x109) [0x7031cbe30d99]
/home/geo/llama.cpp/build/bin/libggml-sycl.so.0(+0x230c76) [0x7031c6c30c76]
/home/geo/llama.cpp/build/bin/libggml-sycl.so.0(+0x230d97) [0x7031c6c30d97]
/home/geo/llama.cpp/build/bin/libllama.so.0(+0xaf808) [0x7031cacaf808]
/home/geo/llama.cpp/build/bin/libllama.so.0(llama_model_load_from_file+0xfc) [0x7031cacb097c]
... (common_init_from_params / server_context_impl::load_model chain)
This reproduces on a completely fresh OS install with current drivers/firmware/oneAPI — ruling out stale config, leftover packages, or a driver mismatch as the cause. Also reproduces identically whether the system has one or two B60 cards installed, so it is not specific to multi-GPU configurations.
Root cause (best guess)
get_memory_size() in ggml-sycl.cpp calls into a Level-Zero/SYCL memory-query API that appears to return failure on this specific GPU/driver/firmware combination, even though the device is otherwise fully functional (confirmed by clinfo, sycl-ls, and xpu-smi all reporting the device correctly). The current code treats any query failure as fatal via GGML_ABORT, with no fallback path.
Fix / Workaround
Replacing the hard abort with a fallback value lets the model load and run normally. Confirmed working on this hardware:
File: ggml/src/ggml-sycl/ggml-sycl.cpp, ggml_backend_sycl_device_get_memory() (~line 6101 on current master; also a second occurrence a few lines later in a related function)
Before: cpp
if (!res) {
GGML_ABORT("[%s] failed to get device memory size", func);
}
THE FIX!
if (!res) {
GGML_LOG_WARN("[%s] failed to get device memory size, using fallback\n", func);
*total = 25769803776ULL;
*free = 25769803776ULL;
}
(25769803776 = 24GB in bytes, matching this card's VRAM — should ideally be derived from actual card VRAM rather than hardcoded, but works as an immediate fallback since it's used consistently across both occurrences in the file.)
Applied via: sed -i 's/GGML_ABORT("[%s] failed to get device memory size", func);/GGML_LOG_WARN("[%s] failed to get device memory size, using fallback\n", func);\n *total = 25769803776ULL;\n *free = 25769803776ULL;/' ggml/src/ggml-sycl/ggml-sycl.cpp
First Bad Commit
cpp
if (!res) {
GGML_ABORT("[%s] failed to get device memory size", func);
}
Compile command
source /opt/intel/oneapi/setvars.sh --force
cd llama.cpp
cmake -B build -DGGML_SYCL=ON -DGGML_SYCL_F16=ON \
-DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \
-DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG" -DLLAMA_CURL=OFF
cmake --build build --config Release -j4Relevant log output
0.00.121.120 I cmn common_param: common_params_print_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
0.00.121.365 W srv llama_server: -----------------
0.00.121.366 W srv llama_server: CORS is set to allow all origins ('*') and no API key is set
0.00.121.366 W srv llama_server: this can be a security risk (cross-origin attacks)
0.00.121.367 W srv llama_server: more info: https://github.com/ggml-org/llama.cpp/pull/25655
0.00.121.367 W srv llama_server: -----------------
0.00.122.539 I srv load_model: loading model '/STORE/sept_2026/Qwen3.8-27B-Uncensored-Q6_K.gguf'
/home/geo/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp:6101: [ggml_backend_sycl_device_get_memory] failed to get device memory size
/home/geo/llama.cpp/build/bin/libggml-base.so.0(+0x17d48) [0x7031cbe31d48]
/home/geo/llama.cpp/build/bin/libggml-base.so.0(ggml_print_backtrace+0x285) [0x7031cbe31d25]
/home/geo/llama.cpp/build/bin/libggml-base.so.0(ggml_abort+0x109) [0x7031cbe30d99]
/home/geo/llama.cpp/build/bin/libggml-sycl.so.0(+0x230c76) [0x7031c6c30c76]
/home/geo/llama.cpp/build/bin/libggml-sycl.so.0(+0x230d97) [0x7031c6c30d97]
/home/geo/llama.cpp/build/bin/libllama.so.0(+0xaf808) [0x7031cacaf808]
/home/geo/llama.cpp/build/bin/libllama.so.0(llama_model_load_from_file+0xfc) [0x7031cacb097c]
/home/geo/llama.cpp/build/bin/libllama-common.so.0(+0x2063f2) [0x7031cb4063f2]
/home/geo/llama.cpp/build/bin/libllama-common.so.0(+0x206e27) [0x7031cb406e27]
/home/geo/llama.cpp/build/bin/libllama-common.so.0(_Z17common_fit_paramsPKcP18llama_model_paramsP20llama_context_paramsPfP32llama_model_tensor_buft_overridePmjPK22common_fit_extra_model14ggml_log_level+0x4f) [0x7031cb406b0f]
/home/geo/llama.cpp/build/bin/libllama-common.so.0(_ZN18common_init_resultC2ER13common_paramsb+0x52e) [0x7031cb3df21e]
/home/geo/llama.cpp/build/bin/libllama-common.so.0(_Z23common_init_from_paramsR13common_paramsb+0x34) [0x7031cb3e1a44]
/home/geo/llama.cpp/build/bin/libllama-server-impl.so(_ZN19server_context_impl10load_modelER13common_params+0x977) [0x7031cb931a27]
/home/geo/llama.cpp/build/bin/libllama-server-impl.so(_Z12llama_serverR13common_paramsiPPc+0x8e90) [0x7031cb893940]
/home/geo/llama.cpp/build/bin/libllama-server-impl.so(_Z12llama_serveriPPc+0x7f) [0x7031cb88471f]
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x2a601) [0x7031c622a601]
/usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x88) [0x7031c622a718]
/home/geo/llama.cpp/build/bin/llama-server() [0x406415]
Activity
dgv21 commentedon Sep 6, 2026
The fix is in the bug report above. You are welcome!
arthw commentedon Sep 7, 2026
@dgv21
It's fixed by PR: #28227.
Install level-zero dev package will make it work well too.
Thank you!