Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package com.nvidia.cuvs.spi;
Expand Down Expand Up @@ -34,9 +34,12 @@ private static CuVSProvider loadProvider() {
}

static CuVSProvider builtinProvider() {
var supportedJavaRuntime = Runtime.version().feature() > 21;
var supportedOs = System.getProperty("os.name").startsWith("Linux");
var supportedArchitecture = System.getProperty("os.arch").equals("amd64");
var javaRuntimeVersion = Runtime.version().feature();
var osName = System.getProperty("os.name");
var osArch = System.getProperty("os.arch");
var supportedJavaRuntime = javaRuntimeVersion > 21;
var supportedOs = osName.startsWith("Linux");
var supportedArchitecture = osArch.equals("amd64");
if (supportedJavaRuntime && supportedOs && supportedArchitecture) {
try {
var cls = Class.forName("com.nvidia.cuvs.spi.JDKProvider");
Expand All @@ -52,13 +55,15 @@ static CuVSProvider builtinProvider() {
}
List<String> unsupportedReasons = new ArrayList<>();
if (!supportedJavaRuntime) {
unsupportedReasons.add("cuvs-java requires Java Runtime version 22 or greater");
unsupportedReasons.add(
"cuvs-java requires Java Runtime version 22 or greater, but found "
+ javaRuntimeVersion);
}
if (!supportedOs) {
unsupportedReasons.add("cuvs-java supports only Linux");
unsupportedReasons.add("cuvs-java supports only Linux, but os.name is " + osName);
}
if (!supportedArchitecture) {
unsupportedReasons.add("cuvs-java supports only x86");
unsupportedReasons.add("cuvs-java supports only x86-64 (amd64), but os.arch is " + osArch);
}

return new UnsupportedProvider(String.join("; ", unsupportedReasons));
Expand Down
Loading