tazz4843/whisper-rs

Add bindings to get_gpu_list for getting GPU numbers list

thewh1teagle opened this issue · 0 comments

How can we add bindings to the following function in whisper.cpp? -

ggml_sycl_get_gpu_list

Update:
I tried to update the bindings, and include that header + cpp file.
Then created safe bindings.
But it failed to link it. even when I pass GGML_SYCL=ON in cmake.

log
error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/user/.bun/bin:/Users/user/flutter/bin:/opt/homebrew/opt/node@18/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin:/Users/user/.bun/bin:/Users/user/flutter/bin:/opt/homebrew/opt/node@18/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/user/.cargo/bin:/Users/user/Library/Android/sdk/tools:/Users/user/Library/Android/sdk/platform-tools:/Users/user/go/bin:/Users/user/.pub-cache/bin:/Users/user/.bin:/Users/user/zig:/Applications/CMake.app/Contents/bin:/Users/user/Library/Android/sdk/tools:/Users/user/Library/Android/sdk/platform-tools:/Users/user/go/bin:/Users/user/.pub-cache/bin:/Users/user/.bin:/Users/user/zig:/Applications/CMake.app/Contents/bin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-arch" "arm64" "/var/folders/sz/4_ymp61s34jdxsgqgtbrs3vh0000gn/T/rustc6NT3D6/symbols.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.1890he371eisr7lz.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.1a9ikhhpy3tgtkiv.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.1vp1x7eb2yp30oxk.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.2g9q2fctrwpt2kwp.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.2n4fekaeeih7mpdj.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.36i7zxtf3iufbcwn.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.39kkvc3yzagale3n.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.3dt5p32w71by4lpv.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.3nlavg0aoaxjeo4d.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.3texogk68hjrtb7.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.3vmxjc6j8dx7fy70.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.4753c1rox716v80y.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.4edgp4ib8uon5my7.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.5anc0h437p8jels3.rcgu.o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855.2s3xga348q5itc37.rcgu.o" "-L" "/Users/user/Documents/whisper-rs/target/debug/deps" "-L" "/Users/user/Documents/whisper-rs/target/debug/build/whisper-rs-sys-3f667c4afdde06f4/out/build" "-L" "/Users/user/Documents/whisper-rs/target/debug/build/whisper-rs-sys-3f667c4afdde06f4/out" "-L" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/user/Documents/whisper-rs/target/debug/deps/libwhisper_rs-841538be6006c05d.rlib" "/Users/user/Documents/whisper-rs/target/debug/deps/libwhisper_rs_sys-5605decaf0d0f2b6.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-b0083070c892a1db.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-8282820217d7b362.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-f163e9d1987a8318.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-350512940f04084a.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-e19e4ea986b9addc.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-363744fff3c4e7ba.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-e1d006f163566466.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-dea09910a3b22702.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-4802352fcc77de56.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-e71c86d9086176a7.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-6d82e7a8c3f5e2c7.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-e66d24d044cc2029.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-46eaa7bd445cb528.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-3c8a48285a1e7255.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-50e20e60add24734.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-edb678dd3e28691a.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-3b6c10a2acaa607f.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-2447397acf63b01e.rlib" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-5816c590a0da89c2.rlib" "-lc++" "-framework" "Accelerate" "-lSystem" "-lc" "-lm" "-L" "/Users/user/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/user/Documents/whisper-rs/target/debug/deps/main-523bf20c9f122855" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: Undefined symbols:
            _ggml_backend_sycl_get_device_count, referenced from:
                whisper_rs::ggml_sycl::get_gpu_devices::hafafd242edef1d21 in libwhisper_rs-841538be6006c05d.rlib[26](whisper_rs-841538be6006c05d.40w1vavp4dzl3rfy.rcgu.o)
            _ggml_sycl_get_device_description, referenced from:
                whisper_rs::ggml_sycl::get_gpu_devices::hafafd242edef1d21 in libwhisper_rs-841538be6006c05d.rlib[26](whisper_rs-841538be6006c05d.40w1vavp4dzl3rfy.rcgu.o)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)