Skip to content

Commit 41ad1eb

Browse files
committed
fixing build for windows
1 parent ba65647 commit 41ad1eb

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

Makefile

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ IMAGE_CPU_BGE_HEADLESS := $(REGISTRY)/nornicdb-cpu-bge-headless:$(VERSION)
6868
IMAGE_AMD64_VULKAN := $(REGISTRY)/nornicdb-amd64-vulkan:$(VERSION)
6969
IMAGE_AMD64_VULKAN_BGE := $(REGISTRY)/nornicdb-amd64-vulkan-bge:$(VERSION)
7070
IMAGE_AMD64_VULKAN_HEADLESS := $(REGISTRY)/nornicdb-amd64-vulkan-headless:$(VERSION)
71-
LLAMA_CUDA := $(REGISTRY)/llama-cuda-libs:b8157
71+
LLAMA_VERSION ?= b8157
72+
LLAMA_CUDA := $(REGISTRY)/llama-cuda-libs:$(LLAMA_VERSION)
7273

7374
# Dockerfiles
7475
DOCKER_DIR := docker
@@ -100,7 +101,7 @@ BGE_RERANKER_URL := https://huggingface.co/gpustack/bge-reranker-v2-m3-GGUF/reso
100101
.PHONY: deploy-cpu-bge deploy-cpu-bge-headless
101102
.PHONY: deploy-amd64-vulkan deploy-amd64-vulkan-bge deploy-amd64-vulkan-headless
102103
.PHONY: deploy-all deploy-arm64-all deploy-amd64-all
103-
.PHONY: build-llama-cuda push-llama-cuda deploy-llama-cuda
104+
.PHONY: build-llama-cuda push-llama-cuda deploy-llama-cuda ensure-llama-cuda
104105
.PHONY: build build-ui build-binary build-localllm build-headless build-localllm-headless test clean images help macos-menubar macos-install macos-uninstall macos-all macos-clean macos-package macos-package-lite macos-package-full macos-package-all macos-package-signed
105106
.PHONY: download-models download-bge download-qwen download-bge-reranker check-models
106107
.PHONY: antlr-generate antlr-clean antlr-test antlr-test-full test-parsers
@@ -278,29 +279,29 @@ build-arm64-metal-headless:
278279
@echo "╚══════════════════════════════════════════════════════════════╝"
279280
docker build $(DOCKER_BUILD_FLAGS) --platform linux/arm64 --build-arg HEADLESS=true -t $(IMAGE_ARM64_HEADLESS) -f $(DOCKER_DIR)/Dockerfile.arm64-metal .
280281

281-
build-amd64-cuda:
282+
build-amd64-cuda: ensure-llama-cuda
282283
@echo "╔══════════════════════════════════════════════════════════════╗"
283284
@echo "║ Building: $(IMAGE_AMD64) [BYOM]"
284285
@echo "╚══════════════════════════════════════════════════════════════╝"
285-
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 -t $(IMAGE_AMD64) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda .
286+
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 --build-arg LLAMA_CUDA_IMAGE=$(LLAMA_CUDA) -t $(IMAGE_AMD64) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda .
286287

287-
build-amd64-cuda-bge: download-bge download-bge-reranker
288+
build-amd64-cuda-bge: ensure-llama-cuda download-bge download-bge-reranker
288289
@echo "╔══════════════════════════════════════════════════════════════╗"
289290
@echo "║ Building: $(IMAGE_AMD64_BGE) [with BGE model]"
290291
@echo "╚══════════════════════════════════════════════════════════════╝"
291-
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 --build-arg EMBED_MODEL=true -t $(IMAGE_AMD64_BGE) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda .
292+
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 --build-arg LLAMA_CUDA_IMAGE=$(LLAMA_CUDA) --build-arg EMBED_MODEL=true -t $(IMAGE_AMD64_BGE) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda .
292293

293-
build-amd64-cuda-bge-heimdall: download-models
294+
build-amd64-cuda-bge-heimdall: ensure-llama-cuda download-models
294295
@echo "╔══════════════════════════════════════════════════════════════╗"
295296
@echo "║ Building: $(IMAGE_AMD64_BGE_HEIMDALL) [BGE + Heimdall]"
296297
@echo "╚══════════════════════════════════════════════════════════════╝"
297-
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 -t $(IMAGE_AMD64_BGE_HEIMDALL) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda-heimdall .
298+
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 --build-arg LLAMA_CUDA_IMAGE=$(LLAMA_CUDA) -t $(IMAGE_AMD64_BGE_HEIMDALL) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda-heimdall .
298299

299-
build-amd64-cuda-headless:
300+
build-amd64-cuda-headless: ensure-llama-cuda
300301
@echo "╔══════════════════════════════════════════════════════════════╗"
301302
@echo "║ Building: $(IMAGE_AMD64_HEADLESS) [headless, no UI]"
302303
@echo "╚══════════════════════════════════════════════════════════════╝"
303-
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 --build-arg HEADLESS=true -t $(IMAGE_AMD64_HEADLESS) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda .
304+
docker build $(DOCKER_BUILD_FLAGS) --platform linux/amd64 --build-arg LLAMA_CUDA_IMAGE=$(LLAMA_CUDA) --build-arg HEADLESS=true -t $(IMAGE_AMD64_HEADLESS) -f $(DOCKER_DIR)/Dockerfile.amd64-cuda .
304305

305306
build-amd64-cpu:
306307
@echo "╔══════════════════════════════════════════════════════════════╗"
@@ -500,6 +501,25 @@ endif
500501
# CUDA Prerequisite (one-time build, ~15 min)
501502
# ==============================================================================
502503

504+
ensure-llama-cuda:
505+
ifeq ($(HOST_OS),windows)
506+
@echo Checking CUDA libs image: $(LLAMA_CUDA)
507+
@docker image inspect "$(LLAMA_CUDA)" >NUL 2>&1 && ( \
508+
echo Found local image $(LLAMA_CUDA) \
509+
) || ( \
510+
echo Missing $(LLAMA_CUDA); building one-time prerequisite... && \
511+
$(MAKE) build-llama-cuda \
512+
)
513+
else
514+
@echo "→ Checking CUDA libs image: $(LLAMA_CUDA)"
515+
@if docker image inspect "$(LLAMA_CUDA)" > /dev/null 2>&1; then \
516+
echo "✓ Found local image $(LLAMA_CUDA)"; \
517+
else \
518+
echo "→ Missing $(LLAMA_CUDA); building one-time prerequisite..."; \
519+
$(MAKE) build-llama-cuda; \
520+
fi
521+
endif
522+
503523
build-llama-cuda:
504524
@echo "╔══════════════════════════════════════════════════════════════╗"
505525
@echo "║ Building CUDA libs (one-time): $(LLAMA_CUDA)"

0 commit comments

Comments
 (0)