Skip to content

Commit

Permalink
go : fix CUDA build (ggerganov#2416)
Browse files Browse the repository at this point in the history
* Fixed go cuda bindings building

* Added note to go bindings Readme to build using cuda support

---------

Co-authored-by: Binozo <[email protected]>
  • Loading branch information
2 people authored and iThalay committed Sep 23, 2024
1 parent 063af9f commit 0c9206b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bindings/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions bindings/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c9206b

Please sign in to comment.