ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
35.26k stars 3.6k forks source link

go bind make test found err: undefined reference to `ggml_backend_cuda_init' #2473

Open futurewin opened 2 weeks ago

futurewin commented 2 weeks ago

/home/whisper.cpp/bindings/go$ make test Mkdir build Mkdir models Build whisper make[1]: Entering directory '/home/whisper.cpp/whisper.cpp' I ccache not found. Consider installing it for faster compilation. I whisper.cpp build info: I UNAME_S: Linux I UNAME_P: x86_64 I UNAME_M: x86_64 I CFLAGS: -Iggml/include -Iggml/src -Iinclude -Isrc -Iexamples -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG -DGGML_USE_OPENMP -std=c11 -fPIC -O3 -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -pthread -march=native -mtune=native -fopenmp -Wdouble-promotion I CXXFLAGS: -std=c++11 -fPIC -O3 -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -pthread -fopenmp -march=native -mtune=native -Wno-array-bounds -Wno-format-truncation -Wextra-semi -Iggml/include -Iggml/src -Iinclude -Isrc -Iexamples -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG -DGGML_USE_OPENMP I NVCCFLAGS: -std=c++11 -O3 I LDFLAGS:
I CC: cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0 I CXX: c++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0

make[1]: 'libwhisper.a' is up to date. make[1]: Leaving directory '/home/whisper.cpp/whisper.cpp' Build example go-model-download Skipping https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin as it already exists

github.com/ggerganov/whisper.cpp/bindings/go.test

/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /usr/bin/gcc -m64 -s -o $WORK/b001/go.test -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=callEncoderBegin -Wl,--export-dynamic-symbol=callNewSegment -Wl,--export-dynamic-symbol=callProgress -Wl,--export-dynamic-symbol=crosscall2 -Wl,--compress-debug-sections=zlib /tmp/go-link-3117941350/go.o /tmp/go-link-3117941350/000000.o /tmp/go-link-3117941350/000001.o /tmp/go-link-3117941350/000002.o /tmp/go-link-3117941350/000003.o /tmp/go-link-3117941350/000004.o /tmp/go-link-3117941350/000005.o /tmp/go-link-3117941350/000006.o /tmp/go-link-3117941350/000007.o /tmp/go-link-3117941350/000008.o /tmp/go-link-3117941350/000009.o /tmp/go-link-3117941350/000010.o /tmp/go-link-3117941350/000011.o /tmp/go-link-3117941350/000012.o /tmp/go-link-3117941350/000013.o /tmp/go-link-3117941350/000014.o /tmp/go-link-3117941350/000015.o /tmp/go-link-3117941350/000016.o /tmp/go-link-3117941350/000017.o /tmp/go-link-3117941350/000018.o /tmp/go-link-3117941350/000019.o /tmp/go-link-3117941350/000020.o /tmp/go-link-3117941350/000021.o /tmp/go-link-3117941350/000022.o -O2 -g -lwhisper -lm -lstdc++ -fopenmp -O2 -g -lpthread -O2 -g -lresolv -no-pie /usr/bin/ld: /home/whisper.cpp/libwhisper.a(whisper.o): in function whisper_init_state': whisper.cpp:(.text+0x15707): undefined reference toggml_backend_cuda_init' /usr/bin/ld: /home/whisper.cpp/libwhisper.a(whisper.o): in function whisper_model_load(whisper_model_loader*, whisper_context&)': whisper.cpp:(.text+0x1c163): undefined reference toggml_backend_cuda_buffer_type' /usr/bin/ld: /home/whisper.cpp/libwhisper.a(ggml-backend.o): in function get_reg()': ggml-backend.cpp:(.text+0x63bf): undefined reference toggml_backend_cuda_reg' collect2: error: ld returned 1 exit status

FAIL github.com/ggerganov/whisper.cpp/bindings/go [build failed] FAIL make: *** [Makefile:40: test] Error 1

futurewin commented 2 weeks ago

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Thu_Mar_28_02:18:24_PDT_2024 Cuda compilation tools, release 12.4, V12.4.131 Build cuda_12.4.r12.4/compiler.34097967_0