0

I've tried to build libtorch on Windows 10 using VS 2019 without CUDA and Python. Independent if I compile it with or without MKL, a simple test program crashes directly after start. After building the debug version, libtorch throws a c10:error in a function called torchCheckFail.

The function seems to complain about ATen/core/jit_type.h.

The problem is part of torch_cpu.dll. The problem disappears when I'm using the precompiled binaries for Windows.

Here's the function:

void torchCheckFail(
    const char* func,
    const char* file,
    uint32_t line,
    const std::string& msg) {
  throw ::c10::Error({func, file, line}, msg);
}

And here's the call stack:

Call Stack

Bastian
  • 1,553
  • 13
  • 33

2 Answers2

1

I encountered the same exact error with the same environment.

A solution that worked for me was to take a release version of pytorch and not a non-release one (i.e. a release version + some commits).

Hope it helps.

R_B
  • 11
  • 2
1

I have provided a similar answer here. Please take a look at it for more information.

TL/DR: try to use cmake + Ninja + x64 Native Tools Command Prompt for VS 2019 to build libtoch on windows 10, which maybe helps. The idea comes from this issue.

lollows
  • 71
  • 1
  • 2
  • 5