Skip to content

snap: add SYCL backend for Intel GPUs on amd64 - #322

Merged
talhaHavadar merged 1 commit into
talhaHavadar:mainfrom
IsaacJT:itrue/sycl
Oct 6, 2026
Merged

talhaHavadar merged 1 commit into
talhaHavadar:mainfrom
IsaacJT:itrue/sycl

Conversation

@IsaacJT

@IsaacJT IsaacJT commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

The SYCL backend is compiled with the Intel oneAPI toolchain and targets Intel GPUs on amd64. Other architectures and GPUs are not supported with this backend.

This can be configured for use in the same way as the other backends.

Example of using this backend on an 11th Gen Intel CPU with Iris Xe graphics:

$ sudo snap run llama-cpp bench -hf empero-ai/Qwen3.8-4B-Distill-GGUF
load_backend: loaded CPU backend from /snap/llama-cpp/x14/bin/libggml-cpu-icelake.so
Build with Macros:
  GGML_SYCL_DNNL: yes
  GGML_SYCL_F16: no
  GGML_SYCL_FORCE_MMQ: no
  GGML_SYCL_GRAPH: yes
  GGML_SYCL_SUPPORT_LEVEL_ZERO_API: yes
  GGML_SYCL_SUPPORT_VMM: yes
Running with Environment Variables:
  GGML_SYCL_DEBUG: 0
  GGML_SYCL_DEV_DEBUG: 0
  GGML_SYCL_DEV2DEV_MEMCPY: 0 (SYCL API)
  GGML_SYCL_GET_MEM_API: 0 (Level Zero API)
  GGML_SYCL_ENABLE_DNN: 1
  GGML_SYCL_FA_ONEDNN: 1
  GGML_SYCL_FA_ONEDNN_MAX_KV: 0
  GGML_SYCL_ENABLE_MKL_FA: 1
  GGML_SYCL_MEMTRACE: 0
  GGML_SYCL_MEMTRACE_STEP: 64
  GGML_SYCL_ENABLE_FLASH_ATTN: 1
  GGML_SYCL_ENABLE_GRAPH: 0
  GGML_SYCL_ENABLE_OPT: 1
  GGML_SYCL_ENABLE_VMM: 1
  GGML_SYCL_ENABLE_FUSION: 1
  GGML_SYCL_ENABLE_ESIMD: 1
  GGML_SYCL_PRIORITIZE_DMMV: 0
  GGML_SYCL_USE_ASYNC_MEM_OP: 1
  GGML_SYCL_USE_LEVEL_ZERO_API: 1
  GGML_SYCL_USM_SYSTEM: 0
  GGML_SYCL_ENABLE_HOST_PINNED_MEM: 1
  GGML_SYCL_HOST_PINNED_MEM_2G: 0
Found 1 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 Iris Xe Graphics|   12.0|     96|     512|   32| 30947M|           1.14.37020|
SYCL Optimization Feature:
|ID|        Device Type|Reorder|
|--|-------------------|-------|
| 0| [level_zero:gpu:0]|      Y|
load_backend: loaded SYCL backend from /snap/llama-cpp/x14/../components/x14/sycl/lib/ggml/backends/libggml-sycl.so
| model                          |       size |     params | backend    | ngl |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
| qwen35 4B Q4_K - Medium        |   2.58 GiB |     4.33 B | SYCL       |  -1 |           pp512 |        108.74 ± 0.36 |
| qwen35 4B Q4_K - Medium        |   2.58 GiB |     4.33 B | SYCL       |  -1 |           tg128 |          8.02 ± 0.03 |

build: b29c606 (1)

Comment thread cli.sh Outdated
echo
echo "Backend: ${backend:-cpu}"
echo " Configure persistently: sudo snap set llama-cpp backend={cpu,hip,cuda,vulkan,opencl,auto}"
echo " Configure persistently: sudo snap set llama-cpp backend={cpu,hip,cuda,vulkan,opencl,cycl,auto}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: sycl

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

Comment thread snap/snapcraft.yaml
- -DGGML_BUILD_TESTS=OFF
- -DGGML_BUILD_EXAMPLES=OFF
- -DCMAKE_VERBOSE_MAKEFILE=ON
- -DCMAKE_CXX_COMPILER=/opt/intel/oneapi/compiler/latest/bin/icpx

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious if you tried building with the open source compiler from the archive:

  build-packages:
    - on amd64:
      .
      .
      - dpclang-6
  cmake-parameters:
      .
      - -DCMAKE_CXX_COMPILER=/usr/bin/dpclang++-6
      - -DCMAKE_C_COMPILER=/usr/bin/dpclang-6

I'm guessing eventually you would see errors/conflicts because oneMKL, oneDNN, etc I assume were built with the closed source compiler from Intel, but I'm just curious if you tried at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean with the open source compiler but with the oneAPI libraries? I haven't tried that combination yet

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using dpclang++6 seems to override some environment settings or something for SYCL, CMake fails to configure:

2026-09-24 16:44:23.415 :: CMake Error at src/ggml-sycl/CMakeLists.txt:99 (target_link_libraries):
2026-09-24 16:44:23.415 ::   Target "ggml-sycl" links to:
2026-09-24 16:44:23.415 ::
2026-09-24 16:44:23.415 ::     IntelSYCL::SYCL_CXX
2026-09-24 16:44:23.415 ::
2026-09-24 16:44:23.415 ::   but the target was not found.  Possible reasons include:
2026-09-24 16:44:23.415 ::
2026-09-24 16:44:23.415 ::     * There is a typo in the target name.
2026-09-24 16:44:23.416 ::     * A find_package call is missing for an IMPORTED target.
2026-09-24 16:44:23.416 ::     * An ALIAS target is missing.
2026-09-24 16:44:23.416 ::
2026-09-24 16:44:23.416 ::
2026-09-24 16:44:23.416 ::
2026-09-24 16:44:23.417 :: -- Generating done (0.0s)
2026-09-24 16:44:23.417 :: CMake Generate step failed.  Build files cannot be regenerated correctly.

Might work with some more effort but not sure if it's worth it when we need to use the Intel Apt repo anyway

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the open source compiler is very close to feature parity with the closed source compiler (icp, icpx, which you get from Intel's repo). I don't think it would work, I was just curious if you had tried.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might work with some more effort but not sure if it's worth it when we need to use the Intel Apt repo anyway

Yeah totally agree.

Comment thread snap/snapcraft.yaml
build-packages:
- on amd64:
- intel-oneapi-compiler-dpcpp-cpp-2026.1
- intel-oneapi-dnnl-devel-2026.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a FYI, we also have oneDNN in the archive built with the open source oneAPI compiler (libdnnl-sycl3, libdnnl-sycl-dev). I'm not expecting it would work, but if in the future we figure out licensing issues blocking oneMKL from getting into the archive, it appears to me that everything else needed to build the backend is already in the archive, which is good news.

Comment thread snap/snapcraft.yaml
rm -f "${CRAFT_PART_INSTALL}"/usr/lib/"${CRAFT_ARCH_TRIPLET_BUILD_FOR}"/libOpenCL.so*

# Override the built-in .icd file as it contains a hard-coded path
printf '%s\n' 'libigdrcl.so' > \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some snaps I've worked on I used a layout the overcome hard-coded paths, for example here in the audacity snap. I don't recall exactly where a path was hard-coded so not sure if it's exactly what you're fixing here but it is openCL related. Only mentioning it in case you prefer that approach instead, although maybe you don't want to add the layout since it's set even if you don't have the sycl component installed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately because we're using components layouts don't work (afaik)

The SYCL backend is compiled with the Intel oneAPI toolchain and targets
Intel GPUs on amd64. Other architectures and GPUs are not supported
with this backend.

This can be configured for use in the same way as the other backends.
@talhaHavadar

Copy link
Copy Markdown
Owner

@frenchwr how does it look now?

@frenchwr

frenchwr commented Oct 2, 2026

Copy link
Copy Markdown

@frenchwr how does it look now?

LGTM! I didn't test, though.

@talhaHavadar
talhaHavadar merged commit d4a7ad9 into talhaHavadar:main Oct 6, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants