When building the Java bindings with CUDA support enabled, the resulting onnxruntime-genai-[version].jar is incomplete for GPU execution.
Specifically, the POST_BUILD commands in src/java/CMakeLists.txt explicitly copy onnxruntime-genai.dll and onnxruntime-genai-jni.dll to the native-lib staging directory, but there is no corresponding instruction to include onnxruntime-genai-cuda.dll.
Additionally, even if the library were present in the JAR, the GenAI.java source lacks the necessary logic to identify and extract the CUDA-specific binary to the temporary runtime directory, preventing the library from being loaded by the JVM.
When building the Java bindings with CUDA support enabled, the resulting
onnxruntime-genai-[version].jaris incomplete for GPU execution.Specifically, the POST_BUILD commands in
src/java/CMakeLists.txtexplicitly copyonnxruntime-genai.dllandonnxruntime-genai-jni.dllto thenative-libstaging directory, but there is no corresponding instruction to includeonnxruntime-genai-cuda.dll.Additionally, even if the library were present in the JAR, the
GenAI.javasource lacks the necessary logic to identify and extract the CUDA-specific binary to the temporary runtime directory, preventing the library from being loaded by the JVM.