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
library libshm.dylib is missing #78938
Comments
Collecting environment information... OS: macOS 11.5.1 (x86_64) Python version: 3.9.13 (main, May 24 2022, 21:28:44) [Clang 13.0.0 (clang-1300.0.29.30)] (64-bit runtime) Versions of relevant libraries: |
Hi, |
pip show -f torch | grep dylib |
All seem to be in order here. |
Can you please run |
I have a similar issue with conda create -n vision python=3.9
conda activate vision
pip install --upgrade --pre torch --extra-index-url=https://download.pytorch.org/whl/nightly
pip list | grep torch
> torch 1.13.0.dev20220608
python -c "import torch"
>
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/user/opt/miniconda3/envs/vision/lib/python3.9/site-packages/torch/__init__.py", line 202, in <module>
from torch._C import * # noqa: F403
ImportError: dlopen(/Users/user/opt/miniconda3/envs/vision/lib/python3.9/site-packages/torch/_C.cpython-39-darwin.so, 2): Library not loaded: @loader_path/../.dylibs/libomp.dylib
Referenced from: /Users/user/opt/miniconda3/envs/vision/lib/python3.9/site-packages/torch/lib/libtorch_cpu.dylib
Reason: no suitable image found. Did find:
/Users/user/opt/miniconda3/envs/vision/lib/python3.9/site-packages/torch/lib/../.dylibs/libomp.dylib: cannot load 'libomp.dylib' (load command 0x80000034 is unknown)
/Users/user/opt/miniconda3/envs/vision/lib/python3.9/site-packages/torch/lib/../.dylibs/libomp.dylib: cannot load 'libomp.dylib' (load command 0x80000034 is unknown)
output
pip show -f torch | grep dylib
>
torch/.dylibs/libomp.dylib
torch/lib/libc10.dylib
torch/lib/libshm.dylib
torch/lib/libtorch.dylib
torch/lib/libtorch_cpu.dylib
torch/lib/libtorch_global_deps.dylib
torch/lib/libtorch_python.dylib
ls -all /Users/user/opt/miniconda3/envs/vision/lib/python3.9/site-packages/torch/.dylibs/
>
total 1376
drwxr-xr-x 3 user staff 96 Jun 9 10:50 .
drwxr-xr-x 84 user staff 2688 Jun 9 10:50 ..
-rw-r--r-- 1 user staff 702928 Jun 9 10:50 libomp.dylib Installing older nightly version works on this (rather old) OSX version: pip install --upgrade --pre "torch==1.12.0.dev20220520" --extra-index-url=https://download.pytorch.org/whl/nightly |
Sounds like _C.cpython-39-darwin.so is in torch directory and looking for libshm in same directory. I've only been using libtorch on Mac so not entirely familiar with why this lib is there or why it needs libshm. Does symlinking libshm from torch/lib/ to torch/ help? What does otool -L say for that library? As for the old MacOS issues, maybe a dependency on something newer crept in with all the MPS changes? |
i had the same prob installing stable diffusion, not requiring cuda. the problem turned out to be that that libshm isnt bundled into virtual env installs or isnt linked to local env. however it was in my system install which is the one that showed up for |
Closing this as the information here most likely is stale after a year. |
i have basically the same problem but the library libshm.dylib is missing.
all answers i found to fix that say to install libomp, which i reinstalled but it didnt fix the issue, though for others that seemed to work in previous years.
i cant find the library libshm in any lib folders on my machine. Im wondering if its included somewhere in libomp and how to point pytorch to it, or if it can be downloaded from somewhere else?
i have the current torch version installed 1.11.0 with Python 3.9 on Mac Big Sur.
Found the libshm library required for sharedmemory alloc on linux machines.
Does PyTorch require a bugfix to include this dylib? Or is there any other workaround? @malfet
Originally posted by @jskye in #36941 (comment)
cc @ezyang @gchanan @zou3519 @seemethere @malfet @albanD
The text was updated successfully, but these errors were encountered: