Skip to content

Commit ac97374

Browse files
committed
fix(build): update windows cuda linker flags
1 parent 4f4ed56 commit ac97374

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
- os: windows-latest
109109
arch: x86_64
110110
name: windows-hip
111-
make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=OFF -DGGML_HIP=ON -DGGML_HIP_ROCWMMA_FATTN=ON -DAMDGPU_TARGETS=\"gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032\" -DCMAKE_CXX_FLAGS=\"-I$(pwd)/rocwmma/library/include/\""
111+
make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=OFF -DGGML_HIP=ON -DGGML_HIP_ROCWMMA_FATTN=ON -DAMDGPU_TARGETS=\"gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032\" -DCMAKE_C_COMPILER=\"$HIP_PATH/bin/clang.exe\" -DCMAKE_CXX_COMPILER=\"$HIP_PATH/bin/clang++.exe\" -DCMAKE_CXX_FLAGS=\"-I$(pwd)/rocwmma/library/include/ -Wno-ignored-attributes -Wno-nested-anon-types\""
112112

113113
# Android builds
114114
- os: ubuntu-latest
@@ -248,8 +248,12 @@ jobs:
248248
shell: pwsh
249249

250250
- name: windows build sqlite-ai
251-
if: matrix.os == 'windows-latest' && matrix.name != 'windows-cuda'
252-
run: make extension ${{ matrix.make && matrix.make || ''}}
251+
if: matrix.os == 'windows-latest'
252+
run: |
253+
if [ "${{ matrix.name }}" = "windows-hip" ]; then
254+
export PATH="$HIP_PATH/bin:$PATH"
255+
fi
256+
make extension ${{ matrix.make && matrix.make || ''}}
253257
shell: msys2 {0}
254258
env:
255259
HIP_PLATFORM: amd

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a
6666
# Platform-specific settings
6767
ifeq ($(PLATFORM),windows)
6868
TARGET := $(DIST_DIR)/ai.dll
69-
LDFLAGS += -shared
69+
LDFLAGS += -shared -lbcrypt -lgomp -lstdc++
7070
# Create .def file for Windows
7171
DEF_FILE := $(BUILD_DIR)/ai.def
72-
LDFLAGS += -lbcrypt -lgomp -lstdc++
7372
STRIP = strip --strip-unneeded $@
7473
else ifeq ($(PLATFORM),macos)
7574
TARGET := $(DIST_DIR)/ai.dylib
@@ -176,10 +175,13 @@ ifneq (,$(findstring COREML,$(WHISPER))) # CoreML - only macos
176175
LDFLAGS += -framework CoreML
177176
endif
178177
ifneq (,$(findstring CUDA,$(LLAMA)))
179-
LLAMA_LIBS += $(BUILD_LLAMA)/ggml/src/ggml-cuda/libggml-cuda.a
180-
LLAMA_LDFLAGS += -L./$(BUILD_LLAMA)/ggml/src/ggml-cuda $(L)ggml-cuda$(A) -lcuda -lcublas -lcublasLt -lcudart
178+
#LLAMA_LIBS += $(BUILD_LLAMA)/ggml/src/ggml-cuda/libggml-cuda.a
179+
#LLAMA_LDFLAGS += -L./$(BUILD_LLAMA)/ggml/src/ggml-cuda $(L)ggml-cuda$(A) -lcuda -lcublas -lcublasLt -lcudart
181180
ifneq ($(PLATFORM),windows)
182181
LLAMA_LDFLAGS += -ldl
182+
else
183+
#A = .lib
184+
LLAMA_LDFLAGS = -L./$(BUILD_LLAMA)/ggml/src -L./$(BUILD_LLAMA)/src -L./$(BUILD_LLAMA)/ggml/src/ggml-cuda/Release -L./$(BUILD_LLAMA)/ggml/src/Release $(L)ggml$(A) $(L)ggml-base.lib $(L)ggml-cuda.lib
183185
endif
184186
endif
185187
ifneq (,$(findstring HIP,$(LLAMA)))

0 commit comments

Comments
 (0)