llama-cli-cuda.Dockerfile 864 Bytes
Newer Older
wangkx1's avatar
init  
wangkx1 committed
1
2
3
4
5
6
7
8
ARG UBUNTU_VERSION=22.04
# This needs to generally match the container host's environment.
ARG CUDA_VERSION=11.7.1
# Target the CUDA build image
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
# Target the CUDA runtime image
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}

wangkx1's avatar
wangkx1 committed
9
FROM ${BASE_CUDA_DEV_CONTAINER} AS build
wangkx1's avatar
init  
wangkx1 committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# Unless otherwise specified, we make a fat build.
ARG CUDA_DOCKER_ARCH=all

RUN apt-get update && \
    apt-get install -y build-essential git

WORKDIR /app

COPY . .

# Set nvcc architecture
ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
# Enable CUDA
wangkx1's avatar
wangkx1 committed
24
ENV GGML_CUDA=1
wangkx1's avatar
init  
wangkx1 committed
25
26
27

RUN make -j$(nproc) llama-cli

wangkx1's avatar
wangkx1 committed
28
FROM ${BASE_CUDA_RUN_CONTAINER} AS runtime
wangkx1's avatar
init  
wangkx1 committed
29
30
31
32
33
34
35

RUN apt-get update && \
    apt-get install -y libgomp1

COPY --from=build /app/llama-cli /llama-cli

ENTRYPOINT [ "/llama-cli" ]