Skip to content

Latest commit

 

History

History
90 lines (75 loc) · 3.71 KB

README.md

File metadata and controls

90 lines (75 loc) · 3.71 KB

Self-contained Torch installation for windows

Prerequisites

Must have

If use CUDA

Optional

  • MKL, better performance blas/lapack library
  • Gnuplot, required by gnuplot package for plotting
  • GraphicsMagick, optional for image package

Install

Open "Windows Command Prompt" and run:

install.bat

By default x64 Torch will be installed under install\ with LuaJIT 2.1 and openlblas from conda environment 'torch-vcversion'. Run install.bat in a specific "VS* * Tools Command Prompt" to compile for a different target. Please choose x64 conda for x64 Torch and x86 conda for x86 Torch. X86 Torch does not contain cuda packages and has 2G memory limitation. There are a few customizable environment variables listed on top of install-deps.bat. There is no need to run install-deps.bat before run install.bat, it sets variables in global and it will be called directly by install.bat. Do not use lua instead of luajit because currently lua version Torch will use luaffifb for ffi which has bugs on windows and has poor performance.

It is easy to intall multiple Torch by customizing TORCH_INSTALL_DIR, TORCH_LUA_VERSION, and by making sure clean.bat is run before running install.bat.

Use

In order to use Torch in a Self-contained way, a few helper cmd will be installed under the installation directory:

  • torch-activate.cmd: setup Torch environment including TORCH_INSTALL_DIR, TORCH_CONDA_ENV, TORCH_VS_VERSION, TORCH_VS_PLATFORM, PATH, LUA_PATH, LUA_CPATH, CUDNN_PATH,
  • luajit.cmd: a wrapper of luajit.exe with Torch environment
  • luarocks.cmd: a wrapper of luarocks.bat with Torch environment
  • cmake.cmd: a wrapper of cmake.exe which helps package installation with MSVC

Use luajit.cmd and luarocks.cmd directly

path_to_Torch\luajit -ltorch -e "torch.test()"

The installation will remember which MSVC to use for what platform, so luarocks install can be run in a general "Windows Command Prompt".

path_to_Torch\luarocks install rnn

It will automatically install not installed dependencies.

Run torch-activate.cmd, then use availabe Torch executables

path_to_Torch\torch-activate
th
qlua

Trepl on windows should work similarly as on linux or macos. qlua should be used to run qt related lua codes.

Clean or Uninstall

To remove all the temporary compilation files:

clean.bat

To remove the installation:

path_to_Torch\torch-activate
uninstall.bat

torch-activate.cmd is called before uninstall.bat so that uninstall knows which Torch7 to uninstall. In addition to clean.bat, this will remove the directory pointed to by TORCH_INSTALL_DIR and TORCH_CONDA_ENV from conda.

Test

You can test that all libraries are installed properly by running:

path_to_Torch\torch-activate
test.bat

torch-activate.cmd is called before test.bat so that test knows which Torch7 to test.

Tested x64 Torch7 on Windows 10 x64, Visual Studio Community 2015, Anaconda4, Cuda Toolkit8.0, MKL2017