Open JiangWork opened 8 months ago
@oubidar-Abderrahim I have created new issue
Thanks for filing the ticket, @JiangWork. As the error correctly suggests, the Native Image builder also has a dependency on ai.onnxruntime
. We are looking into a fix for this.
In my testing version "GraalVM CE 21.0.2+13.1" seems to not throw this error anymore
@zekronium Looks like it is community version? I am using enterprise version. Let me try "GraalVM CE 21.0.2+13.1"
@zekronium Looks like it is community version? I am using enterprise version. Let me try "GraalVM CE 21.0.2+13.1"
I was encountering the same exact issue with CE too
hi, @fniephaus. Just want to check, any plan to fix this issue?
Yes, we are working on a fix for this as we speak. We'll share an update as soon as it's ready.
@fniephaus any updates on this? I too am tripping on the same issue. This effectively prevents creation of a native image for AI applications using AllMiniLmL6V2EmbeddingModel because this class has a dependency on the onnxruntime jar.
I worked on a shared library, which uses onnxruntime for inference. When I use
native-image -jar ./target/test-1.0-SNAPSHOT-jar-with-dependencies.jar --shared -H:Name=libtest
to generate shared library, i get the following error:Error: Class-path entry file:///xxx/target/test-1.0-SNAPSHOT-jar-with-dependencies.jar contains class ai.onnxruntime.ValueInfo. This class is part of the image builder itself (in file:///xxx/graalvm-jdk-21.0.1+12.1/Contents/Home/lib/svm/builder/svm-enterprise.jar) and must not be passed via -cp. This can be caused by a fat-jar that illegally includes svm.jar (or graal-sdk.jar) due to its build-time dependency on it. As a workaround, -H:+AllowDeprecatedBuilderClassesOnImageClasspath allows turning this error into a warning. Note that this option is deprecated and will be removed in a future version.
When I added the '-H:+AllowDeprecatedBuilderClassesOnImageClasspath' parameter according to the instructions, I can have the shared library, but when use the shared library, it errors with:
java.lang.NoClassDefFoundError: ai.onnxruntime.OrtEnvironment
Graal version: graalvm-jdk-21.0.1+12.1
Reproducible code attached: test.zip
run
mvn package
and thennative-image -jar ./target/test-1.0-SNAPSHOT-jar-with-dependencies.jar --shared -H:Name=libtest