Skip to content

Add full SYCL support for Windows builds#7513

Open
ssheorey with Copilot wants to merge 29 commits into
mainfrom
copilot/add-full-sycl-support-windows
Open

Add full SYCL support for Windows builds#7513
ssheorey with Copilot wants to merge 29 commits into
mainfrom
copilot/add-full-sycl-support-windows

Conversation

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Type

  • New feature (non-breaking change which adds functionality)

Motivation and Context

Adds full Windows SYCL support to align with PyTorch 2025.3.1 (oneAPI 2025.3.1). Migrates the Windows CI matrix from CUDA ON/OFF to target cpu, cuda, and xpu (SYCL), enabling open3d_xpu Python wheels and C++ binary distributions with SYCL acceleration on Windows.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test results here.
  • I will follow up and update the code if CI fails.

Description

CMake & Build Infrastructure

  • Relaxed Platform Checks: Lifted the Linux-only restriction on BUILD_SYCL_MODULE in CMakeLists.txt to support Windows builds.
  • Packaging Names: Appended -sycl to the packaged distribution name in cmake/Open3DPackaging.cmake when built with SYCL.
  • XPU Python Pathing: Routed compiled SYCL bindings to open3d/xpu in cpp/pybind/CMakeLists.txt and updated cpp/pybind/make_python_package.cmake to bundle the xpu directory structure.

Python Runtime & DLL Loading

  • Dynamic DLL Resolution: Configured Windows Python initialization in python/open3d/__init__.py to locate and load Intel compiler, oneMKL, and oneTBB redistributable DLL directories. Resolves the runtime directories dynamically using ONEAPI_ROOT (or default paths) with os.add_dll_directory to prevent DLL loading errors on Python 3.8+.
  • Subpackage Routing: Updated visualization, ML, and ML contrib initializers to import symbols correctly from the xpu submodule when running on a SYCL-enabled (xpu) binary.

GHA Windows CI / CD Matrix

  • Matrix Migration: Changed the GHA strategy matrix in .github/workflows/windows.yml from BUILD_CUDA_MODULE: [ON, OFF] to device: [cpu, cuda, xpu].
  • oneAPI Silent Provisioning: Added a setup step to fetch, silently install, and verify the exit codes for oneMKL 2025.3.1.10 and the Intel Compiler 2025.3.1.15 on Windows GHA runners when targeting xpu.
  • Toolchain & Linker Config: Configured CMake to invoke MSBuild with -T "Intel(R) oneAPI DPC++ Compiler" and search for OpenCL dynamically.
  • Unified Wheel Tests: Configured wheel building and testing to support both CPU and XPU variants, using PowerShell pattern-matching to automatically discover and verify the built wheel.
import open3d as o3d

# Check built configuration
print("SYCL Module Compiled:", o3d._build_config["BUILD_SYCL_MODULE"])

# Verify device availability
if o3d._build_config["BUILD_SYCL_MODULE"]:
    print("SYCL Device Available:", o3d.core.sycl.is_available())

@update-docs

update-docs Bot commented Jun 12, 2026

Copy link
Copy Markdown

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@ssheorey ssheorey marked this pull request as ready for review June 16, 2026 06:37
@ssheorey ssheorey added this to the v0.20 milestone Jul 2, 2026
Copilot AI added 2 commits July 2, 2026 18:50
… compiler

In Intel oneAPI 2025.3.0, icpx.exe identifies as "GNU-like command-line"
on Windows. CMake's Ninja generator on Windows generates MSVC-style flags
when the C compiler (icx) is MSVC-like. This causes icpx to reject flags
like /nologo, /EHsc, /Zi and the CXX compiler check fails.

Fix: use icx for CXX on Windows in all 3 cmake invocations in the
windows.yml workflow, and in 3rdparty/embree/embree.cmake (ExternalProject
for embree SYCL build). icx.exe is MSVC-compatible, handles C++ and
supports SYCL via -fsycl, making it consistent with the C compiler.

On Linux, icpx remains correct (it is the standard SYCL C++ compiler).
ssheorey added 4 commits July 2, 2026 14:44
…per byproduct

- cpp/tests/CMakeLists.txt: the bare 'tbb' target only exists when TBB is
  built from source. SYCL builds use OPEN3D_USE_ONEAPI_PACKAGES, which
  finds TBB via find_package(TBB) and only defines TBB::tbb, causing
  'CMake Error: No target "tbb"'. TBB::tbb is defined in both cases.
- 3rdparty/embree/embree.cmake: ze_wrapper static lib byproduct was
  listed twice in BUILD_BYPRODUCTS (once unconditionally, once via the
  SYCL-conditional ISA_BUILD_BYPRODUCTS), causing Ninja error
  'ze_wrapper.lib is defined as an output multiple times' on Windows
  SYCL builds.
… use lowercase install target for Ninja

- CMake script mode (-P) silently resets CMAKE_BINARY_DIR to the script's own
  invocation directory, ignoring any -D override. iterative_build_examples.cmake
  relied on -DCMAKE_BINARY_DIR to locate the top build tree, which happened to
  work for Makefiles/VS generators (which support building from subdirectories)
  but breaks under Ninja (single monolithic build.ninja), causing every example
  build to silently fail with 'loading build.ninja: The system cannot find the
  file specified'. Renamed to a non-reserved variable, EXAMPLE_TOP_BUILD_DIR.
- The Build step's 'cmake --target INSTALL' uses the uppercase meta-target name
  that only exists for the Visual Studio generator; Ninja only defines lowercase
  'install'. Switched to lowercase, which works for both generators.

Validated locally with oneAPI icx + Ninja: confirmed the working directory now
resolves to the top build dir and the install target is found.
…ime mismatches

- cmake/Open3DSetGlobalProperties.cmake:
  - Disable /MP for SYCL targets (icx rejects -MP with -fsycl offloading).
  - Predefine _Guarded_by_(x)= for SYCL targets so icx tolerates the SAL
    concurrency annotation used by recent MSVC STL <execution> headers
    (pulled in transitively via oneDPL). Uses a plain quoted
    target_compile_options string (not a generator expression or
    target_compile_definitions) since CMake mishandles literal parens
    in generator-expression content.
- 3rdparty/civetweb/civetweb.cmake: allow C++ exceptions needed by SYCL build.
- 3rdparty/embree/embree.cmake, CMakeLists.txt: force dynamic (/MD) MSVC
  runtime whenever BUILD_SYCL_MODULE=ON, since icx's -fsycl offloading is
  incompatible with the static runtime.
- 3rdparty/vtk/vtk_build.cmake, 3rdparty/filament/filament_download.cmake,
  3rdparty/filament/filament_build.cmake, 3rdparty/find_dependencies.cmake,
  3rdparty/libjpeg-turbo/libjpeg-turbo.cmake, 3rdparty/zeromq/zeromq_build.cmake,
  3rdparty/jsoncpp/jsoncpp.cmake: propagate the same dynamic-runtime override
  to these dependencies so their static libs don't mismatch
  (LNK2038/LNK2005/LNK1169) against Open3D's own dynamic-runtime objects
  when linking example executables.
- 3rdparty/webrtc/webrtc_download.cmake: (no functional change here; see
  workflow change) pre-built WebRTC on Windows only supports the static
  runtime, which is incompatible with SYCL's forced dynamic runtime.
- .github/workflows/windows.yml: disable BUILD_WEBRTC for the xpu matrix
  leg, since pre-built WebRTC binaries require the static runtime that
  SYCL builds cannot use.

Validated locally: full Windows xpu (BUILD_SYCL_MODULE=ON) Ninja build now
completes 632/632 steps with zero errors, including all example
executables and the pybind module.
Bug 13: The Config step initializes the oneAPI environment (setvars.bat)
using [System.Environment]::SetEnvironmentVariable with default Process
scope, which only affects the Config step's own PowerShell process. Since
each GitHub Actions 'run:' block executes in a brand new process, this
environment (LIB, INCLUDE, PATH additions for the Intel compiler) was lost
by the time the subsequent Build step ran.

This caused ExternalProject sub-builds (ext_zlib, ext_directxheaders,
ext_directxmath) to fail during Build, since they perform their own fresh
CMake compiler ABI detection at that point (invoked as ninja custom
commands), and icx could not find its own runtime import library
(libircmt.lib) without LIB properly set.

Fixed by additionally appending each captured env var to $GITHUB_ENV,
which GitHub Actions automatically applies to all subsequent steps in the
job.

Root-caused and validated locally by reproducing the exact
'LNK1104: cannot open file libircmt.lib' error with a minimal CMake+Ninja+icx
project configured in a fresh process lacking the oneAPI environment, and
confirming the error disappears once the environment is restored via the
same file-based mechanism used by $GITHUB_ENV.
@ssheorey

ssheorey commented Jul 8, 2026

Copy link
Copy Markdown
Member

@copilot /fix-ci
Pull request: #7513
Failed CI checks:

Check: Codacy Static Code Analysis
Status: failed
Conclusion: action_required
Details: https://app.codacy.com/gh/isl-org/Open3D/pull-requests/7513

Annotations and output:

33 new issues (0 max.) of at least minor severity.

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 33
           

See the complete overview on Codacy


Check: Build and run (2-jammy)
Status: failed
Conclusion: failure
Details: https://github.com/isl-org/Open3D/actions/runs/28918354418/job/85789922826

Annotations and output:
[warning] .github:2 Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, google-github-actions/auth@v2, google-github-actions/setup-gcloud@v2. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
[failure] .github:10689 Process completed with exit code 1.


Check: windows (ON, OFF, xpu, Release)
Status: failed
Conclusion: failure
Details: https://github.com/isl-org/Open3D/actions/runs/28918354451/job/85789915441

Annotations and output:
[warning] .github:4 Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-python@v5. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
[failure] .github:58013 Process completed with exit code 1.


Check: windows (OFF, ON, xpu, Release)
Status: failed
Conclusion: failure
Details: https://github.com/isl-org/Open3D/actions/runs/28918354451/job/85789915439

Annotations and output:
[warning] .github:4 Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-python@v5. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
[failure] .github:58327 Process completed with exit code 1.


Check: Build wheel (3.14, xpu, false)
Status: failed
Conclusion: failure
Details: https://github.com/isl-org/Open3D/actions/runs/28918354451/job/85789915383

Annotations and output:
[warning] .github:3 Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-python@v5. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
[failure] .github:681 Process completed with exit code 1.


Check: MacOS (macos-14, OFF)
Status: failed
Conclusion: failure
Details: https://github.com/isl-org/Open3D/actions/runs/28918354444/job/85789915206

Annotations and output:
[warning] .github:2 Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/cache@v4, actions/checkout@v4, actions/setup-python@v5. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
[failure] .github:564 Process completed with exit code 1.
[warning] .github:21 The following taps are not trusted:
aws/tap

Homebrew is currently ignoring formulae, casks and commands from these taps because tap trust is required.
Untap them with:
brew untap aws/tap
Trust specific formulae, casks and commands with:
brew trust --formula //
brew trust --cask //
brew trust --command //
Whole-tap trust is broader and includes all current and future formulae,
casks and commands from the listed taps. Trust whole taps with:
brew trust aws/tap
To disable trust checks:
export HOMEBREW_NO_REQUIRE_TAP_TRUST=1
This is not recommended and will be removed in a later release.
For more information, see:
https://docs.brew.sh/Tap-Trust


Check: MacOS (macos-14, ON)
Status: failed
Conclusion: failure
Details: https://github.com/isl-org/Open3D/actions/runs/28918354444/job/85789915189

Annotations and output:
[warning] .github:2 Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/cache@v4, actions/checkout@v4, actions/setup-python@v5. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
[failure] .github:564 Process completed with exit code 1.
[warning] .github:21 The following taps are not trusted:
aws/tap

Homebrew is currently ignoring formulae, casks and commands from these taps because tap trust is required.
Untap them with:
brew untap aws/tap
Trust specific formulae, casks and commands with:
brew trust --formula //
brew trust --cask //
brew trust --command //
Whole-tap trust is broader and includes all current and future formulae,
casks and commands from the listed taps. Trust whole taps with:
brew trust aws/tap
To disable trust checks:
export HOMEBREW_NO_REQUIRE_TAP_TRUST=1
This is not recommended and will be removed in a later release.
For more information, see:
https://docs.brew.sh/Tap-Trust

…, persist oneAPI env in build-wheel

- 3rdparty/googletest/googletest.cmake: After FetchContent_MakeAvailable,
  suppress -Wcharacter-conversion for IntelLLVM/ICX on gtest/gmock targets.
  ICX's Clang front-end errors on char16_t->char32_t implicit conversion in
  gtest-printers.h(524) which blocks the full Windows xpu build.

- .github/workflows/windows.yml (build-wheel Config step): Add the same
  $GITHUB_ENV persistence (Out-File) that was already present in the
  'windows' job Config step. Without it, oneAPI env vars (LIB, INCLUDE,
  PATH from setvars.bat) were lost at step boundary, causing libircmt.lib
  not found during ExternalProject configure steps in the Build step.

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot /fix-ci
Pull request: #7513
Failed CI checks:...

Fixed two Windows xpu CI failures in commit Fix Windows xpu CI: suppress ICX -Wcharacter-conversion in googletest, persist oneAPI env in build-wheel:

  1. windows (xpu) Build failure — ICX's Clang front-end treats an implicit char16_tchar32_t conversion in gtest-printers.h:524 as a hard error (-Werror,-Wcharacter-conversion). Fixed in 3rdparty/googletest/googletest.cmake by suppressing -Wcharacter-conversion on the FetchContent gtest/gmock targets when CMAKE_CXX_COMPILER_ID matches IntelLLVM.

  2. Build wheel (xpu) failureLINK : fatal error LNK1104: cannot open file 'libircmt.lib' in ExternalProject configure steps (ext_directxmath, ext_directxheaders, ext_zlib) during the Build Python package step. Root cause: the build-wheel job's Config step set oneAPI env vars via [System.Environment]::SetEnvironmentVariable (process-scoped only), which are lost when the next step runs in a new process. Fixed in .github/workflows/windows.yml by adding the same Out-File -FilePath $Env:GITHUB_ENV persistence that was already present in the windows job's Config step.

The MacOS (gfortran is required to compile LAPACK from source) and Ubuntu CUDA (2-jammy) failures are pre-existing issues not caused by this PR — ubuntu-cuda.yml is not in the PR diff, and other Ubuntu configs in the same run pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants