Deeplearning4j: Error creating native binaries using Quarkus and GraalVM

Created on 26 Mar 2019  路  5Comments  路  Source: eclipse/deeplearning4j

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.(Structure.java:189)
at com.sun.jna.Structure.(Structure.java:182)
at com.sun.jna.Structure.(Structure.java:178)
at com.sun.jna.Union.(Union.java:49)
at com.sun.jna.platform.win32.Variant$VARIANT$_VARIANT$__VARIANT.(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

Bug

All 5 comments

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?

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.

What happens with the unit tests of JavaCPP itself?

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.

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!

Was this page helpful?
0 / 5 - 0 ratings