From 3d33a734581d8cc8bb018489622398bac4384603 Mon Sep 17 00:00:00 2001 From: hyiip Date: Wed, 19 Feb 2025 02:55:46 +0800 Subject: [PATCH 1/2] link cuda when cuda feature is on --- sys/build.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/build.rs b/sys/build.rs index 8181d24..ecea43e 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -265,6 +265,10 @@ fn main() { if cfg!(feature = "metal") { println!("cargo:rustc-link-lib=static=ggml-metal"); } + + if cfg!(feature = "cuda") { + println!("cargo:rustc-link-lib=static=ggml-cuda"); + } println!( "cargo:WHISPER_CPP_VERSION={}", From c48629c172f54fa38e4d34b23b1660d8900a38c4 Mon Sep 17 00:00:00 2001 From: hyiip Date: Wed, 19 Feb 2025 03:11:51 +0800 Subject: [PATCH 2/2] fmt fixed --- sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/build.rs b/sys/build.rs index ecea43e..8fd47a1 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -265,7 +265,7 @@ fn main() { if cfg!(feature = "metal") { println!("cargo:rustc-link-lib=static=ggml-metal"); } - + if cfg!(feature = "cuda") { println!("cargo:rustc-link-lib=static=ggml-cuda"); }