Skip to content
Branch: master
Find file Copy path
117 lines (91 sloc) 4.77 KB

Compile xmr-stak for Windows

Install Dependencies


  • Open a command line (Windows key + r) and enter cmd
  • Execute mkdir C:\xmr-stak-dep

Visual Studio Community 2017

  • Download and install Visual Studio Community 2017
  • During install choose following components:
    • Desktop development with C++ (left side)
    • VC++ 2015.3 v140 toolset for desktop (right side - NOT needed for CUDA 9 or AMD GPU)
    • Since release of VS2017 15.5 (12/04/17), require VC++ 2017 version 15.4 v14.11 toolset (under tab Individual Components, section Compilers, build tools, and runtimes), as CUDA 9.x is not compatible with compiler 14.12.X

CMake for Win64

Cuda 8.0+ (only needed for NVIDIA GPUs)

  • Download and install
  • For minimal install choose Custom installation options during the install and select
    • CUDA/Development
    • CUDA/Visual Studio Integration (ignore the warning during the install that VS2017 is not supported)
    • CUDA/Runtime
    • Driver components

AMD DRIVER/OCL-SDK (only needed for AMD GPUs)

Do not follow old information that you need the AMD APP SDK. AMD has removed the APP SDK and is now shipping the OCL-SDK_light.

Dependencies OpenSSL/Hwloc and Microhttpd

Validate the Dependency Folder

  • Open a command line (Windows key + r) and enter cmd
  • Execute
    cd c:\xmr-stak-dep
    tree .
  • You should see something like this:
      C:\xmr-stak-dep>tree .
      Folder PATH listing for volume Windows
      Volume serial number is XX02-XXXX
      │   ├───include
      │   │   ├───hwloc
      │   │   │   └───autogen
      │   │   └───private
      │   │       └───autogen
      │   └───lib
      │   ├───include
      │   └───lib
          │   └───openssl


  • Download xmr-stak Source and save to a location in your home folder (C:\Users\USERNAME)
  • Extract Source (e.g. to C:\Users\USERNAME\xmr-stak-<version>)
  • Open a command line (Windows key + r) and enter cmd
  • Go to extracted source code directory (e.g. cd C:\Users\USERNAME\xmr-stak-<version>)
  • Execute the following commands (NOTE: path to Visual Studio Community 2017 can be different)
    # Execute next line only if compiling for Cuda 9.x and using Visual Studio 2017 >= 15.5 (released 12/04/17)
    "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
    "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
  • Sometimes Windows will change the directory to C:\Users\USERNAME\source\ instead of C:\Users\USERNAME\xmr-stak-<version>\. If that's the case execute cd C:\Users\USERNAME\xmr-stak-<version> followed by:
    mkdir build
    cd build
    set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl


  • See build options to enable or disable dependencies.
  • For CUDA 8* execute: cmake -G "Visual Studio 15 2017 Win64" -T v140,host=x64 ..
  • For CUDA 9* and/or AMD GPUs, CPU execute: cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 ..
  • Then execute
    cmake --build . --config Release --target install
    cd bin\Release
    copy C:\xmr-stak-dep\openssl\bin\* .
  • Miner is by default compiled for NVIDIA GPUs (if CUDA is installed), AMD GPUs (if the AMD OCL-SDK_light is installed) and CPUs.
You can’t perform that action at this time.