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.
ROCm is composed of many subprojects, some of which are supported on Windows:
- https://rocm.docs.amd.com/en/latest/what-is-rocm.html
- https://rocm.docs.amd.com/projects/install-on-windows/en/latest/reference/component-support.html
- https://rocm.docs.amd.com/projects/install-on-windows/en/latest/conceptual/release-versioning.html#windows-builds-from-source
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 | ❔ |
These instructions mostly mirror the instructions in the root README.md, with some extra Windows-specific callouts.
-
Choose your shell between cmd, powershell, and git bash as well as your terminal application. Some developers report good experiences with Windows Terminal and Cmder.
-
A Dev Drive is recommended, due to how many source and build files are used. See the Set up a Dev Drive on Windows 11 article for setup instructions.
-
Symlink support is recommended.
Test if symlinks work from cmd:
echo "Test 1 2 3" > test.txt mklink link_from_cmd.txt test.txt
Test if symlinks work from Powershell:
echo "Test 1 2 3" > test.txt New-Item -Path link_from_powershell.txt -ItemType SymbolicLink -Value test.txt
If symlink support is not enabled, enable developer mode and/or grant your account the "Create symbolic links" permission. These resources may help:
You will need:
-
Git: https://git-scm.com/downloads
- Suggested: enable symlinks with
git config --global core.symlinks true
- Suggested: enable symlinks with
-
CMake: https://cmake.org/download/
-
Ninja: https://ninja-build.org/
-
(Optional) ccache: https://ccache.dev/, or sccache: https://github.com/mozilla/sccache
-
Python: https://www.python.org/downloads/ (3.11+ recommended)
-
The MSVC compiler from https://visualstudio.microsoft.com/downloads/ (typically from either Visual Studio or the Build Tools for Visual Studio), including these components:
- MSVC
- C++ CMake tools for Windows
- C++ ATL
- C++ AddressSanitizer (optional)
After installing MSVC, use it in your build environment. If you build from an editor like VSCode, CMake can discover the compiler among other "kits". If you use the command line, see https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170. (typically run the appropriate
vcvarsall.bat
)
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
git clone https://github.com/ROCm/TheRock.git
python ./build_tools/fetch_sources.py
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
cmake --build build
At the moment this should build some projects in base/
as well
as compiler/
.
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:
- (We are here today) The
compute-win
folder must be manually copied into place atcore/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. - 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 inthird-party/
). - 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 \
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