Apache Solr open-source search software
SOLR-18210: Fix for GPU accelerated vector indexing silently falling back to using CPU (#4328)
Rahul Goswami60cab92ef0a9
diff --git a/changelog/unreleased/SOLR-18210-fix-GPU-vector-indexing.yml b/changelog/unreleased/SOLR-18210-fix-GPU-vector-indexing.ymlnew file mode 100644index 00000000000..54a479f18f3--- /dev/null+++ b/changelog/unreleased/SOLR-18210-fix-GPU-vector-indexing.yml@@ -0,0 +1,7 @@+title: Fix for GPU vector indexing silently falling back to using CPU instead+type: fixed+authors:+ - name: Rahul Goswami+links:+ - name: SOLR-18210+ url: https://issues.apache.org/jira/browse/SOLR-18210diff --git a/solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java b/solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.javaindex 9156a55841c..02268a37368 100644--- a/solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java+++ b/solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java@@ -77,6 +77,17 @@ public class GpuMetricsService implements GpuMetricsProvider {public void initialize(CoreContainer coreContainer) {if (initialized.compareAndSet(false, true)) {+ // Ensure CUDA runtime is loaded before any cuVS provider access+ try {+ System.loadLibrary("cudart");+ } catch (UnsatisfiedLinkError e) {+ String msg = e.getMessage();+ if (msg != null && msg.contains("already loaded in another classloader")) {+ // cudart is available, just loaded elsewhere - safe to continue+ } else {+ log.warn("Could not load CUDA runtime library (libcudart not available) ", e);+ }+ }this.metricManager = coreContainer.getMetricManager();startBackgroundService();log.info("GPU metrics service initialized");