[PR #2458] [CLOSED] Add support for running llama.cpp with SYCL for Intel GPUs #16165

Closed
opened 2026-04-16 05:18:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/2458
Author: @felipeagc
Created: 2/12/2024
Status: Closed

Base: mainHead: main


📝 Commits (8)

  • 69f5efe Build llama.cpp with SYCL support
  • 5fee46d Add gpu_info_oneapi
  • 3a465a3 Add oneapi to gpu.go
  • a7b5c8e Update llama.cpp
  • 7451db1 Fix oneAPI linking by using icx compiler and updating rpath
  • 8b46455 Add oneAPI integrated GPU detection
  • 5670164 Update rocky linux gcc version (rocky linux 9 only has gcc 12+)
  • 0c5346e Add oneapi docker build

📊 Changes

11 files changed (+514 additions, -38 deletions)

View changed files

📝 Dockerfile (+19 -0)
📝 gpu/gpu.go (+64 -4)
📝 gpu/gpu_info.h (+2 -1)
gpu/gpu_info_oneapi.c (+203 -0)
gpu/gpu_info_oneapi.h (+190 -0)
📝 llm/generate/gen_common.sh (+3 -1)
📝 llm/generate/gen_linux.sh (+21 -0)
📝 llm/llama.cpp (+1 -1)
llm/patches/01-cache.diff (+0 -30)
📝 scripts/build_docker.sh (+10 -0)
📝 scripts/rh_linux_deps.sh (+1 -1)

📄 Description

This is my attempt at adding SYCL support to ollama. It's not working yet, and there are still some parts marked as TODO.

If anyone wants to take a crack at finishing this PR, I'm currently stuck on this error:

No kernel named _ZTSZZL17rms_norm_f32_syclPKfPfiifPN4sycl3_V15queueEENKUlRNS3_7handlerEE0_clES7_EUlNS3_7nd_itemILi3EEEE_ was found -46 (PI_ERROR_INVALID_KERNEL_NAME)Exception caught at file:/home/felipe/Code/go/ollama/llm/llama.cpp/ggml-sycl.cpp, line:12708

It's probably due to the way ollama builds the C++ parts and Intel's compiler not expecting it to be done in this way. The kernels are probably getting eliminated from the binary in some build step.

I'm not sure when I'm going to have more time to work on this PR, so I'll just leave it here as a draft for now.

EDIT: it works now :)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/2458 **Author:** [@felipeagc](https://github.com/felipeagc) **Created:** 2/12/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (8) - [`69f5efe`](https://github.com/ollama/ollama/commit/69f5efee0f62d59adfb5d838e0029fd62e48b060) Build llama.cpp with SYCL support - [`5fee46d`](https://github.com/ollama/ollama/commit/5fee46def09f6e459beab5a81781772d7dc03afd) Add gpu_info_oneapi - [`3a465a3`](https://github.com/ollama/ollama/commit/3a465a357c5ec8d229492f5752cfefc65b1984b3) Add oneapi to gpu.go - [`a7b5c8e`](https://github.com/ollama/ollama/commit/a7b5c8e6524100a84a3158534f53c557493a985b) Update llama.cpp - [`7451db1`](https://github.com/ollama/ollama/commit/7451db16579f9af00eb3386f536cc97c12749eee) Fix oneAPI linking by using icx compiler and updating rpath - [`8b46455`](https://github.com/ollama/ollama/commit/8b4645596f4e90411a38c23e023055192d46ad0f) Add oneAPI integrated GPU detection - [`5670164`](https://github.com/ollama/ollama/commit/567016448753a5b2b2b7d9f663ccc4c4e47318e8) Update rocky linux gcc version (rocky linux 9 only has gcc 12+) - [`0c5346e`](https://github.com/ollama/ollama/commit/0c5346e55731d8d9466d18766cb98169edbecab5) Add oneapi docker build ### 📊 Changes **11 files changed** (+514 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+19 -0) 📝 `gpu/gpu.go` (+64 -4) 📝 `gpu/gpu_info.h` (+2 -1) ➕ `gpu/gpu_info_oneapi.c` (+203 -0) ➕ `gpu/gpu_info_oneapi.h` (+190 -0) 📝 `llm/generate/gen_common.sh` (+3 -1) 📝 `llm/generate/gen_linux.sh` (+21 -0) 📝 `llm/llama.cpp` (+1 -1) ➖ `llm/patches/01-cache.diff` (+0 -30) 📝 `scripts/build_docker.sh` (+10 -0) 📝 `scripts/rh_linux_deps.sh` (+1 -1) </details> ### 📄 Description This is my attempt at adding SYCL support to ollama. ~~It's not working yet, and there are still some parts marked as TODO.~~ ~~If anyone wants to take a crack at finishing this PR, I'm currently stuck on this error:~~ ``` No kernel named _ZTSZZL17rms_norm_f32_syclPKfPfiifPN4sycl3_V15queueEENKUlRNS3_7handlerEE0_clES7_EUlNS3_7nd_itemILi3EEEE_ was found -46 (PI_ERROR_INVALID_KERNEL_NAME)Exception caught at file:/home/felipe/Code/go/ollama/llm/llama.cpp/ggml-sycl.cpp, line:12708 ``` ~~It's probably due to the way ollama builds the C++ parts and Intel's compiler not expecting it to be done in this way. The kernels are probably getting eliminated from the binary in some build step.~~ ~~I'm not sure when I'm going to have more time to work on this PR, so I'll just leave it here as a draft for now.~~ EDIT: it works now :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 05:18:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#16165