You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently got an M1 Mac. In trying to get this plugin working on it, I encountered some very rough edges. We should figure out how to resolve them, or else they'll cause a lot of problems for users.
The first roadblock I ran into was a linker error trying to build the plugin: it couldn't find the library libopenblas.dylib (which is required by PyTorch), even though I have the libopenblas conda package installed. With some searching I found this issue which partly explains the problem: the actual library is called libopenblas.0.dylib. The solution suggested there is to create a symlink to it with the other name. That works, but we can't really ask users to do that.
I haven't been able to figure out where it's getting the incorrect name from. It doesn't appear anywhere in the CMake files either for this library or for PyTorch. Running otool -L on the PyTorch libraries shows that all of them refer to it by the correct name. But somehow CMake is getting the incorrect name and putting it in the makefiles it generates.
The second problem I encountered was that it couldn't find libtorch.dylib at runtime, and therefore couldn't load the plugin. This was a library path issue. Most libraries for conda packages are put in the lib directory for the environment, which is automatically added to the library path. But PyTorch instead puts its libraries in site-packages/torch/lib, which is not added automatically. I was able to work around it by setting DYLD_LIBRARY_PATH in the terminal, but that isn't a convenient solution for users.
The text was updated successfully, but these errors were encountered:
The library path issue is fixed by #72. I understand the cause of the libopenblas naming problem better now, but it isn't clear what the right solution is. See conda-forge/openblas-feedstock#134.
I recently got an M1 Mac. In trying to get this plugin working on it, I encountered some very rough edges. We should figure out how to resolve them, or else they'll cause a lot of problems for users.
The first roadblock I ran into was a linker error trying to build the plugin: it couldn't find the library libopenblas.dylib (which is required by PyTorch), even though I have the libopenblas conda package installed. With some searching I found this issue which partly explains the problem: the actual library is called libopenblas.0.dylib. The solution suggested there is to create a symlink to it with the other name. That works, but we can't really ask users to do that.
I haven't been able to figure out where it's getting the incorrect name from. It doesn't appear anywhere in the CMake files either for this library or for PyTorch. Running
otool -L
on the PyTorch libraries shows that all of them refer to it by the correct name. But somehow CMake is getting the incorrect name and putting it in the makefiles it generates.The second problem I encountered was that it couldn't find libtorch.dylib at runtime, and therefore couldn't load the plugin. This was a library path issue. Most libraries for conda packages are put in the
lib
directory for the environment, which is automatically added to the library path. But PyTorch instead puts its libraries insite-packages/torch/lib
, which is not added automatically. I was able to work around it by settingDYLD_LIBRARY_PATH
in the terminal, but that isn't a convenient solution for users.The text was updated successfully, but these errors were encountered: