Skip to content

Commit 1864caa

Browse files
committed
Updated
1 parent 6256fc6 commit 1864caa

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ DOCKER_TAG_BASE_BUILD="${DOCKER_REGISTRY}/cuda-dev-${OS}-${ARCH}:${VERSION}"
1717
DOCKER_TAG_BASE_RUNTIME="${DOCKER_REGISTRY}/cuda-rt-${OS}-${ARCH}:${VERSION}"
1818
DOCKER_TAG_LLAMACPP="${DOCKER_REGISTRY}/llamacpp-${OS}-${ARCH}:${VERSION}"
1919

20+
# ONNXRuntime flags
21+
ONNXRUNTIME_FLAGS := --config Release --build_shared_lib
22+
23+
# CUDA
24+
ifdef CUDA_HOME
25+
GGML_CUDA := 1
26+
ONNXRUNTIME_FLAGS += --use_cuda --cuda_home=${CUDA_HOME} --cudnn_home=${CUDA_HOME}
27+
endif
28+
2029
# Base images for building and running CUDA containers
2130
docker-base: docker-dep
2231
@echo "Building ${DOCKER_TAG_BASE_BUILD}"
@@ -49,7 +58,11 @@ llamacpp: submodule-checkout
4958

5059
onnxruntime: submodule-checkout
5160
@echo "Building onnxruntime"
52-
@cd onnxruntime && ./build.sh --config Release --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync
61+
@cd onnxruntime && ./build.sh \
62+
--parallel \
63+
--compile_no_warning_as_error \
64+
--skip_submodule_sync \
65+
${ONNXRUNTIME_FLAGS}
5366

5467
# Push docker container
5568
docker-push: docker-dep

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ You can then access the Llama server on port 8080.
2424

2525
## Building
2626

27-
The following will build the docker image and push to the repository:
27+
To build either the llama.cpp library or the onnxruntime library:
28+
29+
```bash
30+
CUDA_HOME=/usr/local/cuda make llamacpp onnxruntime
31+
```
32+
33+
You can omit the CUDA_HOME environment variable if you don't want to build with CUDA support.
34+
The following will build a docker image and push to the repository:
2835

2936
```bash
3037
git checkout git@github.com:mutablelogic/docker-llamacpp.git

0 commit comments

Comments
 (0)