From 23c70a0a16d98f4c4209c906a6376b50c59040ed Mon Sep 17 00:00:00 2001 From: Binozo Date: Sat, 14 Sep 2024 19:34:43 +0200 Subject: [PATCH 1/2] Fixed go cuda bindings building --- bindings/go/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bindings/go/Makefile b/bindings/go/Makefile index 20a054c116f..ca39de20555 100644 --- a/bindings/go/Makefile +++ b/bindings/go/Makefile @@ -17,6 +17,11 @@ EXAMPLES_DIR := $(wildcard examples/*) INCLUDE_PATH := $(abspath ../../include):$(abspath ../../ggml/include) LIBRARY_PATH := $(abspath ../..) +ifeq ($(GGML_CUDA),1) + LIBRARY_PATH := $(LIBRARY_PATH):$(CUDA_PATH)/targets/$(UNAME_M)-linux/lib/ + BUILD_FLAGS := -ldflags "-extldflags '-lcudart -lcuda -lcublas'" +endif + ifeq ($(UNAME_S),Darwin) EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit endif From 732cf8785dfce29040399a24d313dfa0a910f322 Mon Sep 17 00:00:00 2001 From: Binozo Date: Sat, 14 Sep 2024 19:38:34 +0200 Subject: [PATCH 2/2] Added note to go bindings Readme to build using cuda support --- bindings/go/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindings/go/README.md b/bindings/go/README.md index 1968cfd2470..6958ede80f2 100644 --- a/bindings/go/README.md +++ b/bindings/go/README.md @@ -62,6 +62,12 @@ This will compile a static `libwhisper.a` in a `build` folder, download a model make examples ``` +To build using cuda support add `GGML_CUDA=1`: + +```bash +GGML_CUDA=1 make examples +``` + The examples are placed in the `build` directory. Once built, you can download all the models with the following command: ```bash