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

com.microsoft.onnxruntime:onnxruntime-extensions:0.11.0: missing RegisterCustomOps in onnxruntime_extensions4j_jni.dll #764

Open
david-sitsky opened this issue Jul 15, 2024 · 3 comments

Comments

@david-sitsky
Copy link

I am using OnnxRuntime extensions 0.11.0 in Java via DJL, and while this all works fine on Linux, the same code on Windows fails during initialisation on the OrtSession.SessionOptions.registerCustomOpLibrary() call:

Caused by: ai.onnxruntime.OrtException: Error code - ORT_FAIL - message: Failed to find symbol RegisterCustomOps in library, error code: 127 ""
	at ai.onnxruntime.OrtSession$SessionOptions.registerCustomOpLibrary(Native Method) ~[onnxruntime-1.17.3.jar:1.17.3]
	at ai.onnxruntime.OrtSession$SessionOptions.registerCustomOpLibrary(OrtSession.java:868) ~[onnxruntime-1.17.3.jar:1.17.3]

I have noticed the size of the embedded native libraries within com.microsoft.onnxruntime:onnxruntime-extensions:0.11.0 seems vastly different between Windows and Linux:

$ ls -lh
total 193M
-rw-rw-r-- 1 sits sits 8.8M May 24 23:32 libonnxruntime_extensions4j_jni.dylib
-rw-rw-r-- 1 sits sits 176M May 24 23:33 libonnxruntime_extensions4j_jni.so
-rw-rw-r-- 1 sits sits 8.1M May 24 23:33 onnxruntime_extensions4j_jni.dll

The Linux shared object file is almost 10x the size of the Windows (and macOS) libraries. Is something missing leading to this issue?
I can see the .so file does have the symbol mentioned:

$ nm -gD libonnxruntime_extensions4j_jni.so | grep RegisterCustomOps
0000000000152bc0 T RegisterCustomOps

I opened the .dll with Ghidra and RegisterCustomOps seems to be missing.

Is there a build problem here, or have I missed something?

@david-sitsky
Copy link
Author

As a point of comparison, from https://globalcdn.nuget.org/packages/microsoft.ml.onnxruntime.extensions.0.10.0.nupkg package, the linux-x86 .so file is only 5.1MB and the win-x64 ortextensions.dll file is 6.9MB.

So surely libonnxruntime_extensions4j_jni.so being 176MB for Linux is packaging up too much?

Anybody have any ideas what is going on here? I am hoping to use extensions in my project for both Windows and Linux, but this is currently a blocker.

@david-sitsky
Copy link
Author

I can also see ortextensions.dll from the nupkg file does indeed export RegisterCustomOps, but onnxruntime_extensions4j_jni.dll does not.

@wenbingl
Copy link
Member

@sayanshaw24 , can you follow up with these issues that @david-sitsky mentioned here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants