diff --git a/sys/build.rs b/sys/build.rs index 5db8a88..6f5a4eb 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -175,6 +175,8 @@ fn main() { if cfg!(feature = "cuda") { config.define("GGML_CUDA", "ON"); + config.define("NVCC_APPEND_FLAGS", "-fPIC"); + config.cxxflag("-fPIC"); } if cfg!(feature = "hipblas") {