Skip to content

Commit 049b3a0

Browse files
authored
go : fix CUDA build (#2416)
* Fixed go cuda bindings building * Added note to go bindings Readme to build using cuda support --------- Co-authored-by: Binozo <[email protected]>
1 parent a551933 commit 049b3a0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bindings/go/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ EXAMPLES_DIR := $(wildcard examples/*)
1717
INCLUDE_PATH := $(abspath ../../include):$(abspath ../../ggml/include)
1818
LIBRARY_PATH := $(abspath ../..)
1919

20+
ifeq ($(GGML_CUDA),1)
21+
LIBRARY_PATH := $(LIBRARY_PATH):$(CUDA_PATH)/targets/$(UNAME_M)-linux/lib/
22+
BUILD_FLAGS := -ldflags "-extldflags '-lcudart -lcuda -lcublas'"
23+
endif
24+
2025
ifeq ($(UNAME_S),Darwin)
2126
EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit
2227
endif

bindings/go/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ This will compile a static `libwhisper.a` in a `build` folder, download a model
6262
make examples
6363
```
6464

65+
To build using cuda support add `GGML_CUDA=1`:
66+
67+
```bash
68+
GGML_CUDA=1 make examples
69+
```
70+
6571
The examples are placed in the `build` directory. Once built, you can download all the models with the following command:
6672

6773
```bash

0 commit comments

Comments
 (0)