How to install tvm on Windows?

Hello!

I’m trying to install tvm stack on Windows10 computer with Anaconda3 installed. But further steps to install LLVM are not clear.

I have made all steps from the “Building on Windows” on [https://docs.tvm.ai/install/from_source.html]. Namely:

  1. Installed Visual Studio Community 2015 Update 3.
  2. Cloned the tvm source from github in c:\Anaconda3 to my computer.
  3. Have made the “c:\Anaconda3\tvm\build” directory, copied “config.cmake”, launched “cmake -G” Visual Studio 14 2015 Win64 “-DCMAKE_BUILD_TYPE = Release -DCMAKE_CONFIGURATION_TYPES =” Release “…”
    4 I launched a file with the extension “.sln” under Visual Studio, after which the necessary dll files appeared in the directory “C:\Anaconda3\tvm\build\Release”.

I do not understand the sequence to connect llvm. The phrase in the documentation “In order to build with LLVM in windows, you will need to build LLVM from source. You need to run build the nnvm by running the same script under the nnvm folder” don’t contain anything about it for me. And it seems to contain an error, because nnvm is mentioned instead of llvm.

I would be immensely grateful if you explain in more detail the tvm compilation process with llvm support for Windows.

Thanks for attention.

On Windows, you need to build LLVM from source, and during cmake config of TVM, set USE_TVM=On and LLVM_DIR to your LLVM installation.

I’ve build LLVM from source (as it discribed in http://llvm.org/docs/CMake.html), made “set(USE_LLVM ON)” in “config.cmake” file (writing LLVM_DIR doesn’t work for me). And successfully have made tvm.sln with llvm support:

– Found TVM_LLVM_VERSION=60
– Build with LLVM 6.0.1
– Set TVM_LLVM_VERSION=60
– Configuring done
– Generating done

But Visual Studio after building tvm.sln gave me this error:

Error LNK1112 module machine type ‘X86’ conflicts with target machine type ‘x64’ tvm C:\Anaconda3\tvm\build\LLVMSupport.lib(MemoryBuffer.obj)

Could you say what went wrong?

It seems you have built a 32-bit version of LLVM and trying to link it with a 64-bit version of TVM. You should make them consistent.

LLVM was build from source and enabled in the cmake file.
But after trying to build the INSTALL below mentioned errors pop up.
Can you say what went wrong

Don’t forget to git submodule init and git submodule update.

Thanks for the reply…
After doing the git submodule init and git submodule update . Those errors were resolved but later when i give LLVM_DIR path .Leads to some 9k errors in release mode.Below is the snip of the errors.
Any suggestion on this.

This is an error conflict between Debug and Release builds. Make sure you build both in either debug or release mode. Preferably release mode!

I am trying to build microTVM on Windows. I have set below flags in build: cmake -A x64 -Thost=x64 … -DUSE_CMSISNN=ON -DUSE_MICRO=ON -DUSE_LLVM=“path/to/llvm-config” Note: LLVM is already built on windows. After this the build is successfull (cmake --build build --config Release – /m) Next I opened the solution ‘tvm.sln’ and build the libraries tvm.dll and tvm_runtime.dll successfully. But when I try to execute the microTVM apllication, I get below error: ModuleNotFoundError: No module named ‘fcntl’ The module fcntl is available only in ubuntu. Can you please let me know how to proceed in Windows. MicroTVM example I am trying to execute: microTVM Host-Driven AoT — tvm 0.10.0 documentation