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 | ⭕ | Patched to no-op |
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 | ❔ | Under review (partly closed source) |
profiler | rocprofiler-sdk | ❔ | |
comm-libs | rccl | ❔ | |
math-libs | rocRAND | ❔ | Almost ready. Needs workaround for hip-clr dep |
math-libs | hipRAND | ❔ | Almost ready. Needs workaround for hip-clr dep |
math-libs | rocPRIM | ❔ | |
math-libs | hipCUB | ❔ | |
math-libs | rocThrust | ❔ | |
math-libs | rocFFT | ❔ | |
math-libs | hipFFT | ❔ | |
math-libs (blas) | hipBLAS-common | ❔ | |
math-libs (blas) | hipBLASlt | ❔ | |
math-libs (blas) | rocBLAS | ❔ | |
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/
.