Skip to content

Commit c07bc55

Browse files
authored
fix(intel): Set GPU vendor on Intel images and cleanup (#5945)
Signed-off-by: Richard Palethorpe <[email protected]>
1 parent 173e077 commit c07bc55

File tree

13 files changed

+29
-74
lines changed

13 files changed

+29
-74
lines changed

.github/workflows/image-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ jobs:
5151
grpc-base-image: "ubuntu:22.04"
5252
runs-on: 'ubuntu-latest'
5353
makeflags: "--jobs=3 --output-sync=target"
54-
- build-type: 'sycl_f16'
54+
- build-type: 'sycl'
5555
platforms: 'linux/amd64'
5656
tag-latest: 'false'
5757
base-image: "quay.io/go-skynet/intel-oneapi-base:latest"
5858
grpc-base-image: "ubuntu:22.04"
59-
tag-suffix: 'sycl-f16'
59+
tag-suffix: 'sycl'
6060
runs-on: 'ubuntu-latest'
6161
makeflags: "--jobs=3 --output-sync=target"
6262
- build-type: 'vulkan'

.github/workflows/image.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,15 @@ jobs:
109109
skip-drivers: 'false'
110110
makeflags: "--jobs=4 --output-sync=target"
111111
aio: "-aio-gpu-vulkan"
112-
- build-type: 'sycl_f16'
112+
- build-type: 'sycl'
113113
platforms: 'linux/amd64'
114114
tag-latest: 'auto'
115115
base-image: "quay.io/go-skynet/intel-oneapi-base:latest"
116116
grpc-base-image: "ubuntu:22.04"
117-
tag-suffix: '-gpu-intel-f16'
117+
tag-suffix: '-gpu-intel'
118118
runs-on: 'ubuntu-latest'
119119
makeflags: "--jobs=3 --output-sync=target"
120-
aio: "-aio-gpu-intel-f16"
121-
- build-type: 'sycl_f32'
122-
platforms: 'linux/amd64'
123-
tag-latest: 'auto'
124-
base-image: "quay.io/go-skynet/intel-oneapi-base:latest"
125-
grpc-base-image: "ubuntu:22.04"
126-
tag-suffix: '-gpu-intel-f32'
127-
runs-on: 'ubuntu-latest'
128-
makeflags: "--jobs=3 --output-sync=target"
129-
aio: "-aio-gpu-intel-f32"
120+
aio: "-aio-gpu-intel"
130121

131122
gh-runner:
132123
uses: ./.github/workflows/image_build.yml

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ RUN if [ "${BUILD_TYPE}" = "hipblas" ] && [ "${SKIP_DRIVERS}" = "false" ]; then
100100
ldconfig \
101101
; fi
102102

103+
RUN expr "${BUILD_TYPE}" : sycl && \
104+
echo "intel" > /run/localai/capability || \
105+
echo "Not Intel"
106+
107+
103108
# Cuda
104109
ENV PATH=/usr/local/cuda/bin:${PATH}
105110

Makefile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ BINARY_NAME=local-ai
55

66
GORELEASER?=
77

8-
ONEAPI_VERSION?=2025.2
9-
108
export BUILD_TYPE?=
119

1210
GO_TAGS?=
@@ -340,19 +338,11 @@ docker-aio-all:
340338

341339
docker-image-intel:
342340
docker build \
343-
--build-arg BASE_IMAGE=intel/oneapi-basekit:${ONEAPI_VERSION}.0-0-devel-ubuntu24.04 \
344-
--build-arg IMAGE_TYPE=$(IMAGE_TYPE) \
345-
--build-arg GO_TAGS="$(GO_TAGS)" \
346-
--build-arg MAKEFLAGS="$(DOCKER_MAKEFLAGS)" \
347-
--build-arg BUILD_TYPE=sycl_f32 -t $(DOCKER_IMAGE) .
348-
349-
docker-image-intel-xpu:
350-
docker build \
351-
--build-arg BASE_IMAGE=intel/oneapi-basekit:${ONEAPI_VERSION}.0-0-devel-ubuntu22.04 \
341+
--build-arg BASE_IMAGE=quay.io/go-skynet/intel-oneapi-base:latest \
352342
--build-arg IMAGE_TYPE=$(IMAGE_TYPE) \
353343
--build-arg GO_TAGS="$(GO_TAGS)" \
354344
--build-arg MAKEFLAGS="$(DOCKER_MAKEFLAGS)" \
355-
--build-arg BUILD_TYPE=sycl_f32 -t $(DOCKER_IMAGE) .
345+
--build-arg BUILD_TYPE=sycl -t $(DOCKER_IMAGE) .
356346

357347
########################################################
358348
## Backends

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,7 @@ docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri
140140
### Intel GPU Images (oneAPI):
141141

142142
```bash
143-
# Intel GPU with FP16 support
144-
docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri/card1 --device=/dev/dri/renderD128 localai/localai:latest-gpu-intel-f16
145-
146-
# Intel GPU with FP32 support
147-
docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri/card1 --device=/dev/dri/renderD128 localai/localai:latest-gpu-intel-f32
143+
docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri/card1 --device=/dev/dri/renderD128 localai/localai:latest-gpu-intel
148144
```
149145

150146
### Vulkan GPU Images:
@@ -166,7 +162,7 @@ docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-ai
166162
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-11
167163

168164
# Intel GPU version
169-
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-gpu-intel-f16
165+
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-gpu-intel
170166

171167
# AMD GPU version
172168
docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-aio-gpu-hipblas

backend/Dockerfile.golang

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,6 @@ RUN if [ "${BUILD_TYPE}" = "hipblas" ] && [ "${SKIP_DRIVERS}" = "false" ]; then
9696
ldconfig \
9797
; fi
9898

99-
# Intel oneAPI requirements
100-
RUN <<EOT bash
101-
if [[ "${BUILD_TYPE}" == sycl* ]] && [ "${SKIP_DRIVERS}" = "false" ]; then
102-
apt-get update && \
103-
apt-get install -y --no-install-recommends \
104-
intel-oneapi-runtime-libs && \
105-
apt-get clean && \
106-
rm -rf /var/lib/apt/lists/*
107-
fi
108-
EOT
109-
11099
# Install Go
111100
RUN curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz | tar -C /usr/local -xz
112101
ENV PATH=$PATH:/root/go/bin:/usr/local/go/bin:/usr/local/bin

backend/cpp/llama-cpp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ else ifeq ($(BUILD_TYPE),openblas)
2626
# If build type is clblas (openCL) we set -DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
2727
else ifeq ($(BUILD_TYPE),clblas)
2828
CMAKE_ARGS+=-DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
29-
# If it's hipblas we do have also to set CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++
29+
# If it's hipblas we do have also to set CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++
3030
else ifeq ($(BUILD_TYPE),hipblas)
3131
ROCM_HOME ?= /opt/rocm
3232
ROCM_PATH ?= /opt/rocm

docs/content/docs/advanced/advanced-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ there are additional environment variables available that modify the behavior of
448448
| Environment variable | Default | Description |
449449
|----------------------------|---------|------------------------------------------------------------------------------------------------------------|
450450
| `REBUILD` | `false` | Rebuild LocalAI on startup |
451-
| `BUILD_TYPE` | | Build type. Available: `cublas`, `openblas`, `clblas` |
451+
| `BUILD_TYPE` | | Build type. Available: `cublas`, `openblas`, `clblas`, `intel` (intel core), `sycl_f16`, `sycl_f32` (intel backends) |
452452
| `GO_TAGS` | | Go tags. Available: `stablediffusion` |
453453
| `HUGGINGFACEHUB_API_TOKEN` | | Special token for interacting with HuggingFace Inference API, required only when using the `langchain-huggingface` backend |
454454
| `EXTRA_BACKENDS` | | A space separated list of backends to prepare. For example `EXTRA_BACKENDS="backend/python/diffusers backend/python/transformers"` prepares the python environment on start |

docs/content/docs/features/GPU-acceleration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ If building from source, you need to install [Intel oneAPI Base Toolkit](https:/
267267

268268
### Container images
269269

270-
To use SYCL, use the images with the `gpu-intel-f16` or `gpu-intel-f32` tag, for example `{{< version >}}-gpu-intel-f32-core`, `{{< version >}}-gpu-intel-f16`, ...
270+
To use SYCL, use the images with `gpu-intel` in the tag, for example `{{< version >}}-gpu-intel`, ...
271271

272272
The image list is on [quay](https://quay.io/repository/go-skynet/local-ai?tab=tags).
273273

@@ -276,15 +276,15 @@ The image list is on [quay](https://quay.io/repository/go-skynet/local-ai?tab=ta
276276
To run LocalAI with Docker and sycl starting `phi-2`, you can use the following command as an example:
277277

278278
```bash
279-
docker run -e DEBUG=true --privileged -ti -v $PWD/models:/models -p 8080:8080 -v /dev/dri:/dev/dri --rm quay.io/go-skynet/local-ai:master-gpu-intel-f32 phi-2
279+
docker run -e DEBUG=true --privileged -ti -v $PWD/models:/models -p 8080:8080 -v /dev/dri:/dev/dri --rm quay.io/go-skynet/local-ai:master-gpu-intel phi-2
280280
```
281281

282282
### Notes
283283

284284
In addition to the commands to run LocalAI normally, you need to specify `--device /dev/dri` to docker, for example:
285285

286286
```bash
287-
docker run --rm -ti --device /dev/dri -p 8080:8080 -e DEBUG=true -e MODELS_PATH=/models -e THREADS=1 -v $PWD/models:/models quay.io/go-skynet/local-ai:{{< version >}}-gpu-intel-f16
287+
docker run --rm -ti --device /dev/dri -p 8080:8080 -e DEBUG=true -e MODELS_PATH=/models -e THREADS=1 -v $PWD/models:/models quay.io/go-skynet/local-ai:{{< version >}}-gpu-intel
288288
```
289289

290290
Note also that sycl does have a known issue to hang with `mmap: true`. You have to disable it in the model configuration if explicitly enabled.

docs/content/docs/getting-started/build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,4 @@ docker build --build-arg BUILD_TYPE=$(BUILD_TYPE) --build-arg BASE_IMAGE=$(BASE_
197197
Note:
198198

199199
- BUILD_TYPE can be either: `cublas`, `hipblas`, `sycl_f16`, `sycl_f32`, `metal`.
200-
- BASE_IMAGE is tested on `ubuntu:22.04` (and defaults to it)
200+
- BASE_IMAGE is tested on `ubuntu:22.04` (and defaults to it) and `quay.io/go-skynet/intel-oneapi-base:latest` for intel/sycl

0 commit comments

Comments
 (0)