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

Use of Linux extension "so" on MacOs instead of "dylib" when loading PyTorch #428

Open
mjschnie opened this issue Oct 1, 2024 · 1 comment

Comments

@mjschnie
Copy link

mjschnie commented Oct 1, 2024

I'm getting a strange error on my MacOS M2 laptop trying to import the PyTorch library from Python code running on a JVM (GraalPy 3.11.7 Oracle GraalVM Native 24.1.0 on openjdk 23 2024-09-17)::
org.graalvm.polyglot.PolyglotException: OSError: dlopen( ... ffx_venv/lib/python3.11/site-packages/torch/lib/libtorch_global_deps.so, 0x000A): tried: ... (no such file)
The library is in the virtual environment (after using GraalPy pip to install torch), but on MacOS the extension is "dylib" instead of "so". The correct file is available here: ffx_venv/lib/python3.11/site-packages/torch/lib/libtorch_global_deps.dylib
Any ideas why the Linux ".so" extension is being used instead of ".dylib"?

@msimacek
Copy link
Contributor

msimacek commented Oct 2, 2024

Hi, please try setting python.PosixModuleBackend option to native. If that doesn't help - what torch version is that? Did you use the maven plugin? Does torch work when ran outside JVM with the standalone launcher? Can you post the Java code that is setting up the context?

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