Skip to content

Latest commit

 

History

History
259 lines (202 loc) · 13.1 KB

windows_support.md

File metadata and controls

259 lines (202 loc) · 13.1 KB

Windows Support

TheRock aims to support as many subprojects as possible on "native" Windows (as opposed to WSL 1 or WSL 2) using standard build tools like MSVC.

Warning

This is still under development. Not all subprojects build for Windows yet.

Supported subprojects

ROCm is composed of many subprojects, some of which are supported on Windows:

This table tracks current support status for each subproject in TheRock on Windows. Some subprojects may need extra patches to build within TheRock (on mainline, in open source, using MSVC, etc.).

Component subset Subproject Supported Notes
base aux-overlay
base rocm-cmake
base rocm-core No shared libraries
base rocm_smi_lib Unsupported
base rocprofiler-register Unsupported
base rocm-half
compiler amd-llvm No shared libraries, limited runtimes
compiler amd-comgr No shared libraries
compiler hipcc
compiler hipify Patched for Ninja
core ROCR-Runtime Unsupported
core rocminfo Unsupported
core clr Needs a folder with prebuilt static libraries
profiler rocprofiler-sdk
comm-libs rccl
math-libs rocRAND
math-libs hipRAND
math-libs rocPRIM
math-libs hipCUB
math-libs rocThrust
math-libs rocFFT No shared libraries
math-libs hipFFT No shared libraries
math-libs (blas) hipBLAS-common
math-libs (blas) hipBLASLt Under evaluation
math-libs (blas) rocBLAS In progress
math-libs (blas) rocSPARSE
math-libs (blas) hipSPARSE
math-libs (blas) rocSOLVER
math-libs (blas) hipSOLVER
math-libs (blas) hipBLAS
ml-libs MIOpen

Building from source

These instructions mostly mirror the instructions in the root README.md, with some extra Windows-specific callouts.

Prerequisites

Set up your system

Install tools

You will need:

Tip

Some of these tools are available via package managers like https://github.com/chocolatey/choco

choco install git
choco install cmake
choco install ninja
choco install ccache
choco install sccache
choco install python

Clone and fetch sources

git clone https://github.com/ROCm/TheRock.git
python ./build_tools/fetch_sources.py

Configure

Some components do not build for Windows yet, so disable them:

cmake -B build -GNinja . \
  -DTHEROCK_AMDGPU_FAMILIES=gfx110X-dgpu \
  -DTHEROCK_ENABLE_COMPILER=ON \
  -DTHEROCK_ENABLE_HIPIFY=ON \
  -DTHEROCK_ENABLE_CORE=OFF \
  -DTHEROCK_ENABLE_CORE_RUNTIME=OFF \
  -DTHEROCK_ENABLE_HIP_RUNTIME=OFF \
  -DTHEROCK_ENABLE_PROFILER_SDK=OFF \
  -DTHEROCK_ENABLE_COMM_LIBS=OFF \
  -DTHEROCK_ENABLE_MATH_LIBS=OFF \
  -DTHEROCK_ENABLE_RAND=OFF \
  -DTHEROCK_ENABLE_PRIM=OFF \
  -DTHEROCK_ENABLE_FFT=OFF \
  -DTHEROCK_ENABLE_BLAS=OFF \
  -DTHEROCK_ENABLE_SPARSE=OFF \
  -DTHEROCK_ENABLE_SOLVER=OFF \
  -DTHEROCK_ENABLE_ML_LIBS=OFF

# If iterating and wishing to cache, add these:
#  -DCMAKE_C_COMPILER_LAUNCHER=ccache \
#  -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
#  -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded \

Tip

ccache does not support MSVC's /Zi flag which may be set by default when a project (e.g. LLVM) opts in to policy CMP0141. Setting -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded instructs CMake to compile with /Z7 or equivalent, which is supported by ccache.

Ensure that MSVC is used by looking for lines like these in the logs:

-- The C compiler identification is MSVC 19.42.34436.0
-- The CXX compiler identification is MSVC 19.42.34436.0

Build

cmake --build build

At the moment this should build some projects in base/ as well as compiler/.

Building CLR from partial sources

We are actively working on enabling source builds of https://github.com/ROCm/clr (notably for amdhip64_6.dll) on Windows. Historically this has been a closed source component due to the dependency on Platform Abstraction Library (PAL) and providing a fully open source build will take more time. As an incremental step towards a fully open source build, we will use a compute-win folder containing header files and static library .lib files for PAL and related components.

An incremental rollout is planned:

  1. (We are here today) The compute-win folder must be manually copied into place at core/compute-win. This will allow AMD developers to iterate on integration into TheRock while we work on making this folder or more source files available.
  2. The compute-win folder will be available publicly and will be included automatically from either a git repository or cloud storage (like the existing third party dep mirrors in third-party/).
  3. A more permanent open source strategy for building the CLR (the HIP runtime) from source on Windows will eventually be available.

With the compute-win folder available, build by configuring CMake with these options set:

-DTHEROCK_ENABLE_CORE=ON \
-DTHEROCK_ENABLE_HIP_RUNTIME=ON \

then look for build/core/clr/dist/bin/amdhip64_6.dll and related outputs.

With the HIP runtime building, these flags can also now be enabled:

-DTHEROCK_ENABLE_RAND=ON \
-DTHEROCK_ENABLE_PRIM=ON \
-DTHEROCK_ENABLE_FFT=ON \

Testing

Test builds can be enabled with -DBUILD_TESTING=ON.

Some subproject tests have been validated on Windows, like rocPRIM:

ctest --test-dir build/math-libs/rocPRIM/dist/bin/rocprim --output-on-failure