Skip to content

[BUG] CuVSProvider.java needs to load cudart to prevent provider load error #2300

Description

@rahulgoswami

I encountered a class load failure with behavior with cuv-lucene while trying GPU acceleration feature in Apache Solr 10. Turns out that in the flow to get the CuVSProvider instance, precisely at this line: https://github.com/apache/solr/blob/releases/solr/10.0.0/solr/modules/cuvs/src/java/org/apache/solr/cuvs/GpuMetricsService.java#L154

the call runs into a class loader exception and renders future calls to CuVSProvider in that error state.

RCA pointed to "cudart.so" not being loaded and I submitted the following fix for the same in Solr : apache/solr#4328

However in my opinion the same fix really belongs in CuVSProvider.provider() method (https://github.com/NVIDIA/cuvs/blob/main/java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java#L196) to load the system library so that the provider is available upon the static method call by upper layers ( cuvs-java --> cuvs-lucene --> Solr).

cuvs-lucene is doing a similar explicit load in https://github.com/NVIDIA/cuvs-lucene/blob/main/src/main/java/com/nvidia/cuvs/lucene/Utils.java#L145

Note: Solr 10 uses lucene-cuvs version 25.10.0 which is where I observed the issue. I am working on tests to see if the issue also reproduces on cuvs main. But I see that the code for that part has not changed so in all likelihood the issue is still relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions