Skip to content
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

Error creating native binaries using Quarkus and GraalVM #7362

Closed
jesuino opened this issue Mar 26, 2019 · 6 comments
Closed

Error creating native binaries using Quarkus and GraalVM #7362

jesuino opened this issue Mar 26, 2019 · 6 comments
Labels
Bug Bugs and problems Enhancement New features and other enhancements Graalvm

Comments

@jesuino
Copy link

jesuino commented Mar 26, 2019

Issue Description

A microservice using quarkus fails to create the native binary with the following error (and many others):

Caused by: java.lang.IllegalArgumentException: Invalid Structure field in class com.sun.jna.platform.win32.Variant$VARIANT$_VARIANT$__VARIANT, field name 'ullVal' (class com.sun.jna.platform.win32.WinDef$ULONGLONG): The type "com.sun.jna.platform.win32.WinDef$ULONGLONG" is not supported: Unsupported size: 16
	at com.sun.jna.Structure.validateField(Structure.java:1153)
	at com.sun.jna.Structure.validateFields(Structure.java:1162)
	at com.sun.jna.Structure.<init>(Structure.java:189)
	at com.sun.jna.Structure.<init>(Structure.java:182)
	at com.sun.jna.Structure.<init>(Structure.java:178)
	at com.sun.jna.Union.<init>(Union.java:49)
	at com.sun.jna.platform.win32.Variant$VARIANT$_VARIANT$__VARIANT.<init>(Variant.java:749)
	... 76 more

And also:

Original exception that caused the problem: java.lang.UnsatisfiedLinkError: Unable to load library 'Advapi32': Native library (linux-x86-64/libAdvapi32.so) not found in resource path 

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j version -> 1.0.0-beta3
  • platform information (OS, etc)

RHEL 7

Java version:

$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Graal: Version: Community Edition 1.0.0-rc13.

Contributing

You can reproduce the issue using the following project: https://github.com/jesuino/java-ml-projects/tree/master/integration/microservices/image-classifier-microservice

Steps:

  1. Download GRAAL VM and set GRAALVM_HOME environment variable accordingly
  2. Run: mvn clean install -Pnative
@saudet
Copy link
Contributor

saudet commented Mar 27, 2019

Sounds like issues with Graal more than anything else. Let's start by getting JavaCPP working maybe, could you try to build that one first?

@saudet saudet added Bug Bugs and problems Java labels Mar 27, 2019
@saudet saudet self-assigned this Mar 27, 2019
@jesuino
Copy link
Author

jesuino commented Mar 28, 2019

I tried a very simple example using javacpp but I could not get it working yet, will continue another day

https://github.com/jesuino/quarkus-examples/tree/master/test-javacpp

It fails with an exception that seems to be simple to solve:

org.jboss.resteasy.spi.UnhandledException: java.lang.UnsatisfiedLinkError: no jniTestResource in java.library.path

Tried a few things, but never got it working.

@saudet
Copy link
Contributor

saudet commented Mar 29, 2019

What happens with the unit tests of JavaCPP itself?

@jesuino
Copy link
Author

jesuino commented May 4, 2019

Hello @saudet - just to let you know, I tried to run JavaCPP with quarkus, got stuck even before making it work only with Java (no native compilation) I will update to the latest quarkus and try later again, if you want to take a look here is -> https://github.com/jesuino/quarkus-examples/tree/master/test-javacpp - I will let you know if I make any progress.

@raver119 raver119 removed the Java label Nov 10, 2019
saudet added a commit to bytedeco/javacpp that referenced this issue Jun 8, 2020
saudet added a commit to bytedeco/javacpp-presets that referenced this issue Jun 8, 2020
saudet added a commit to bytedeco/javacpp that referenced this issue Jun 9, 2020
saudet added a commit to bytedeco/javacpp-presets that referenced this issue Jun 9, 2020
@saudet
Copy link
Contributor

saudet commented Jun 9, 2020

JavaCPP now works with GraalVM's native-image:
https://github.com/bytedeco/sample-projects/tree/master/opencv-stitching-native
It shouldn't take much to get the core of DL4J working as well, but please let me know if you encounter any issues with JavaCPP, thanks!

@agibsonccc
Copy link
Contributor

Minor update here: dl4j can work with graalvm/quarkus. Nd4j properly works on there. In the release after next (which will be going out likely next week) we'll add full support + examples, but for now anyone who wants to use it, please flag us on the forums: https://community.konduit.ai/ and we can be of more help.

@agibsonccc agibsonccc added Enhancement New features and other enhancements Graalvm labels Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bugs and problems Enhancement New features and other enhancements Graalvm
Projects
None yet
Development

No branches or pull requests

4 participants