Spaces:
Running
Running
Binozo
Binozo
commited on
go : fix CUDA build (#2416)
Browse files* Fixed go cuda bindings building
* Added note to go bindings Readme to build using cuda support
---------
Co-authored-by: Binozo <[email protected]>
- bindings/go/Makefile +5 -0
- bindings/go/README.md +6 -0
bindings/go/Makefile
CHANGED
|
@@ -17,6 +17,11 @@ EXAMPLES_DIR := $(wildcard examples/*)
|
|
| 17 |
INCLUDE_PATH := $(abspath ../../include):$(abspath ../../ggml/include)
|
| 18 |
LIBRARY_PATH := $(abspath ../..)
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
ifeq ($(UNAME_S),Darwin)
|
| 21 |
EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit
|
| 22 |
endif
|
|
|
|
| 17 |
INCLUDE_PATH := $(abspath ../../include):$(abspath ../../ggml/include)
|
| 18 |
LIBRARY_PATH := $(abspath ../..)
|
| 19 |
|
| 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 |
+
|
| 25 |
ifeq ($(UNAME_S),Darwin)
|
| 26 |
EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit
|
| 27 |
endif
|
bindings/go/README.md
CHANGED
|
@@ -62,6 +62,12 @@ This will compile a static `libwhisper.a` in a `build` folder, download a model
|
|
| 62 |
make examples
|
| 63 |
```
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
The examples are placed in the `build` directory. Once built, you can download all the models with the following command:
|
| 66 |
|
| 67 |
```bash
|
|
|
|
| 62 |
make examples
|
| 63 |
```
|
| 64 |
|
| 65 |
+
To build using cuda support add `GGML_CUDA=1`:
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
GGML_CUDA=1 make examples
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
The examples are placed in the `build` directory. Once built, you can download all the models with the following command:
|
| 72 |
|
| 73 |
```bash
|