Skip to content

Installation of PyTorch when build from source #168

@CalvinGe

Description

@CalvinGe

Dear developers,

I have some problems with building openMM-torch from source. After successfully installing openmmtorch in my conda environment following the ccmake steps, I found it did not also install pytorch in my current environment, so I installed it manually. The installation seems to be successful, but after it, importing openmmtorch will give the following error:

>>> import openmmtorch
terminate called after throwing an instance of 'c10::Error'
  what():  Tried to register multiple backend fallbacks for the same dispatch key Batched; previous registration registered at /pytorch/aten/src/ATen/core/VariableFallbackKernel.cpp:91, new registration registered at ./aten/src/ATen/BatchingRegistrations.cpp:1064
Exception raised from registerFallback at ./aten/src/ATen/core/dispatch/Dispatcher.cpp:277 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9e (0x7f10d6d7f9ae in /lib/x86_64-linux-gnu/libc10.so.1.13)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x74 (0x7f10d6d4c79e in /lib/x86_64-linux-gnu/libc10.so.1.13)
frame #2: c10::Dispatcher::registerFallback(c10::DispatchKey, c10::KernelFunction, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9b6 (0x7f10d095eaf6 in /lib/x86_64-linux-gnu/libtorch_cpu.so.1.13)
frame #3: torch::Library::_fallback(torch::CppFunction&&) & + 0x4bc (0x7f10d099e2cc in /lib/x86_64-linux-gnu/libtorch_cpu.so.1.13)
frame #4: <unknown function> + 0xd23075 (0x7f10d0723075 in /lib/x86_64-linux-gnu/libtorch_cpu.so.1.13)
frame #5: <unknown function> + 0xd29619 (0x7f10d0729619 in /lib/x86_64-linux-gnu/libtorch_cpu.so.1.13)
frame #6: <unknown function> + 0xcc77ab (0x7f10d06c77ab in /lib/x86_64-linux-gnu/libtorch_cpu.so.1.13)
frame #7: <unknown function> + 0x48be (0x7f12255498be in /lib64/ld-linux-x86-64.so.2)
frame #8: <unknown function> + 0x49a4 (0x7f12255499a4 in /lib64/ld-linux-x86-64.so.2)
frame #9: _dl_catch_exception + 0xd4 (0x7f12253af024 in /lib/x86_64-linux-gnu/libc.so.6)
frame #10: <unknown function> + 0xb09e (0x7f122555009e in /lib64/ld-linux-x86-64.so.2)
frame #11: _dl_catch_exception + 0x7a (0x7f12253aefca in /lib/x86_64-linux-gnu/libc.so.6)
frame #12: <unknown function> + 0xb438 (0x7f1225550438 in /lib64/ld-linux-x86-64.so.2)
frame #13: <unknown function> + 0x85438 (0x7f12252e5438 in /lib/x86_64-linux-gnu/libc.so.6)
frame #14: _dl_catch_exception + 0x7a (0x7f12253aefca in /lib/x86_64-linux-gnu/libc.so.6)
frame #15: _dl_catch_error + 0x2f (0x7f12253af07f in /lib/x86_64-linux-gnu/libc.so.6)
frame #16: <unknown function> + 0x84f27 (0x7f12252e4f27 in /lib/x86_64-linux-gnu/libc.so.6)
frame #17: dlopen + 0x69 (0x7f12252e54e9 in /lib/x86_64-linux-gnu/libc.so.6)
<omitting python frames>
frame #44: <unknown function> + 0x2724a (0x7f122528724a in /lib/x86_64-linux-gnu/libc.so.6)
frame #45: __libc_start_main + 0x85 (0x7f1225287305 in /lib/x86_64-linux-gnu/libc.so.6)

I suppose this is because openmmtorch is dependent on the libtorch libraries, thus installing another pytorch will have influences. But how can I get pytorch appropriately in my conda environment, if I want to build from the source?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions