6c3fd449ce
Introduces an Explore view with a tag cloud that clusters image embeddings using cosine k-means and labels clusters via vocabulary-nearest-neighbour CLIP matching. Vocabulary embeddings are disk-cached (FNV hash-keyed) to avoid redundant inference. Enables CUDA for candle dependencies and adds a build.rs check that surfaces a clear error when the toolkit is missing.
29 lines
1.6 KiB
Rust
29 lines
1.6 KiB
Rust
fn main() {
|
|
tauri_build::build();
|
|
|
|
// When the candle-cuda feature is enabled, verify the CUDA Toolkit is present
|
|
// so the developer gets a clear message rather than an obscure cudarc/cc error.
|
|
if std::env::var("CARGO_FEATURE_CANDLE_CUDA").is_ok() {
|
|
let cuda_path = std::env::var("CUDA_PATH"); // Set by the CUDA Toolkit installer on Windows
|
|
let nvcc_found = std::process::Command::new("nvcc")
|
|
.arg("--version")
|
|
.output()
|
|
.map(|o| o.status.success())
|
|
.unwrap_or(false);
|
|
|
|
if cuda_path.is_ok() || nvcc_found {
|
|
if let Ok(path) = &cuda_path {
|
|
println!("cargo:warning=CUDA Toolkit found at {path} — GPU acceleration enabled.");
|
|
} else {
|
|
println!("cargo:warning=CUDA Toolkit (nvcc) found in PATH — GPU acceleration enabled.");
|
|
}
|
|
} else {
|
|
println!("cargo:warning=━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
println!("cargo:warning= candle-cuda feature is enabled but no CUDA Toolkit found.");
|
|
println!("cargo:warning= Install CUDA Toolkit from https://developer.nvidia.com/cuda-downloads");
|
|
println!("cargo:warning= Or build without GPU support: cargo build --no-default-features");
|
|
println!("cargo:warning=━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
}
|
|
}
|
|
}
|