Skip to content
Closed
Show file tree
Hide file tree
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
Expand Up @@ -9,6 +9,10 @@

package org.elasticsearch.nativeaccess;

import org.elasticsearch.logging.LogManager;

import java.lang.foreign.Arena;
import java.lang.foreign.SymbolLookup;
import java.nio.file.Path;
import java.util.Optional;
import java.util.OptionalLong;
Expand All @@ -18,6 +22,11 @@
*/
public interface NativeAccess {

static void loadCuvs() {
var libCuvs = SymbolLookup.libraryLookup(System.mapLibraryName("cuvs_c"), Arena.ofAuto());
LogManager.getLogger(NativeAccess.class).info("Loaded libcuvs_c.so: " + libCuvs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solely for logging / debugging purposes, right? And if cuVS is not present then null or something is printed? (which is fine)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep!

}

/**
* Get the one and only instance of {@link NativeAccess} which is specific to the running platform and JVM.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
bootstrap.spawner().spawnNativeControllers(nodeEnv);

nodeEnv.validateNativesConfig(); // temporary directories are important for JNA
NativeAccess.loadCuvs();
initializeNatives(
nodeEnv.tmpDir(),
BootstrapSettings.MEMORY_LOCK_SETTING.get(args.nodeSettings()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class GPUClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
.module("gpu")
.setting("xpack.license.self_generated.type", "trial")
.setting("xpack.security.enabled", "false")
.environment("LD_LIBRARY_PATH", System.getenv("LD_LIBRARY_PATH"))
.build();

public GPUClientYamlTestSuiteIT(final ClientYamlTestCandidate testCandidate) {
Expand Down