Skip to content

Commit 7f61d39

Browse files
authored
fix(stablediffusion-ggml): Build with DSD CUDA, HIP and Metal flags (#5236)
Signed-off-by: Richard Palethorpe <[email protected]>
1 parent 1ae0b89 commit 7f61d39

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ ifeq ($(BUILD_TYPE),openblas)
126126
endif
127127

128128
ifeq ($(BUILD_TYPE),cublas)
129-
CGO_LDFLAGS+=-lcublas -lcudart -L$(CUDA_LIBPATH)
129+
CGO_LDFLAGS+=-lcublas -lcudart -L$(CUDA_LIBPATH) -L$(CUDA_LIBPATH)/stubs/ -lcuda
130130
export GGML_CUDA=1
131-
CGO_LDFLAGS_WHISPER+=-L$(CUDA_LIBPATH)/stubs/ -lcuda -lcufft
131+
CGO_LDFLAGS_WHISPER+=-lcufft
132132
endif
133133

134134
ifeq ($(BUILD_TYPE),vulkan)

backend/go/image/stablediffusion-ggml/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CMAKE_ARGS+=-DBUILD_SHARED_LIBS=OFF
2020

2121
# If build type is cublas, then we set -DGGML_CUDA=ON to CMAKE_ARGS automatically
2222
ifeq ($(BUILD_TYPE),cublas)
23-
CMAKE_ARGS+=-DGGML_CUDA=ON
23+
CMAKE_ARGS+=-DSD_CUDA=ON
2424
# If build type is openblas then we set -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
2525
# to CMAKE_ARGS automatically
2626
else ifeq ($(BUILD_TYPE),openblas)
@@ -30,14 +30,14 @@ else ifeq ($(BUILD_TYPE),clblas)
3030
CMAKE_ARGS+=-DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
3131
# If it's hipblas we do have also to set CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++
3232
else ifeq ($(BUILD_TYPE),hipblas)
33-
CMAKE_ARGS+=-DGGML_HIP=ON
33+
CMAKE_ARGS+=-DSD_HIPBLAS=ON
3434
# If it's OSX, DO NOT embed the metal library - -DGGML_METAL_EMBED_LIBRARY=ON requires further investigation
3535
# But if it's OSX without metal, disable it here
3636
else ifeq ($(OS),Darwin)
3737
ifneq ($(BUILD_TYPE),metal)
38-
CMAKE_ARGS+=-DGGML_METAL=OFF
38+
CMAKE_ARGS+=-DSD_METAL=OFF
3939
else
40-
CMAKE_ARGS+=-DGGML_METAL=ON
40+
CMAKE_ARGS+=-DSD_METAL=ON
4141
CMAKE_ARGS+=-DGGML_METAL_EMBED_LIBRARY=ON
4242
TARGET+=--target ggml-metal
4343
endif

0 commit comments

Comments
 (0)