Skip to content

Commit 23910cd

Browse files
committed
fix(intel): Set GPU vendor on Intel images and cleanup
Signed-off-by: Richard Palethorpe <[email protected]>
1 parent ab17baa commit 23910cd

File tree

11 files changed

+27
-72
lines changed

11 files changed

+27
-72
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/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/container-images.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ docker run -p 8080:8080 --name local-ai -ti -v localai-models:/models localai/lo
131131
| Latest images for Nvidia GPU (CUDA11) | `quay.io/go-skynet/local-ai:latest-aio-gpu-nvidia-cuda-11` | `localai/localai:latest-aio-gpu-nvidia-cuda-11` |
132132
| Latest images for Nvidia GPU (CUDA12) | `quay.io/go-skynet/local-ai:latest-aio-gpu-nvidia-cuda-12` | `localai/localai:latest-aio-gpu-nvidia-cuda-12` |
133133
| Latest images for AMD GPU | `quay.io/go-skynet/local-ai:latest-aio-gpu-hipblas` | `localai/localai:latest-aio-gpu-hipblas` |
134-
| Latest images for Intel GPU (sycl f16) | `quay.io/go-skynet/local-ai:latest-aio-gpu-intel-f16` | `localai/localai:latest-aio-gpu-intel-f16` |
135-
| Latest images for Intel GPU (sycl f32) | `quay.io/go-skynet/local-ai:latest-aio-gpu-intel-f32` | `localai/localai:latest-aio-gpu-intel-f32` |
134+
| Latest images for Intel GPU | `quay.io/go-skynet/local-ai:latest-aio-gpu-intel` | `localai/localai:latest-aio-gpu-intel` |
136135

137136
### Available environment variables
138137

@@ -179,23 +178,13 @@ Standard container images do not have pre-installed models.
179178

180179
{{% /tab %}}
181180

182-
{{% tab tabName="Intel GPU (sycl f16)" %}}
181+
{{% tab tabName="Intel GPU" %}}
183182

184183
| Description | Quay | Docker Hub |
185184
| --- | --- |-------------------------------------------------------------|
186-
| Latest images from the branch (development) | `quay.io/go-skynet/local-ai:master-gpu-intel-f16` | `localai/localai:master-gpu-intel-f16` |
187-
| Latest tag | `quay.io/go-skynet/local-ai:latest-gpu-intel-f16` | `localai/localai:latest-gpu-intel-f16` |
188-
| Versioned image | `quay.io/go-skynet/local-ai:{{< version >}}-gpu-intel-f16` | `localai/localai:{{< version >}}-gpu-intel-f16` |
189-
190-
{{% /tab %}}
191-
192-
{{% tab tabName="Intel GPU (sycl f32)" %}}
193-
194-
| Description | Quay | Docker Hub |
195-
| --- | --- |-------------------------------------------------------------|
196-
| Latest images from the branch (development) | `quay.io/go-skynet/local-ai:master-gpu-intel-f32` | `localai/localai:master-gpu-intel-f32` |
197-
| Latest tag | `quay.io/go-skynet/local-ai:latest-gpu-intel-f32` | `localai/localai:latest-gpu-intel-f32` |
198-
| Versioned image | `quay.io/go-skynet/local-ai:{{< version >}}-gpu-intel-f32` | `localai/localai:{{< version >}}-gpu-intel-f32` |
185+
| Latest images from the branch (development) | `quay.io/go-skynet/local-ai:master-gpu-intel` | `localai/localai:master-gpu-intel` |
186+
| Latest tag | `quay.io/go-skynet/local-ai:latest-gpu-intel` | `localai/localai:latest-gpu-intel` |
187+
| Versioned image | `quay.io/go-skynet/local-ai:{{< version >}}-gpu-intel` | `localai/localai:{{< version >}}-gpu-intel` |
199188

200189
{{% /tab %}}
201190

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

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

6161
```bash
62-
# Intel GPU with FP16 support
63-
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-intel-f16
64-
65-
# Intel GPU with FP32 support
66-
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-intel-f32
62+
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-intel
6763
```
6864

6965
#### Vulkan GPU Images:
@@ -85,7 +81,7 @@ docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-ai
8581
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-11
8682

8783
# Intel GPU version
88-
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-gpu-intel-f16
84+
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-gpu-intel
8985

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

0 commit comments

Comments
 (0)