-
Notifications
You must be signed in to change notification settings - Fork 143
[Java] Add reason(s) to UnsupportedProvider/UnsupportedOperationExceptions #1314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 3 commits into
rapidsai:branch-25.10
from
ldematte:java/improve-error-messages
Sep 11, 2025
Merged
[Java] Add reason(s) to UnsupportedProvider/UnsupportedOperationExceptions #1314
rapids-bot
merged 3 commits into
rapidsai:branch-25.10
from
ldematte:java/improve-error-messages
Sep 11, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Sep 5, 2025
ChrisHegarty
approved these changes
Sep 5, 2025
Contributor
ChrisHegarty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ldematte. LGTM
This was referenced Sep 8, 2025
Closed
Contributor
|
I'm 👍 too on this, and with #1315. I'm waiting on 1296's final approval, to queue these up. |
Contributor
|
/ok to test e7c7640 |
mythrocks
approved these changes
Sep 10, 2025
Contributor
|
/merge |
rapids-bot bot
pushed a commit
that referenced
this pull request
Sep 14, 2025
This PR extends #1314 to add version check (version reported by libcuvs vs. cuvs-java build version) It replaces #1315 which was already reviewed and approved, but got closed before I could rebase it. Authors: - Lorenzo Dematté (https://github.com/ldematte) Approvers: - MithunR (https://github.com/mythrocks) URL: #1327
rapids-bot bot
pushed a commit
that referenced
this pull request
Sep 15, 2025
…to UnsupportedProvider/UnsupportedOperationExceptions (#1316) This PR further extends #1296 and #1314 to give meaningful error messages in case libcuvs fails to load. The `jextract` generated bindings we use in cuvs-java use `SymbolLookup#libraryLookup` to load the `cuvs_c` dynamic library; this uses `RawNativeLibraries#load` (see https://github.com/openjdk/jdk/blob/master/src/java.base/share/native/libjava/RawNativeLibraries.c#L58); `RawNativeLibraries#load` in turn calls `JVM_LoadLibrary`. `JVM_LoadLibrary` does a good job to put together a good error message (e.g. calling `dlerror`, trying to locate and inspect the file for platform mismatch, etc. Unfortunately, `RawNativeLibraries#load` calls it passing false to the `throwException` parameter, which means that the detailed error messages are not surfaced. This PR follows the pattern introduced in #1296 and preloads libcuvs (and dependencies) using `JVM_LoadLibrary` directly with `throwException` true; preloading it will also cause the OS to look for and load all dependencies. In case of error we can see what's broken in better detail; e.g. if `libcuvs_c.so` is present, but `librmm.so` is missing: ``` java.lang.UnsupportedOperationException: cannot create JDKProvider: libcuvs_c.so: librmm.so: cannot open shared object file: No such file or directory at [email protected]/com.nvidia.cuvs.spi.UnsupportedProvider.newCuVSResources(UnsupportedProvider.java:35) at [email protected]/com.nvidia.cuvs.CuVSResources.create(CuVSResources.java:90) at [email protected]/com.nvidia.cuvs.CuVSResources.create(CuVSResources.java:79) ``` Fixes #1321 Authors: - Lorenzo Dematté (https://github.com/ldematte) Approvers: - Ishan Chattopadhyaya (https://github.com/chatman) - Chris Hegarty (https://github.com/ChrisHegarty) - MithunR (https://github.com/mythrocks) URL: #1316
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds some precise and readable messages specifying why a CuVSProvider is unsupported (it throws UnsupportedOperationException), to help with diagnosing cuvs-java startup issues.