Skip to content

Compile instructions for Windows

Johannes Czech edited this page Jan 8, 2020 · 9 revisions
  1. Clone the CrazyAra repository:
git clone https://github.com/QueensGambit/CrazyAra-Engine.git --recursive
  1. Build the MXNet C++ package

Install all premilaries and depending on your preference follow the CUDA or MKL guide.

Make sure to install Visual Studio together with the VC++ toolset and enable Visual Studio support when installing CUDA.

Clone the MXNet library:

git clone https://github.com/apache/incubator-mxnet --recursive

Make sure that msbuild.exe is found from the command line:

  • Windows->Edit System Environment Variables: Path
  • add C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin

Configure the library with the options you need (e.g. CUDA, CUDNN). Building with OpenCV is not required:

mkdir build
cd build

CUDA/cuDNN backend

cmake -G "Visual Studio 15 2017 Win64" -T cuda=10.1,host=x64^
 -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=1 -DUSE_CUDNN=1 -DUSE_CPP_PACKAGE=1^
 -DUSE_NVRTC=1 -DUSE_OPENCV=0 -DUSE_OPENMP=1 -DUSE_BLAS=open -DUSE_LAPACK=1^
 -DUSE_DIST_KVSTORE=0 -DCUDA_ARCH_LIST=Common -DCUDA_TOOLSET=10.1^
 -DCUDNN_INCLUDE="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include"^
 -DCUDNN_LIBRARY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib\x64\cudnn.lib" ..

MKL-Backend

cmake -G "Visual Studio 15 Win64" -DUSE_CUDA=0 -DUSE_CUDNN=0 -DUSE_NVRTC=0^
 -DUSE_CPP_PACKAGE=1 -DUSE_OPENCV=0 -DUSE_OPENMP=1 -DUSE_PROFILER=1^
 -DUSE_BLAS=mkl -DUSE_LAPACK=1 -DUSE_DIST_KVSTORE=0 -DCUDA_ARCH_NAME=All^
 -DUSE_MKLDNN=1 -DCMAKE_BUILD_TYPE=Release^
 -DMKL_ROOT="C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl" ..

Start the building process:

msbuild mxnet.sln /p:Configuration=Release;Platform=x64 /maxcpucount

Generate the "op.h" file:

python OpWrapperGenerator.py "\your\build\Release\libmxnet.dll"

If this doesn't work on your system due to encoding errors, you can try downloading the file instead:

  1. Build the CrazyAra binary
set MXNET_PATH=<path_to_mxnet>/incubator-mxnet/
set BLAZE_PATH=<path_to_blaze>/Blaze_3.6/
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" ..
msbuild CrazyAra.sln /p:Configuration=Release;Platform=x64 /maxcpucount
Clone this wiki locally