Skip to content

Commit 60cab92

Browse files
authored
SOLR-18210: Fix for GPU accelerated vector indexing silently falling back to using CPU (#4328)
1 parent b4cb0e0 commit 60cab92

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Fix for GPU vector indexing silently falling back to using CPU instead
2+
type: fixed
3+
authors:
4+
- name: Rahul Goswami
5+
links:
6+
- name: SOLR-18210
7+
url: https://issues.apache.org/jira/browse/SOLR-18210

solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ public static synchronized GpuMetricsService getInstance() {
7777

7878
public void initialize(CoreContainer coreContainer) {
7979
if (initialized.compareAndSet(false, true)) {
80+
// Ensure CUDA runtime is loaded before any cuVS provider access
81+
try {
82+
System.loadLibrary("cudart");
83+
} catch (UnsatisfiedLinkError e) {
84+
String msg = e.getMessage();
85+
if (msg != null && msg.contains("already loaded in another classloader")) {
86+
// cudart is available, just loaded elsewhere - safe to continue
87+
} else {
88+
log.warn("Could not load CUDA runtime library (libcudart not available) ", e);
89+
}
90+
}
8091
this.metricManager = coreContainer.getMetricManager();
8192
startBackgroundService();
8293
log.info("GPU metrics service initialized");

0 commit comments

Comments
 (0)