Repository navigation
snap: add SYCL backend for Intel GPUs on amd64 - #322
Conversation
| 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}" |
| - -DGGML_BUILD_TESTS=OFF | ||
| - -DGGML_BUILD_EXAMPLES=OFF | ||
| - -DCMAKE_VERBOSE_MAKEFILE=ON | ||
| - -DCMAKE_CXX_COMPILER=/opt/intel/oneapi/compiler/latest/bin/icpx |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
You mean with the open source compiler but with the oneAPI libraries? I haven't tried that combination yet
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| build-packages: | ||
| - on amd64: | ||
| - intel-oneapi-compiler-dpcpp-cpp-2026.1 | ||
| - intel-oneapi-dnnl-devel-2026.0 |
There was a problem hiding this comment.
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.
| 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' > \ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
@frenchwr how does it look now? |
LGTM! I didn't test, though. |
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: