Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 2.56 KB

windows_build.md

File metadata and controls

49 lines (35 loc) · 2.56 KB

Windows BLAS/OpenCL

  1. Install Microsoft Visual Studio. For VS2017 make sure the option "Desktop development with C++" is installed (you can add it later if not).

  2. Install git for windows - this can be used to get lc0 but is also needed for meson.

  3. Install a BLAS library. This can be either OpenBLAS or Intel MKL.

  • For OpenBLAS go here, you need a binary package with a filename of the form OpenBLAS-version-Win64-int32.zip, they are not available for all versions, which you just unpack at a location of your choise (but not inside the lc0 directory).
  • For Intel MKL go here, where you need to register. After installation don't forget to run mklvars.bat intel64 to set up the paths to the dlls.
  1. For OpenCL you also need to install OpenCL developer libraries.
  • For AMD cards the AMD APP SDK 3.0 seems to be the appropriate one, to be installed after the card drivers. This is not currently available on the AMD website, but links to a signed installer are available in the AMD community forum.
  • For nVIDIA cards you probably need the CUDA toolkit.
  1. Install Python3 - be sure to check the box to add python to the path.

  2. Install Meson: pip3 install --upgrade meson

  3. Edit build-cl.cmd:

  • If you use MSVS other than 2017 community edition (or if it's installed into non-standard location) replace the path to vcvarsall.bat and MSBuild.exe. If you can't find vcvarsall.bat on VS2017, you need to install option "Desktop development with C++". Some example paths are in comments.
  • In --backend 2017 replace 2017 with the correct MSVS version.
  • Set the BLAS (and optionally OpenCL) library include and lib directories in the appropriate variables.
    • For OpenBLAS, they are openblas_include and openblas_libdirs.
    • For Intel MKL, they are mkl_include and mkl_libdirs. The lib directory typically ends in \lib\intel64.
    • For OpenCL, they are opencl_libdirs and opencl_include. The include directory is the one with the CL directory containing opencl.h, not directly the one containing opencl.h.
  1. Run build-cl.cmd. It will generate MSVS project and pause.

  2. Hit Enter to build it.

  3. Resulting binary will be build/lc0.exe

Alternatively you can

  1. open generated solution build/lc0.sln in Visual Studio and build yourself.