Hi,
I tried to get tvm to work on Windows 10. Following this doc,
- build
llvm 11.1.0
from source usingVisual Studio 2019 Community Edition
. - add llvm’s
bin
to Window’sPATH
. - build tvm from source, following instructions from this doc with modified configs as follows.
set(USE_CUDA ON)
set(USE_LLVM "C:/Users/vagrant/llvm-project/build/Release/bin/llvm-config.exe")
other configs are defaults as defined in cmake/config.cmake
. I verified, both llvm
and cuda-11.5
were detected correctly.
- add the build directory holding
tvm.dll
andtvm_runtime.dll
to Window’sPath
i.e.tvm\build\Release
. - set up Python package following this section. I tried both methods.
- relaunch Windows Powershell and execute
PS C:\Users\vagrant> python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tvm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\vagrant\tvm-0.9dev\python\tvm\__init__.py", line 26, in <module>
from ._ffi.base import TVMError, __version__, _RUNTIME_ONLY
File "C:\Users\vagrant\tvm-0.9dev\python\tvm\_ffi\__init__.py", line 28, in <module>
from .base import register_error
File "C:\Users\vagrant\tvm-0.9dev\python\tvm\_ffi\base.py", line 71, in <module>
_LIB, _LIB_NAME = _load_lib()
File "C:\Users\vagrant\tvm-0.9dev\python\tvm\_ffi\base.py", line 57, in _load_lib
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
File "C:\Python38\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\vagrant\tvm-0.9dev\build\Release\tvm.dll' (or one of its dependencies). Try using the full path with constructor syntax.
When import tvm
, it couldn’t find tvm.dll
for some reason, even though the file actually exists in the path.
I tried both tvm-0.9dev
(master branch) and tvm-0.8.0
, both gave the same error.
Thanks
Peeranat F.