Skip to content

nix: expose a SYCL package - #31066

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
Titaniumtown:pr/sycl-nix-improvements
Nov 17, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
Titaniumtown:pr/sycl-nix-improvements

Conversation

@Titaniumtown

Copy link
Copy Markdown
Contributor

Overview

Adds a SYCL nix package/target. I have been using this locally for many months w/o issues.

Requirements

@github-actions github-actions Bot added nix Issues specific to consuming flake.nix, or generally concerned with ❄ Nix-based llama.cpp deployment devops improvements to build systems and github actions labels Oct 24, 2026
@Titaniumtown

Copy link
Copy Markdown
Contributor Author

@SomeoneSerge Hi can you please review? It would be great to have proper packaging for this backend.

@Titaniumtown Titaniumtown added the SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language label Nov 1, 2026
@Titaniumtown
Titaniumtown removed the request for review from SomeoneSerge November 10, 2026 04:53
@Titaniumtown

Copy link
Copy Markdown
Contributor Author

Seems Serge is embroiled in some sort of controversy; @ggerganov do you mind merging this? Thank you!

@Titaniumtown
Titaniumtown force-pushed the pr/sycl-nix-improvements branch from 94bf9ea to 08df106 Compare November 10, 2026 05:04

@arthw arthw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need add more depended package of oneAPI.
Please refer to releas.yml: https://github.com/ggml-org/llama.cpp/blob/master/.github/workflows/release.yml

          cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_sycl_blas.6.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_core.3.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_def.3.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_avx2.3.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_tbb_thread.3.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_intel_thread.3.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/libimalloc.dll" ./build/bin

          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero_v2.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_loader_shared.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_win_proxy_loader.dll" ./build/bin
          ZE_LOADER_DLL=$(find "${{ env.ONEAPI_ROOT }}" "$LEVEL_ZERO_V1_SDK_PATH" -iname ze_loader.dll -print -quit 2>/dev/null || true)
          if [ -n "$ZE_LOADER_DLL" ]; then
            echo "Using Level Zero loader: $ZE_LOADER_DLL"
            cp "$ZE_LOADER_DLL" ./build/bin
          else
            echo "Level Zero loader DLL not found in oneAPI or SDK; relying on system driver/runtime"
          fi

          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl9.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/svml_dispmd.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libmmd.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libiomp5md.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl-ls.exe" ./build/bin

          cp "${{ env.ONEAPI_ROOT }}/dnnl/latest/bin/dnnl.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/tbb/latest/bin/tbb12.dll" ./build/bin

          cp "${{ env.ONEAPI_ROOT }}/tcm/latest/bin/tcm.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/tcm/latest/bin/libhwloc-15.dll" ./build/bin
          cp "${{ env.ONEAPI_ROOT }}/umf/latest/bin/umf.dll" ./build/bin

@Titaniumtown

Copy link
Copy Markdown
Contributor Author

@arthw I don't understand what you are asking, syclToolkit.stdenv contains all the packages and environment needed to build llama.cpp. I don't see the need of copying libraries as all the linking is handled by nix.

@arthw

arthw commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@Titaniumtown
In fact, I didn't use nix to build the code.
Maybe I misunderstand the function of the code, please correct me if there is wrong.

I think following new lines to provide to install the depended package to build SYCL backend or provide the running time of SYCL.

   level-zero,
  ocl-icd,
  intel-graphics-compiler,
  intel-compute-runtime,

If yes, SYCL still need oneDNN, oneMKL and TBB to build and related dll/so files of them to run.
They (oneDNN, oneMKL and TBB) are needed to be installed one by one.
If use oneAPI toolkit, all packages are included.

Thank you!

@Titaniumtown

Copy link
Copy Markdown
Contributor Author

All those libraries are included in syclToolkit.stdenv, which provides a common environment for all SYCL code to compile. level-zero, ocl-icd, intel-graphics-compiler, and intel-compute-runtime are not included in that stdenv and needed to be added separately.

The packages we need are included in syclToolkit.stdenv + those added packages

@arthw

arthw commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@Titaniumtown
Got it! :)
I have no comment.

Thank you!

@arthw arthw added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Nov 17, 2026
@ggerganov
ggerganov merged commit eada89c into ggml-org:master Nov 17, 2026
5 checks passed
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Nov 17, 2026
* origin/master: (138 commits)
qwen4exp : fix graph reallocation from the n-gram table scale (ggml-org#32483)
server : return 400 when grammar and ignore_eos are on (ggml-org#32377)
ggml-cuda: disable quantized matvec fusion on all Pascal GPUs (ggml-org#32239)
Title: CUDA: few-row MMQ for MUL_MAT_ID (ggml-org#32065)
ui: turn the live markdown preview off by default (ggml-org#32469)
CUDA: use block reductions for whole-row pool_1d (ggml-org#31855)
ggml : decode F8_E4M3 to fp32 without ldexpf (ggml-org#32477)
llama : keep the k-pool layout prefix on sequence edits (ggml-org#32137)
vocab : speed up PLaMo-2/3 tokenizer table build (ggml-org#32249)
convert : fix FP8 qwen4exp checkpoints (n-gram table scale, block-scaled FP8) (ggml-org#32476)
ui: Llama UI design system: tokens, surfaces and fonts (ggml-org#32468)
mtmd: support Minimax-Music3 (ggml-org#32435)
chat: add tts_dict for kokoro G2P template (ggml-org#32397)
Rotate K/V read order for better L2 cache hit rates (ggml-org#32407)
ui: turn conversation tabs off by default (ggml-org#32402)
ui: move Llama Chat to SvelteKit 3 and its built-in service worker (ggml-org#32463)
qwen3next : apply output projection weight scale (ggml-org#32393)
cuda : raise shared mem limit only for the launched kernel (ggml-org#32392)
nix: expose a SYCL package (ggml-org#31066)
vulkan: disable flip Flash Attention shader on AMD Windows due to a driver bug (ggml-org#32415)
...
Annieren pushed a commit to Annieren/llama.cpp-upstream that referenced this pull request Nov 23, 2026
Nindaleth pushed a commit to Nindaleth/llama.cpp that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops improvements to build systems and github actions merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. nix Issues specific to consuming flake.nix, or generally concerned with ❄ Nix-based llama.cpp deployment SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants