yuzawa-san / onnxruntime-java

A type-safe, lightweight, modern, and performant binding Java binding of Microsoft's ONNX Runtime
MIT License
18 stars 0 forks source link

Call type not supported on this platform #156

Open Solido opened 12 months ago

Solido commented 12 months ago

Hi!

Very interested in giving the lib a round as I got some models on the side.

I wasnt't able to put a diagnostic.

Thanks!

Describe the bug Caused by: java.lang.UnsupportedOperationException: Call type not supported on this platform

To Reproduce Steps to reproduce the behavior: Gradle Tasks -> Application -> Run

Desktop (please complete the following information):

Additional context

dependencies:
        implementation project(":onnxruntime-sample-library")
    runtimeOnly project(path: ":", configuration: 'cpu')
    runtimeOnly "com.jyuzawa:onnxruntime-cpu:1.+:osx-aarch_64"
yuzawa-san commented 12 months ago

Thank you for your interest in this project.

Sadly you have encountered one of the limitations of an experimental framework. There was a known issue with Java 19's preview API with M1 macs. It was patched in https://github.com/openjdk/panama-foreign/pull/746/files#diff-842e1f602edc157c7897665ff0678fbb6f2589d2511088bab690cb9ca6044ba4L203 However this library is pinned to Java 19 (optimistically hoping that the underlying API would be out of preview in Java 20). Unfortunately, it did not get out of preview in Java 21, so I am tentatively targeting Java 22 (which they have claimed it will finally be out of preview). I am currently upgrading to that, but jextract, gradle, and IDE's are not quite ready for 22, so its been slow. Ideally in the next few months things should improve. I'll update this ticket once that is achieved.

Solido commented 12 months ago

Thank you James, your detailed explanation can bring me back on track. I'm gonna move to another hardware so I can progress with your work. Best regards. Robert.

yuzawa-san commented 9 months ago

I have a test branch (once again very experimental) for java 22 which builds on environments with jdk 21 (to bootstrap gradle) and 22-ea (to allow gradle to use as a build/runtime toolchain.

I do not see much movement on this until at least gradle is upgraded and 22 is fully released in a few months.

yuzawa-san commented 5 months ago

I have merged and upgraded the project (and runtime minimum version) to JDK22. Please consult the readme for the most recent snapshots. I think microsoft may be dropping a new release in the coming days/weeks so i'll probably wait for ORT 1.18.0 before cutting a full release.