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

UnsatisfiedLinkError: 'boolean ai.djl.pytorch.jni.PyTorchLibrary.torchIsContiguous(long)' #3194

Closed
david-sitsky opened this issue May 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@david-sitsky
Copy link
Contributor

Description

I am using:

ai.djl.pytorch:pytorch-engine:0.28.0-SNAPSHOT
ai.djl.pytorch:pytorch-jni:2.2.2-0.28.0-SNAPSHOT
ai.djl.pytorch:pytorch-native-cpu:2.2.2:linux-x86_64

My program has started to just fail given an update from snapshot. This seems related to this PR: #3137 which has added a method to PyTorchLibrary.torchIsContiguous() which was merged recently.

java.lang.UnsatisfiedLinkError: 'boolean ai.djl.pytorch.jni.PyTorchLibrary.torchIsContiguous(long)'
        at ai.djl.pytorch.jni.PyTorchLibrary.torchIsContiguous(Native Method) ~[pytorch-engine-0.28.0-SNAPSHOT.jar:?]
        at ai.djl.pytorch.jni.JniUtils.getByteBuffer(JniUtils.java:1682) ~[pytorch-engine-0.28.0-SNAPSHOT.jar:?]
        at ai.djl.pytorch.engine.PtNDArray.toByteBuffer(PtNDArray.java:233) ~[pytorch-engine-0.28.0-SNAPSHOT.jar:?]
        at ai.djl.ndarray.NDArray.toFloatArray(NDArray.java:277) ~[api-0.28.0-SNAPSHOT.jar:?]
...
        at ai.djl.inference.Predictor.batchPredict(Predictor.java:190) ~[api-0.28.0-SNAPSHOT.jar:?]
        at ai.djl.inference.Predictor.predict(Predictor.java:132) ~[api-0.28.0-SNAPSHOT.jar:?]

I suspect this is related to what GitHub actions have run and perhaps what is still pending? I thought I'd report it just in case.

Is there a way to order the actions to prevent this from happening in the future?

@david-sitsky david-sitsky added the bug Something isn't working label May 15, 2024
@frankfliu
Copy link
Contributor

frankfliu commented May 15, 2024

There are some jni code change recently. Please remove cache and refresh the dependencies. This inconsistence only affect -SNAPSHOT build.

@david-sitsky
Copy link
Contributor Author

My apologies.. I had an errand PYTORCH_LIBRARY_PATH setting in place pointing to an older version. Once that was removed all looked fine again.

I read 0.28.0 is planned to be released sometime in May? Is that looking likely? I'll hoping to move off snapshots soon.. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants