Skip to content

Commit fb65a1d

Browse files
committed
feat: Upgrade to CUDA 12.5
Signed-off-by: Rene Leonhardt <[email protected]>
1 parent 7f13e3a commit fb65a1d

File tree

3 files changed

+50
-8
lines changed

3 files changed

+50
-8
lines changed

.github/workflows/image_build.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ on:
1919
type: string
2020
cuda-major-version:
2121
description: 'CUDA major version'
22-
default: "11"
22+
default: "12"
2323
type: string
2424
cuda-minor-version:
2525
description: 'CUDA minor version'
26-
default: "7"
26+
default: "5"
2727
type: string
2828
platforms:
2929
description: 'Platforms'
@@ -146,6 +146,10 @@ jobs:
146146
type=ref,event=branch
147147
type=semver,pattern={{raw}}
148148
type=sha
149+
tagsCUDA11: |
150+
type=ref,event=branch
151+
type=semver,pattern={{raw}}-cuda11
152+
type=sha
149153
flavor: |
150154
latest=${{ inputs.tag-latest }}
151155
suffix=${{ inputs.tag-suffix }}
@@ -274,6 +278,33 @@ jobs:
274278
run: |
275279
echo "Image is available at ttl.sh/localai-ci-pr-${{ github.event.number }}:${{ steps.meta_pull_request.outputs.version }}" >> $GITHUB_STEP_SUMMARY
276280
## End testing image
281+
- name: Build and push CUDA 11
282+
uses: docker/build-push-action@v5
283+
if: github.event_name != 'pull_request'
284+
with:
285+
builder: ${{ steps.buildx.outputs.name }}
286+
# The build-args MUST be an EXACT match between the image cache and other workflow steps that want to use that cache.
287+
# This means that even the MAKEFLAGS have to be an EXACT match.
288+
# If the build-args are not an EXACT match, it will result in a cache miss, which will require GRPC to be built from scratch.
289+
# This is why some build args like GRPC_VERSION and MAKEFLAGS are hardcoded
290+
build-args: |
291+
BUILD_TYPE=${{ inputs.build-type }}
292+
CUDA_MAJOR_VERSION=11
293+
CUDA_MINOR_VERSION=8
294+
FFMPEG=${{ inputs.ffmpeg }}
295+
IMAGE_TYPE=${{ inputs.image-type }}
296+
BASE_IMAGE=${{ inputs.base-image }}
297+
GRPC_BASE_IMAGE=${{ inputs.grpc-base-image || inputs.base-image }}
298+
GRPC_MAKEFLAGS=--jobs=4 --output-sync=target
299+
GRPC_VERSION=v1.64.0
300+
MAKEFLAGS=${{ inputs.makeflags }}
301+
context: .
302+
file: ./Dockerfile
303+
cache-from: type=gha
304+
platforms: ${{ inputs.platforms }}
305+
push: ${{ github.event_name != 'pull_request' }}
306+
tags: ${{ steps.meta.outputs.tagsCUDA11 }}
307+
labels: ${{ steps.meta.outputs.labels }}
277308
- name: Build and push AIO image
278309
if: inputs.aio != ''
279310
uses: docker/build-push-action@v5
@@ -324,7 +355,7 @@ jobs:
324355
docker pull quay.io/go-skynet/local-ai:${{ steps.meta_aio.outputs.version }}
325356
docker tag quay.io/go-skynet/local-ai:${{ steps.meta_aio.outputs.version }} quay.io/go-skynet/local-ai:${{ inputs.latest-image-aio }}
326357
docker push quay.io/go-skynet/local-ai:${{ inputs.latest-image-aio }}
327-
358+
328359
- name: job summary
329360
run: |
330361
echo "Built image: ${{ steps.meta.outputs.labels }}" >> $GITHUB_STEP_SUMMARY

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUN curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz | ta
3333
ENV PATH $PATH:/root/go/bin:/usr/local/go/bin
3434

3535
# Install grpc compilers
36-
RUN go install google.golang.org/protobuf/cmd/[email protected].1 && \
36+
RUN go install google.golang.org/protobuf/cmd/[email protected].2 && \
3737
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af
3838

3939
COPY --chmod=644 custom-ca-certs/* /usr/local/share/ca-certificates/
@@ -98,8 +98,8 @@ RUN pip install --user grpcio-tools
9898
FROM requirements-${IMAGE_TYPE} AS requirements-drivers
9999

100100
ARG BUILD_TYPE
101-
ARG CUDA_MAJOR_VERSION=11
102-
ARG CUDA_MINOR_VERSION=8
101+
ARG CUDA_MAJOR_VERSION=12
102+
ARG CUDA_MINOR_VERSION=5
103103

104104
ENV BUILD_TYPE=${BUILD_TYPE}
105105

@@ -292,7 +292,7 @@ ENV REBUILD=false
292292
ENV HEALTHCHECK_ENDPOINT=http://localhost:8080/readyz
293293
ENV MAKEFLAGS=${MAKEFLAGS}
294294

295-
ARG CUDA_MAJOR_VERSION=11
295+
ARG CUDA_MAJOR_VERSION=12
296296
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
297297
ENV NVIDIA_REQUIRE_CUDA="cuda>=${CUDA_MAJOR_VERSION}.0"
298298
ENV NVIDIA_VISIBLE_DEVICES=all

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ prepare-e2e:
400400
mkdir -p $(TEST_DIR)
401401
cp -rfv $(abspath ./tests/e2e-fixtures)/gpu.yaml $(TEST_DIR)/gpu.yaml
402402
test -e $(TEST_DIR)/ggllm-test-model.bin || wget -q https://huggingface.co/TheBloke/CodeLlama-7B-Instruct-GGUF/resolve/main/codellama-7b-instruct.Q2_K.gguf -O $(TEST_DIR)/ggllm-test-model.bin
403-
docker build --build-arg GRPC_BACKENDS="$(GRPC_BACKENDS)" --build-arg IMAGE_TYPE=core --build-arg BUILD_TYPE=$(BUILD_TYPE) --build-arg CUDA_MAJOR_VERSION=11 --build-arg CUDA_MINOR_VERSION=7 --build-arg FFMPEG=true -t localai-tests .
403+
docker build --build-arg GRPC_BACKENDS="$(GRPC_BACKENDS)" --build-arg IMAGE_TYPE=core --build-arg BUILD_TYPE=$(BUILD_TYPE) --build-arg CUDA_MAJOR_VERSION=12 --build-arg CUDA_MINOR_VERSION=5 --build-arg FFMPEG=true -t localai-tests .
404404

405405
run-e2e-image:
406406
ls -liah $(abspath ./tests/e2e-fixtures)
@@ -810,6 +810,17 @@ docker:
810810
--build-arg BUILD_TYPE=$(BUILD_TYPE) \
811811
-t $(DOCKER_IMAGE) .
812812

813+
docker-cuda11:
814+
docker build \
815+
--build-arg CUDA_MAJOR_VERSION=11 \
816+
--build-arg CUDA_MINOR_VERSION=8 \
817+
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
818+
--build-arg IMAGE_TYPE=$(IMAGE_TYPE) \
819+
--build-arg GO_TAGS="$(GO_TAGS)" \
820+
--build-arg MAKEFLAGS="$(DOCKER_MAKEFLAGS)" \
821+
--build-arg BUILD_TYPE=$(BUILD_TYPE) \
822+
-t $(DOCKER_IMAGE)-cuda11 .
823+
813824
docker-aio:
814825
@echo "Building AIO image with base $(BASE_IMAGE) as $(DOCKER_AIO_IMAGE)"
815826
docker build \

0 commit comments

Comments
 (0)