-
Notifications
You must be signed in to change notification settings - Fork 348
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
Does not work on Apple Silicon #440
Comments
Any news? |
This should tell you all you need to know: I don't think this an issue with this library at all, apart from a shortage of documentation. You simply don't have the right |
@zzeee Btw, in the meantime, if you just want to experiment with the library, you should be able to run in Docker. |
I just wanted to have experiments 5 months ago :) Now I use Pytorch because I can not wait for such a long time :) |
I managed to install pytorch from pip and set LIBTORCH variable and DYLD_LIBRARY_PATH accordingly.
Note, I used miniconda, so your library path may differ. |
Closing in favor of #488 |
1.I have PyTorch 1.10 that works natively on my M1 Mac
I've downloaded libtorch from the website
2. I've added tch = "0.6.1" to cargo.toml
and when run cargo build I see:
note: ld: warning: ignoring file /Users/andrey/prj/nntest/target/debug/build/torch-sys-3c7217b1a617897c/out/libtorch/libtorch/lib/libtorch.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/andrey/prj/nntest/target/debug/build/torch-sys-3c7217b1a617897c/out/libtorch/libtorch/lib/libtorch_cpu.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/andrey/prj/nntest/target/debug/build/torch-sys-3c7217b1a617897c/out/libtorch/libtorch/lib/libc10.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"c10::impl::ExcludeDispatchKeyGuard::~ExcludeDispatchKeyGuard()", referenced from:
at::AutoDispatchBelowADInplaceOrView::~AutoDispatchBelowADInplaceOrView() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"c10::impl::ExcludeDispatchKeyGuard::ExcludeDispatchKeyGuard(c10::DispatchKeySet)", referenced from:
at::AutoDispatchBelowADInplaceOrView::AutoDispatchBelowADInplaceOrView() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"at::_ops::zeros::call(c10::ArrayRef, c10::optionalc10::ScalarType, c10::optionalc10::Layout, c10::optionalc10::Device, c10::optional)", referenced from:
at::zeros(c10::ArrayRef, c10::TensorOptions) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"vtable for torch::autograd::AutogradMeta", referenced from:
torch::autograd::AutogradMeta::AutogradMeta(c10::TensorImpl*, bool, torch::autograd::Edge) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"c10::AutogradMetaInterface::~AutogradMetaInterface()", referenced from:
torch::autograd::AutogradMeta::AutogradMeta(c10::TensorImpl*, bool, torch::autograd::Edge) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"caffe2::TypeMeta::typeMetaDatas()", referenced from:
caffe2::TypeMeta::data() const in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"c10::TensorImpl::set_autograd_meta(std::__1::unique_ptr<c10::AutogradMetaInterface, std::__1::default_deletec10::AutogradMetaInterface >)", referenced from:
torch::autograd::make_variable(at::Tensor, bool, bool) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"c10::UndefinedTensorImpl::_singleton", referenced from:
c10::UndefinedTensorImpl::singleton() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"c10::detail::torchInternalAssertFail(char const*, char const*, unsigned int, char const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
c10::Device::validate() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
caffe2::TypeMeta::fromScalarType(c10::ScalarType) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"at::ops::mul_Scalar::call(at::Tensor const&, c10::Scalar const&)", referenced from:
at::mul(at::Tensor const&, c10::Scalar const&) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"c10::detail::torchInternalAssertFail(char const*, char const*, unsigned int, char const*, char const*)", referenced from:
c10::intrusive_ptr<c10::VariableVersion::VersionCounter, c10::detail::intrusive_target_default_null_typec10::VariableVersion::VersionCounter >::intrusive_ptr(c10::VariableVersion::VersionCounter*) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
c10::intrusive_ptr_target::~intrusive_ptr_target() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
c10::intrusive_ptr<c10::TensorImpl, c10::UndefinedTensorImpl>::retain() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
c10::ArrayRef::debugCheckNullptrInvariant() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"vtable for c10::AutogradMetaInterface", referenced from:
c10::AutogradMetaInterface::AutogradMetaInterface() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"caffe2::TypeMeta::error_unsupported_typemeta(caffe2::TypeMeta)", referenced from:
caffe2::TypeMeta::toScalarType() in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)", referenced from:
torch::autograd::AutogradMeta::AutogradMeta(c10::TensorImpl*, bool, torch::autograd::Edge) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
c10::detail::torchInternalAssertFail(char const*, char const*, unsigned int, char const*, c10::detail::CompileTimeEmptyString) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
c10::TensorImpl::itemsize() const in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
c10::TensorImpl::data() const in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
"at::print(std::__1::basic_ostream<char, std::__1::char_traits >&, at::Tensor const&, long long)", referenced from:
at::operator<<(std::__1::basic_ostream<char, std::__1::char_traits >&, at::Tensor const&) in libtorch_sys-2bfcaab8f2fcc6a6.rlib(torch_api.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The text was updated successfully, but these errors were encountered: