This is an automated email from the ASF dual-hosted git repository.

rahulgoswami pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_10_0 by this push:
     new 0c283924ec3 SOLR-18210: Fix for GPU accelerated vector indexing 
silently falling back to using CPU (#4328)
0c283924ec3 is described below

commit 0c283924ec3c3d1a29102a0eab45207640bd1fcc
Author: Rahul Goswami <[email protected]>
AuthorDate: Tue May 5 10:25:04 2026 -0400

    SOLR-18210: Fix for GPU accelerated vector indexing silently falling back 
to using CPU (#4328)
    
    (cherry picked from commit 60cab92ef0a9a307d4245c61144d27aede57e893)
---
 changelog/unreleased/SOLR-18210-fix-GPU-vector-indexing.yml   |  7 +++++++
 .../cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java | 11 +++++++++++
 2 files changed, 18 insertions(+)

diff --git a/changelog/unreleased/SOLR-18210-fix-GPU-vector-indexing.yml 
b/changelog/unreleased/SOLR-18210-fix-GPU-vector-indexing.yml
new file mode 100644
index 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-18210
diff --git 
a/solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java 
b/solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java
index 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");

Reply via email to