Skip to content

Commit 9f4b3c6

Browse files
author
Abraham Sewill
committed
readme: add native Windows SYCL build section (adventurous path)
1 parent feca367 commit 9f4b3c6

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,87 @@ PowerShell users: use `$env:CUDA_ARCHITECTURES = "89"` instead of
393393
also works inside the same Native Tools prompt if you prefer that
394394
over `cargo install`.
395395

396+
#### Native Windows build — SYCL path (adventurous)
397+
398+
**Strongly recommend WSL2 first** (see the top of this section).
399+
This subsection exists because the path is in principle buildable
400+
on native Windows; in practice it's days of build-system tinkering
401+
without hardware the maintainers can iterate on. Not validated by
402+
us. File an issue with your findings.
403+
404+
What you're signing up for: AdaptiveCpp, built from source on
405+
Windows, pointed at either **AMD HIP SDK for Windows** (for AMD) or
406+
the **CUDA Toolkit** (for NVIDIA through SYCL, if you want the
407+
`main` branch's cross-vendor code path on NVIDIA instead of
408+
`cuda-only`'s CUB one). xchplot2's CMake then finds that install
409+
via `find_package(AdaptiveCpp)` and builds normally. AdaptiveCpp's
410+
FetchContent fallback is **not** viable on native Windows — its own
411+
CMakeLists assumes Linux-isms (libnuma, pthreads) that fall apart.
412+
Pre-install is mandatory.
413+
414+
Prerequisites (on top of the cuda-only prereqs above — MSVC,
415+
Windows SDK, Rust, CMake, Git):
416+
417+
- **LLVM 16–20** with Clang + LLD + the CMake development package
418+
(`LLVMConfig.cmake` / `ClangConfig.cmake`). Version coverage of
419+
Windows binary installers is patchy for these components; a
420+
self-built LLVM is usually the path of least resistance. See
421+
[AdaptiveCpp's Windows install guide](https://github.com/AdaptiveCpp/AdaptiveCpp/blob/develop/doc/installing.md)
422+
for the currently-recommended source.
423+
- **AMD HIP SDK for Windows** (for the AMD target) from AMD's
424+
[HIP SDK download page](https://www.amd.com/en/developer/rocm-hub/hip-sdk.html).
425+
AMD officially flags it as preview: limited card list, different
426+
device-library layout vs Linux ROCm, runtime coverage varies per
427+
GPU.
428+
- **CUDA Toolkit 12+** (for the NVIDIA-via-SYCL target). Same
429+
installer as the `cuda-only` path above.
430+
431+
Rough build sequence from a clean **x64 Native Tools Command Prompt
432+
for VS 2022** (paths are indicative — match your installs):
433+
434+
```cmd
435+
:: 1. Build AdaptiveCpp
436+
git clone --branch v25.10.0 https://github.com/AdaptiveCpp/AdaptiveCpp.git
437+
cd AdaptiveCpp
438+
cmake -B build -S . -G Ninja ^
439+
-DCMAKE_BUILD_TYPE=Release ^
440+
-DCMAKE_INSTALL_PREFIX=C:\opt\adaptivecpp ^
441+
-DLLVM_DIR=C:\path\to\llvm\lib\cmake\llvm ^
442+
-DWITH_CUDA_BACKEND=OFF ^
443+
-DWITH_HIP_BACKEND=ON ^
444+
-DROCM_PATH="C:\Program Files\AMD\ROCm\6.1"
445+
cmake --build build --parallel
446+
cmake --install build
447+
448+
:: 2. Build xchplot2 main against the install
449+
cd \path\to\xchplot2
450+
set CMAKE_PREFIX_PATH=C:\opt\adaptivecpp
451+
set ACPP_TARGETS=hip:gfx1101
452+
set XCHPLOT2_BUILD_CUDA=OFF
453+
cargo install --path .
454+
```
455+
456+
Flip `WITH_HIP_BACKEND``WITH_CUDA_BACKEND` and set
457+
`ACPP_TARGETS=cuda:sm_XX` for the NVIDIA-through-SYCL variant.
458+
459+
Failure modes you should expect to triage:
460+
461+
- **Missing LLVM CMake modules** — source-built LLVM with
462+
`LLVM_INSTALL_UTILS=ON` and the clang / clang-tools-extra
463+
projects enabled is the reliable recipe.
464+
- **Generic SSCP compiler disabled** (`DEFAULT_TARGETS` warning
465+
during AdaptiveCpp configure) — harmless if you set
466+
`ACPP_TARGETS=hip:gfxXXXX` explicitly at xchplot2's configure.
467+
- **`ROCM_PATH` mismatch** — AMD's Windows installer versions the
468+
directory (`C:\Program Files\AMD\ROCm\6.1\`); match it exactly.
469+
- **Clean build, runtime kernel failures** — the HIP SDK for
470+
Windows preview doesn't cover every GPU the Linux ROCm path
471+
does. Run `scripts/test-multi-gpu.sh` / `xchplot2 test 22 ...`
472+
with a k=22 plot first and `xchplot2 verify` the result before
473+
committing a large batch.
474+
475+
Seriously, try WSL2 first.
476+
396477
## Use
397478

398479
### Standalone (farmable plots)

0 commit comments

Comments
 (0)