From 414d82608fb1e0ff7e8f195749fbba2a998fd737 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 23:46:09 +0000 Subject: [PATCH 01/27] Add full SYCL support for Windows builds with device matrix [cpu, cuda, xpu] and setup oneAPI 2025.3.1 --- .github/workflows/windows.yml | 137 +++++++++++++++++++----- 3rdparty/find_dependencies.cmake | 7 +- CMakeLists.txt | 4 +- cmake/Open3DPackaging.cmake | 3 + cpp/pybind/CMakeLists.txt | 4 +- cpp/pybind/make_python_package.cmake | 2 +- python/open3d/__init__.py | 48 +++++++++ python/open3d/ml/__init__.py | 2 + python/open3d/ml/contrib/__init__.py | 2 + python/open3d/visualization/__init__.py | 4 + 10 files changed, 183 insertions(+), 30 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d571f97e295..98bc655d1db 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -44,23 +44,27 @@ jobs: matrix: BUILD_SHARED_LIBS: [ON, OFF] STATIC_RUNTIME: [ON, OFF] - BUILD_CUDA_MODULE: [ON, OFF] + device: [cpu, cuda, xpu] CONFIG: [Release, Debug] exclude: - BUILD_SHARED_LIBS: ON STATIC_RUNTIME: ON - - BUILD_CUDA_MODULE: ON # FIXME + - device: cuda + CONFIG: Debug + - device: xpu CONFIG: Debug env: + BUILD_CUDA_MODULE: ${{ matrix.device == 'cuda' && 'ON' || 'OFF' }} + BUILD_SYCL_MODULE: ${{ matrix.device == 'xpu' && 'ON' || 'OFF' }} BUILD_WEBRTC: ${{ ( matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' ) && 'ON' || 'OFF' }} - BUILD_PYTORCH_OPS: ${{ ( matrix.BUILD_CUDA_MODULE == 'ON' || matrix.CONFIG == 'Debug' ) && 'OFF' || 'ON' }} # FIXME + BUILD_PYTORCH_OPS: ${{ ( matrix.device == 'cuda' || matrix.device == 'xpu' || matrix.CONFIG == 'Debug' ) && 'OFF' || 'ON' }} # FIXME steps: - name: Disk space used run: Get-PSDrive - name: Install CUDA - if: ${{ matrix.BUILD_CUDA_MODULE == 'ON' }} + if: ${{ matrix.device == 'cuda' }} run: | # Define variables $CUDA_VER_FULL = "${{ env.CUDA_VERSION }}" @@ -92,6 +96,21 @@ jobs: echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append echo "$CUDA_PATH\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append + - name: Install Intel oneAPI + if: ${{ matrix.device == 'xpu' }} + shell: pwsh + run: | + $MKL_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" + $COMPILER_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" + Write-Host "Downloading oneMKL..." + Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" + Write-Host "Downloading Intel Compiler..." + Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" + Write-Host "Installing oneMKL..." + Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + Write-Host "Installing Intel Compiler..." + Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + - name: Install glslang via vcpkg run: | vcpkg install glslang[tools]:x64-windows @@ -116,9 +135,11 @@ jobs: - name: Install PyTorch requirements run: | - if ( '${{ matrix.BUILD_CUDA_MODULE }}' -eq 'ON' ) { + if ( '${{ matrix.device }}' -eq 'cuda' ) { # python -m pip install -r open3d_ml/requirements-torch-cuda.txt python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126 + } elseif ( '${{ matrix.device }}' -eq 'xpu' ) { + # No PyTorch requirement for SYCL (xpu) since PyTorch ops are disabled } else { python -m pip install -r open3d_ml/requirements-torch.txt } @@ -133,7 +154,19 @@ jobs: $Env:DEVELOPER_BUILD = "ON" } cmake --version - cmake -G "Visual Studio 17 2022" -A x64 ` + $CMAKE_ARGS = @() + if ('${{ matrix.device }}' -eq 'xpu') { + $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' + $CMAKE_ARGS += '-DCMAKE_PREFIX_PATH=C:\Program Files (x86)\Intel\oneAPI\mkl\latest\lib\cmake\mkl;C:\Program Files (x86)\Intel\oneAPI\tbb\latest' + $OpenCLLibFile = Get-ChildItem -Path "C:\Program Files (x86)\Intel\oneAPI\compiler\latest" -Filter "OpenCL.lib" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($OpenCLLibFile) { + $OpenCL_Library = $OpenCLLibFile.FullName.Replace('\', '/') + $OpenCL_Include = (Join-Path $OpenCLLibFile.Directory.Parent "include").Replace('\', '/') + $CMAKE_ARGS += "-DOpenCL_LIBRARY=$OpenCL_Library" + $CMAKE_ARGS += "-DOpenCL_INCLUDE_DIR=$OpenCL_Include" + } + } + cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS ` -DDEVELOPER_BUILD=$Env:DEVELOPER_BUILD ` -DBUILD_EXAMPLES=OFF ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` @@ -143,7 +176,8 @@ jobs: -DBUILD_LIBREALSENSE=ON ` -DBUILD_WEBRTC=${{ env.BUILD_WEBRTC }} ` -DBUILD_UNIT_TESTS=ON ` - -DBUILD_CUDA_MODULE=${{ matrix.BUILD_CUDA_MODULE }} ` + -DBUILD_CUDA_MODULE=${{ env.BUILD_CUDA_MODULE }} ` + -DBUILD_SYCL_MODULE=${{ env.BUILD_SYCL_MODULE }} ` -DBUILD_PYTORCH_OPS=${{ env.BUILD_PYTORCH_OPS }} ` ${{ env.SRC_DIR }} @@ -158,7 +192,7 @@ jobs: - name: Package working-directory: ${{ env.BUILD_DIR }} - if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' }} + if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' && matrix.device != 'cuda' }} run: | $ErrorActionPreference = 'Stop' cmake --build . --parallel ${{ env.NPROC }} --config ${{ matrix.CONFIG }} ` @@ -172,7 +206,7 @@ jobs: $Env:GITHUB_ENV -Encoding utf8 -Append - name: Upload Package - if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' }} + if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' && matrix.device != 'cuda' }} uses: actions/upload-artifact@v4 with: name: ${{ env.DEVEL_PKG_NAME }} @@ -180,7 +214,7 @@ jobs: if-no-files-found: error - name: Update devel release with package - if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' }} + if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' && matrix.device != 'cuda' }} env: GH_TOKEN: ${{ github.token }} shell: bash @@ -190,7 +224,7 @@ jobs: - name: Viewer App working-directory: ${{ env.BUILD_DIR }} - if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' && matrix.CONFIG == 'Release' }} + if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.device == 'cpu' && matrix.CONFIG == 'Release' }} run: | $ErrorActionPreference = 'Stop' cmake --build . --parallel ${{ env.NPROC }} --config ${{ matrix.CONFIG }} ` @@ -199,7 +233,7 @@ jobs: --target INSTALL - name: Upload Viewer - if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' && matrix.CONFIG == 'Release' }} + if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.device == 'cpu' && matrix.CONFIG == 'Release' }} uses: actions/upload-artifact@v4 with: name: open3d-app-windows-amd64 @@ -207,7 +241,7 @@ jobs: if-no-files-found: error - name: Update devel release with viewer - if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' && matrix.CONFIG == 'Release' }} + if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.device == 'cpu' && matrix.CONFIG == 'Release' }} env: GH_TOKEN: ${{ github.token }} run: | @@ -217,7 +251,7 @@ jobs: bash .github/workflows/update_release.sh "open3d-$Env:OPEN3D_VERSION_FULL-app-windows-amd64.zip" - name: Run C++ unit tests - if: ${{ matrix.BUILD_CUDA_MODULE == 'OFF' }} + if: ${{ matrix.device != 'cuda' }} working-directory: ${{ env.BUILD_DIR }} run: | echo "Add --gtest_random_seed=SEED to the test command to repeat this test sequence." @@ -228,12 +262,16 @@ jobs: $ErrorActionPreference = 'Stop' mkdir build cd build - cmake -G "Visual Studio 17 2022" -A x64 ` + $CMAKE_ARGS = @() + if ('${{ matrix.device }}' -eq 'xpu') { + $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' + } + cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DSTATIC_WINDOWS_RUNTIME=${{ matrix.STATIC_RUNTIME }} ` .. cmake --build . --config ${{ matrix.CONFIG }} - if ( '${{ matrix.BUILD_CUDA_MODULE }}' -eq 'OFF' ) { # FIXME + if ( '${{ matrix.device }}' -ne 'cuda' ) { # FIXME .\${{ matrix.CONFIG }}\Draw.exe --skip-for-unit-test } Remove-Item "C:\Program Files\Open3D" -Recurse @@ -250,10 +288,11 @@ jobs: cmake --build . --config ${{ matrix.CONFIG }} --target install-pip-package - name: Import python package # If BUILD_SHARED_LIBS == ON, Open3D.dll needs to be copied, which is not recommended for python. - if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.BUILD_CUDA_MODULE == 'OFF' }} # FIXME + if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.device != 'cuda' }} # FIXME run: | python -c "import open3d; print('Imported:', open3d)" python -c "import open3d; print('CUDA enabled: ', open3d.core.cuda.is_available())" + python -c "import open3d; print('SYCL enabled: ', open3d.core.sycl.is_available() if hasattr(open3d.core, 'sycl') else False)" - name: Disk space used run: Get-PSDrive @@ -267,6 +306,7 @@ jobs: # https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 matrix: python_version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + device: [cpu, xpu] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -280,10 +320,27 @@ jobs: python_version: '3.13' env: - BUILD_PYTORCH_OPS: 'ON' + BUILD_CUDA_MODULE: 'OFF' + BUILD_SYCL_MODULE: ${{ matrix.device == 'xpu' && 'ON' || 'OFF' }} + BUILD_PYTORCH_OPS: ${{ matrix.device == 'xpu' && 'OFF' || 'ON' }} steps: + - name: Install Intel oneAPI + if: ${{ matrix.device == 'xpu' }} + shell: pwsh + run: | + $MKL_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" + $COMPILER_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" + Write-Host "Downloading oneMKL..." + Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" + Write-Host "Downloading Intel Compiler..." + Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" + Write-Host "Installing oneMKL..." + Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + Write-Host "Installing Intel Compiler..." + Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + - name: Install glslang via vcpkg run: | vcpkg install glslang[tools]:x64-windows @@ -330,7 +387,19 @@ jobs: if ($Env:DEVELOPER_BUILD -ne "OFF") { $Env:DEVELOPER_BUILD = "ON" } - cmake -G "Visual Studio 17 2022" -A x64 ` + $CMAKE_ARGS = @() + if ('${{ matrix.device }}' -eq 'xpu') { + $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' + $CMAKE_ARGS += '-DCMAKE_PREFIX_PATH=C:\Program Files (x86)\Intel\oneAPI\mkl\latest\lib\cmake\mkl;C:\Program Files (x86)\Intel\oneAPI\tbb\latest' + $OpenCLLibFile = Get-ChildItem -Path "C:\Program Files (x86)\Intel\oneAPI\compiler\latest" -Filter "OpenCL.lib" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($OpenCLLibFile) { + $OpenCL_Library = $OpenCLLibFile.FullName.Replace('\', '/') + $OpenCL_Include = (Join-Path $OpenCLLibFile.Directory.Parent "include").Replace('\', '/') + $CMAKE_ARGS += "-DOpenCL_LIBRARY=$OpenCL_Library" + $CMAKE_ARGS += "-DOpenCL_INCLUDE_DIR=$OpenCL_Include" + } + } + cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DDEVELOPER_BUILD="$Env:DEVELOPER_BUILD" ` -DBUILD_SHARED_LIBS=OFF ` @@ -340,6 +409,8 @@ jobs: -DBUILD_LIBREALSENSE=ON ` -DBUILD_WEBRTC=ON ` -DBUILD_JUPYTER_EXTENSION=ON ` + -DBUILD_CUDA_MODULE=${{ env.BUILD_CUDA_MODULE }} ` + -DBUILD_SYCL_MODULE=${{ env.BUILD_SYCL_MODULE }} ` -DBUILD_PYTORCH_OPS=${{ env.BUILD_PYTORCH_OPS }} ` ${{ env.SRC_DIR }} @@ -377,6 +448,7 @@ jobs: fail-fast: false matrix: python_version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + device: [cpu, xpu] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -389,8 +461,23 @@ jobs: - is_main: false python_version: '3.13' env: - BUILD_PYTORCH_OPS: 'ON' + BUILD_PYTORCH_OPS: ${{ matrix.device == 'xpu' && 'OFF' || 'ON' }} steps: + - name: Install Intel oneAPI + if: ${{ matrix.device == 'xpu' }} + shell: pwsh + run: | + $MKL_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" + $COMPILER_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" + Write-Host "Downloading oneMKL..." + Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" + Write-Host "Downloading Intel Compiler..." + Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" + Write-Host "Installing oneMKL..." + Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + Write-Host "Installing Intel Compiler..." + Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + - name: Checkout source code uses: actions/checkout@v4 @@ -425,15 +512,17 @@ jobs: python -m pip install -U -r open3d_ml/requirements-torch.txt } $py_tag=(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')") - if (Test-Path -Path "pip_package") { - $PIP_PKG_NAME=(Get-ChildItem pip_package\open3d*-$py_tag-*.whl).Name + $search_dir = if (Test-Path -Path "pip_package") { "pip_package" } else { "." } + if ('${{ matrix.device }}' -eq 'xpu') { + $PIP_PKG_NAME=(Get-ChildItem (Join-Path $search_dir "open3d_xpu*-$py_tag-*.whl")).Name } else { - $PIP_PKG_NAME=(Get-ChildItem open3d*-$py_tag-*.whl).Name + $PIP_PKG_NAME=(Get-ChildItem (Join-Path $search_dir "open3d-*-$py_tag-*.whl") | Where-Object { $_.Name -notlike "open3d_xpu*" }).Name } echo "Installing Open3D wheel $PIP_PKG_NAME in virtual environment..." - python -m pip install "$PIP_PKG_NAME" + python -m pip install (Join-Path $search_dir $PIP_PKG_NAME) python -c "import open3d; print('Imported:', open3d)" python -c "import open3d; print('CUDA enabled: ', open3d.core.cuda.is_available())" + python -c "import open3d; print('SYCL enabled: ', open3d.core.sycl.is_available() if hasattr(open3d.core, 'sycl') else False)" deactivate - name: Run Python unit tests diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake index fb926d36ebb..385bd45e0c5 100644 --- a/3rdparty/find_dependencies.cmake +++ b/3rdparty/find_dependencies.cmake @@ -1617,7 +1617,12 @@ if(OPEN3D_USE_ONEAPI_PACKAGES) ) if (BUILD_SYCL_MODULE) # target_link_options(3rdparty_mkl INTERFACE "-Wl,-export-dynamic") - target_link_libraries(3rdparty_mkl INTERFACE OpenCL) + if (WIN32) + find_package(OpenCL REQUIRED) + target_link_libraries(3rdparty_mkl INTERFACE OpenCL::OpenCL) + else() + target_link_libraries(3rdparty_mkl INTERFACE OpenCL) + endif() endif() # MKL definitions target_compile_options(3rdparty_mkl INTERFACE "$<$:$<$:-m64>>") diff --git a/CMakeLists.txt b/CMakeLists.txt index 3283c8e8b21..d07954b59cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,8 +301,8 @@ if (BUILD_SYCL_MODULE AND NOT CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") "but got CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID} " "and CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}.") endif() -if (BUILD_SYCL_MODULE AND (NOT UNIX OR APPLE)) - message(FATAL_ERROR "Open3D SYCL support is only available on Linux") +if (BUILD_SYCL_MODULE AND APPLE) + message(FATAL_ERROR "Open3D SYCL support is not available on Apple") endif() if(BUILD_SYCL_MODULE AND NOT GLIBCXX_USE_CXX11_ABI) message(FATAL_ERROR "BUILD_SYCL_MODULE=ON requires GLIBCXX_USE_CXX11_ABI=ON") diff --git a/cmake/Open3DPackaging.cmake b/cmake/Open3DPackaging.cmake index e6ce4a3c15c..b3531a5fcd5 100644 --- a/cmake/Open3DPackaging.cmake +++ b/cmake/Open3DPackaging.cmake @@ -26,6 +26,9 @@ endif() if (BUILD_CUDA_MODULE) set(_sys ${_sys}-cuda) endif() +if (BUILD_SYCL_MODULE) + set(_sys ${_sys}-sycl) +endif() if (NOT MSVC) set(CPACK_STRIP_FILES ON) # Don't strip MSVC Debug build endif() diff --git a/cpp/pybind/CMakeLists.txt b/cpp/pybind/CMakeLists.txt index 5a3d8b8893e..d46b68206ae 100644 --- a/cpp/pybind/CMakeLists.txt +++ b/cpp/pybind/CMakeLists.txt @@ -75,9 +75,9 @@ endif() # At `make`: open3d.so (or the equivalents) will be created at # PYTHON_COMPILED_MODULE_DIR. The default location is -# `build/lib/${CMAKE_BUILD_TYPE}/Python/{cpu|cuda}` +# `build/lib/${CMAKE_BUILD_TYPE}/Python/{cpu|cuda|xpu}` set(PYTHON_COMPILED_MODULE_DIR - "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Python/$,cuda,cpu>") + "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Python/$,cuda,$,xpu,cpu>>") if (UNIX AND NOT APPLE) # Use RPATH instead of RUNPATH in pybind so that needed libc++.so can find child dependant libc++abi.so in RPATH diff --git a/cpp/pybind/make_python_package.cmake b/cpp/pybind/make_python_package.cmake index aa4171414b0..384e05f7f04 100644 --- a/cpp/pybind/make_python_package.cmake +++ b/cpp/pybind/make_python_package.cmake @@ -23,7 +23,7 @@ foreach(COMPILED_MODULE_PATH ${COMPILED_MODULE_PATH_LIST}) get_filename_component(COMPILED_MODULE_NAME ${COMPILED_MODULE_PATH} NAME) get_filename_component(COMPILED_MODULE_ARCH_DIR ${COMPILED_MODULE_PATH} DIRECTORY) get_filename_component(COMPILED_MODULE_BASE_DIR ${COMPILED_MODULE_ARCH_DIR} DIRECTORY) - foreach(ARCH cpu cuda) + foreach(ARCH cpu cuda xpu) if(IS_DIRECTORY "${COMPILED_MODULE_BASE_DIR}/${ARCH}") file(INSTALL "${COMPILED_MODULE_BASE_DIR}/${ARCH}/" DESTINATION "${PYTHON_PACKAGE_DST_DIR}/open3d/${ARCH}" diff --git a/python/open3d/__init__.py b/python/open3d/__init__.py index 87608701d5c..9747a7fc59f 100644 --- a/python/open3d/__init__.py +++ b/python/open3d/__init__.py @@ -29,6 +29,23 @@ if sys.platform == "win32": # Unix: Use rpath to find libraries _win32_dll_dir = os.add_dll_directory(str(Path(__file__).parent)) + # For oneAPI / SYCL on Windows, add oneAPI redist directories to DLL search path if they exist + _oneapi_paths = [ + r"C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler", + r"C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin", + r"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\intel64", + r"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin", + r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\bin\intel64\vc14", + r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc14", + r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64_win\vc14", + ] + _added_dll_dirs = [] + for _p in _oneapi_paths: + if os.path.exists(_p): + try: + _added_dll_dirs.append(os.add_dll_directory(_p)) + except Exception: + pass __DEVICE_API__ = "cpu" if _build_config["BUILD_CUDA_MODULE"]: @@ -96,6 +113,34 @@ ImportWarning, ) +if _build_config["BUILD_SYCL_MODULE"]: + try: + from open3d.xpu.pybind import ( + core, + camera, + data, + geometry, + io, + pipelines, + utility, + t, + ) + from open3d.xpu import pybind + + __DEVICE_API__ = "xpu" + except OSError as os_error: + warnings.warn( + f"Open3D was built with SYCL support, but an error ocurred while loading the Open3D SYCL Python bindings. Check your oneAPI installation. Falling back to the CPU pybind library. Reported error: {os_error}.", + ImportWarning, + ) + except StopIteration: + warnings.warn( + "Open3D was built with SYCL support, but Open3D SYCL Python " + "binding library not found! Falling back to the CPU Python " + "binding library.", + ImportWarning, + ) + if __DEVICE_API__ == "cpu": from open3d.cpu.pybind import ( core, @@ -211,4 +256,7 @@ def _jupyter_nbextension_paths(): if sys.platform == "win32": _win32_dll_dir.close() + if "_added_dll_dirs" in locals(): + for _d in _added_dll_dirs: + _d.close() del os, sys, CDLL, find_library, Path, warnings, _insert_pybind_names diff --git a/python/open3d/ml/__init__.py b/python/open3d/ml/__init__.py index cf7342e0a27..66c0e11d713 100644 --- a/python/open3d/ml/__init__.py +++ b/python/open3d/ml/__init__.py @@ -9,6 +9,8 @@ import open3d as _open3d if _open3d.__DEVICE_API__ == 'cuda': from open3d.cuda.pybind.ml import * +elif _open3d.__DEVICE_API__ == 'xpu': + from open3d.xpu.pybind.ml import * else: from open3d.cpu.pybind.ml import * diff --git a/python/open3d/ml/contrib/__init__.py b/python/open3d/ml/contrib/__init__.py index b883e8024fd..3593e7d9a2a 100644 --- a/python/open3d/ml/contrib/__init__.py +++ b/python/open3d/ml/contrib/__init__.py @@ -8,5 +8,7 @@ import open3d as _open3d if _open3d.__DEVICE_API__ == 'cuda': from open3d.cuda.pybind.ml.contrib import * +elif _open3d.__DEVICE_API__ == 'xpu': + from open3d.xpu.pybind.ml.contrib import * else: from open3d.cpu.pybind.ml.contrib import * diff --git a/python/open3d/visualization/__init__.py b/python/open3d/visualization/__init__.py index cab0cad14ad..4edd59b1766 100644 --- a/python/open3d/visualization/__init__.py +++ b/python/open3d/visualization/__init__.py @@ -10,6 +10,10 @@ if open3d._build_config["BUILD_GUI"]: from open3d.cuda.pybind.visualization import gui from open3d.cuda.pybind.visualization import * +elif open3d.__DEVICE_API__ == "xpu": + if open3d._build_config["BUILD_GUI"]: + from open3d.xpu.pybind.visualization import gui + from open3d.xpu.pybind.visualization import * else: if open3d._build_config["BUILD_GUI"]: from open3d.cpu.pybind.visualization import gui From cacc4698a3b7cf6b23d40c92edfe24863dc3c53c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 23:48:29 +0000 Subject: [PATCH 02/27] Address code review suggestions: centralize oneAPI download URLs, optimize python DLL loading logic, and fix typos --- .github/workflows/windows.yml | 14 ++++++++------ python/open3d/__init__.py | 11 +++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 98bc655d1db..d0d893b53a7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,6 +33,8 @@ env: BUILD_DIR: "C:\\Open3D\\build" NPROC: 6 DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }} + ONEAPI_MKL_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" + ONEAPI_COMPILER_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" jobs: windows: @@ -100,8 +102,8 @@ jobs: if: ${{ matrix.device == 'xpu' }} shell: pwsh run: | - $MKL_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" - $COMPILER_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" + $MKL_URL = "${{ env.ONEAPI_MKL_URL }}" + $COMPILER_URL = "${{ env.ONEAPI_COMPILER_URL }}" Write-Host "Downloading oneMKL..." Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" Write-Host "Downloading Intel Compiler..." @@ -330,8 +332,8 @@ jobs: if: ${{ matrix.device == 'xpu' }} shell: pwsh run: | - $MKL_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" - $COMPILER_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" + $MKL_URL = "${{ env.ONEAPI_MKL_URL }}" + $COMPILER_URL = "${{ env.ONEAPI_COMPILER_URL }}" Write-Host "Downloading oneMKL..." Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" Write-Host "Downloading Intel Compiler..." @@ -467,8 +469,8 @@ jobs: if: ${{ matrix.device == 'xpu' }} shell: pwsh run: | - $MKL_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" - $COMPILER_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" + $MKL_URL = "${{ env.ONEAPI_MKL_URL }}" + $COMPILER_URL = "${{ env.ONEAPI_COMPILER_URL }}" Write-Host "Downloading oneMKL..." Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" Write-Host "Downloading Intel Compiler..." diff --git a/python/open3d/__init__.py b/python/open3d/__init__.py index 9747a7fc59f..751c28855be 100644 --- a/python/open3d/__init__.py +++ b/python/open3d/__init__.py @@ -27,6 +27,7 @@ import warnings from open3d._build_config import _build_config +_added_dll_dirs = [] if sys.platform == "win32": # Unix: Use rpath to find libraries _win32_dll_dir = os.add_dll_directory(str(Path(__file__).parent)) # For oneAPI / SYCL on Windows, add oneAPI redist directories to DLL search path if they exist @@ -39,7 +40,6 @@ r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc14", r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64_win\vc14", ] - _added_dll_dirs = [] for _p in _oneapi_paths: if os.path.exists(_p): try: @@ -102,7 +102,7 @@ ) except OSError as os_error: warnings.warn( - f"Open3D was built with CUDA support, but an error ocurred while loading the Open3D CUDA Python bindings. This is usually because the CUDA libraries could not be found. Check your CUDA installation. Falling back to the CPU pybind library. Reported error: {os_error}.", + f"Open3D was built with CUDA support, but an error occurred while loading the Open3D CUDA Python bindings. This is usually because the CUDA libraries could not be found. Check your CUDA installation. Falling back to the CPU pybind library. Reported error: {os_error}.", ImportWarning, ) except StopIteration: @@ -130,7 +130,7 @@ __DEVICE_API__ = "xpu" except OSError as os_error: warnings.warn( - f"Open3D was built with SYCL support, but an error ocurred while loading the Open3D SYCL Python bindings. Check your oneAPI installation. Falling back to the CPU pybind library. Reported error: {os_error}.", + f"Open3D was built with SYCL support, but an error occurred while loading the Open3D SYCL Python bindings. Check your oneAPI installation. Falling back to the CPU pybind library. Reported error: {os_error}.", ImportWarning, ) except StopIteration: @@ -256,7 +256,6 @@ def _jupyter_nbextension_paths(): if sys.platform == "win32": _win32_dll_dir.close() - if "_added_dll_dirs" in locals(): - for _d in _added_dll_dirs: - _d.close() + for _d in _added_dll_dirs: + _d.close() del os, sys, CDLL, find_library, Path, warnings, _insert_pybind_names From 6c46132300bc10c834439dcc08dbd2870bfdce20 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 23:50:27 +0000 Subject: [PATCH 03/27] Improve robustness of oneAPI installer process checks, check ONEAPI_ROOT env, and add wheel-finding error checks --- .github/workflows/windows.yml | 26 ++++++++++++++++++-------- python/open3d/__init__.py | 15 ++++++++------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d0d893b53a7..d056161e5ae 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -109,9 +109,11 @@ jobs: Write-Host "Downloading Intel Compiler..." Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" Write-Host "Installing oneMKL..." - Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + $p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru + if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } Write-Host "Installing Intel Compiler..." - Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + $p2 = Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru + if ($p2.ExitCode -ne 0) { throw "Intel Compiler installation failed with exit code $($p2.ExitCode)" } - name: Install glslang via vcpkg run: | @@ -339,9 +341,11 @@ jobs: Write-Host "Downloading Intel Compiler..." Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" Write-Host "Installing oneMKL..." - Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + $p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru + if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } Write-Host "Installing Intel Compiler..." - Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + $p2 = Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru + if ($p2.ExitCode -ne 0) { throw "Intel Compiler installation failed with exit code $($p2.ExitCode)" } - name: Install glslang via vcpkg run: | @@ -476,9 +480,11 @@ jobs: Write-Host "Downloading Intel Compiler..." Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" Write-Host "Installing oneMKL..." - Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + $p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru + if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } Write-Host "Installing Intel Compiler..." - Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait + $p2 = Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru + if ($p2.ExitCode -ne 0) { throw "Intel Compiler installation failed with exit code $($p2.ExitCode)" } - name: Checkout source code uses: actions/checkout@v4 @@ -516,9 +522,13 @@ jobs: $py_tag=(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')") $search_dir = if (Test-Path -Path "pip_package") { "pip_package" } else { "." } if ('${{ matrix.device }}' -eq 'xpu') { - $PIP_PKG_NAME=(Get-ChildItem (Join-Path $search_dir "open3d_xpu*-$py_tag-*.whl")).Name + $PIP_PKG_NAME=(Get-ChildItem (Join-Path $search_dir "open3d_xpu*-$py_tag-*.whl") -ErrorAction SilentlyContinue).Name } else { - $PIP_PKG_NAME=(Get-ChildItem (Join-Path $search_dir "open3d-*-$py_tag-*.whl") | Where-Object { $_.Name -notlike "open3d_xpu*" }).Name + $PIP_PKG_NAME=(Get-ChildItem (Join-Path $search_dir "open3d-*-$py_tag-*.whl") -ErrorAction SilentlyContinue | Where-Object { $_.Name -notlike "open3d_xpu*" }).Name + } + if (-not $PIP_PKG_NAME) { + Write-Error "Could not find a valid Open3D wheel in $search_dir matching the python version CP$py_tag and device!" + exit 1 } echo "Installing Open3D wheel $PIP_PKG_NAME in virtual environment..." python -m pip install (Join-Path $search_dir $PIP_PKG_NAME) diff --git a/python/open3d/__init__.py b/python/open3d/__init__.py index 751c28855be..a8922b64600 100644 --- a/python/open3d/__init__.py +++ b/python/open3d/__init__.py @@ -31,14 +31,15 @@ if sys.platform == "win32": # Unix: Use rpath to find libraries _win32_dll_dir = os.add_dll_directory(str(Path(__file__).parent)) # For oneAPI / SYCL on Windows, add oneAPI redist directories to DLL search path if they exist + _oneapi_root = os.environ.get("ONEAPI_ROOT", r"C:\Program Files (x86)\Intel\oneAPI") _oneapi_paths = [ - r"C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler", - r"C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin", - r"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\intel64", - r"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin", - r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\bin\intel64\vc14", - r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc14", - r"C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64_win\vc14", + os.path.join(_oneapi_root, r"compiler\latest\windows\redist\intel64_win\compiler"), + os.path.join(_oneapi_root, r"compiler\latest\windows\bin"), + os.path.join(_oneapi_root, r"mkl\latest\bin\intel64"), + os.path.join(_oneapi_root, r"mkl\latest\bin"), + os.path.join(_oneapi_root, r"tbb\latest\bin\intel64\vc14"), + os.path.join(_oneapi_root, r"tbb\latest\redist\intel64\vc14"), + os.path.join(_oneapi_root, r"tbb\latest\redist\intel64_win\vc14"), ] for _p in _oneapi_paths: if os.path.exists(_p): From e7de201a5369b12d9db41cf4583980c3a265b1d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 23:51:38 +0000 Subject: [PATCH 04/27] Fix double 'cp' prefix in test-wheel error message --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d056161e5ae..38605b23cde 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -527,7 +527,7 @@ jobs: $PIP_PKG_NAME=(Get-ChildItem (Join-Path $search_dir "open3d-*-$py_tag-*.whl") -ErrorAction SilentlyContinue | Where-Object { $_.Name -notlike "open3d_xpu*" }).Name } if (-not $PIP_PKG_NAME) { - Write-Error "Could not find a valid Open3D wheel in $search_dir matching the python version CP$py_tag and device!" + Write-Error "Could not find a valid Open3D wheel in $search_dir matching the python version $py_tag and device!" exit 1 } echo "Installing Open3D wheel $PIP_PKG_NAME in virtual environment..." From 68c33c050b2060ffd29efdd39734164fc68516f2 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Mon, 15 Jun 2026 22:59:23 -0700 Subject: [PATCH 05/27] use python venv oneapi runtime at import. --- .github/workflows/windows.yml | 17 ---------------- 3rdparty/README_SYCL.md | 8 +++++--- docs/sycl.rst | 16 ++++++++++++--- python/open3d/__init__.py | 37 +++++++++++++++++++++-------------- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 38605b23cde..eee46bc1a43 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -469,23 +469,6 @@ jobs: env: BUILD_PYTORCH_OPS: ${{ matrix.device == 'xpu' && 'OFF' || 'ON' }} steps: - - name: Install Intel oneAPI - if: ${{ matrix.device == 'xpu' }} - shell: pwsh - run: | - $MKL_URL = "${{ env.ONEAPI_MKL_URL }}" - $COMPILER_URL = "${{ env.ONEAPI_COMPILER_URL }}" - Write-Host "Downloading oneMKL..." - Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" - Write-Host "Downloading Intel Compiler..." - Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" - Write-Host "Installing oneMKL..." - $p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru - if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } - Write-Host "Installing Intel Compiler..." - $p2 = Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru - if ($p2.ExitCode -ne 0) { throw "Intel Compiler installation failed with exit code $($p2.ExitCode)" } - - name: Checkout source code uses: actions/checkout@v4 diff --git a/3rdparty/README_SYCL.md b/3rdparty/README_SYCL.md index 26549446616..30f148c133c 100644 --- a/3rdparty/README_SYCL.md +++ b/3rdparty/README_SYCL.md @@ -98,9 +98,11 @@ Open3D is designed to make use of the SYCL GPU devices. ## List of oneAPI Python packages -To make `pip install open3d` works out-of-the box on SYCL-enabled platforms, -we can utilize runtime libraries released via PyPI. This feature needs to be -implemented. +Open3D SYCL wheels declare a dependency on `dpcpp-cpp-rt` (see +`python/requirements_sycl.txt`). Pip installs the transitive Intel runtime +packages into the same Python environment. On Linux, ``pybind`` RPATH finds +``/lib``; on Windows, ``open3d/__init__.py`` registers +``site-packages/*.data/data/Library/bin`` with ``add_dll_directory``. User: - https://pypi.org/user/IntelAutomationEngineering/ diff --git a/docs/sycl.rst b/docs/sycl.rst index d7737a9b106..540772c521c 100644 --- a/docs/sycl.rst +++ b/docs/sycl.rst @@ -6,7 +6,8 @@ Cross-platform GPU support (SYCL) From v0.19, Open3D provides an experimental SYCL backend for cross-platform GPU support. This backend allows Open3D operations to run on many different GPUs, including integrated GPUs and discrete GPUs from Intel, Nvidia and AMD. We -provide pre-built C++ binaries and Python wheels for Linux (Ubuntu 22.04+). +provide pre-built C++ binaries and Python wheels for Linux (Ubuntu 22.04+) and +Windows 10+. Enabled features ----------------- @@ -15,7 +16,7 @@ Many Tensor API operations and Tensor Geometry operations without custom kernels can now be offloaded to SYCL devices. In addition, HW accelerated raycasting queries in :py:class:`open3d.t.geometry.RayCastingScene` are also supported. You will get an error if an operation is not supported. The implementation is tested -on Linux on Intel integrated and discrete GPUs. Currently, a single GPU +on Linux and Windows on Intel integrated and discrete GPUs. Currently, a single GPU (`SYCL:0`, if available) and the CPU (`SYCL:1` if a GPU is available, else `SYCL:0`) are supported. @@ -30,7 +31,9 @@ and (optionally) SYCL runtime for your `Nvidia `_ GPU. For Python, the wheels will automatically install the DPC++ runtime package -(`dpcpp-cpp-rt`). Make sure to have the `correct drivers installed +(`dpcpp-cpp-rt`) into the same environment. On Windows, Open3D registers those +pip-installed DLL directories at import time (system-wide oneAPI runtimes are +not used). Make sure to have the `correct drivers installed `_ for your GPU. For raycasting on Intel GPUs, you will also need the `intel-level-zero-gpu-raytracing` package. @@ -48,6 +51,13 @@ raycasting on Intel GPUs, you will also need the - `Python 3.14 `__ - `C++ x86_64 `__ + * - Windows SYCL + - `Python 3.10 `__ + - `Python 3.11 `__ + - `Python 3.12 `__ + - `Python 3.13 `__ + - `Python 3.14 `__ + Usage ------ diff --git a/python/open3d/__init__.py b/python/open3d/__init__.py index a8922b64600..d5e94f27119 100644 --- a/python/open3d/__init__.py +++ b/python/open3d/__init__.py @@ -16,6 +16,7 @@ import os import sys import re +import site os.environ["KMP_DUPLICATE_LIB_OK"] = "True" # Enable thread composability manager to coordinate Intel OpenMP and TBB threads. Only works with Intel OpenMP. @@ -30,21 +31,27 @@ _added_dll_dirs = [] if sys.platform == "win32": # Unix: Use rpath to find libraries _win32_dll_dir = os.add_dll_directory(str(Path(__file__).parent)) - # For oneAPI / SYCL on Windows, add oneAPI redist directories to DLL search path if they exist - _oneapi_root = os.environ.get("ONEAPI_ROOT", r"C:\Program Files (x86)\Intel\oneAPI") - _oneapi_paths = [ - os.path.join(_oneapi_root, r"compiler\latest\windows\redist\intel64_win\compiler"), - os.path.join(_oneapi_root, r"compiler\latest\windows\bin"), - os.path.join(_oneapi_root, r"mkl\latest\bin\intel64"), - os.path.join(_oneapi_root, r"mkl\latest\bin"), - os.path.join(_oneapi_root, r"tbb\latest\bin\intel64\vc14"), - os.path.join(_oneapi_root, r"tbb\latest\redist\intel64\vc14"), - os.path.join(_oneapi_root, r"tbb\latest\redist\intel64_win\vc14"), - ] - for _p in _oneapi_paths: - if os.path.exists(_p): + # SYCL wheels depend on Intel DPC++ runtime packages (dpcpp-cpp-rt) installed + # in the same environment. Their DLLs live under site-packages/*.data/... + if _build_config["BUILD_SYCL_MODULE"]: + _intel_pip_dll_dirs = set() + _site_package_roots = [Path(_p) for _p in site.getsitepackages()] + _user_site = site.getusersitepackages() + if _user_site: + _site_package_roots.append(Path(_user_site)) + for _site_root in _site_package_roots: + if not _site_root.is_dir(): + continue + for _lib_bin in _site_root.glob("*.data/data/Library/bin"): + if not _lib_bin.is_dir(): + continue + _intel_pip_dll_dirs.add(_lib_bin) + for _child in _lib_bin.iterdir(): + if _child.is_dir(): + _intel_pip_dll_dirs.add(_child) + for _p in sorted(_intel_pip_dll_dirs): try: - _added_dll_dirs.append(os.add_dll_directory(_p)) + _added_dll_dirs.append(os.add_dll_directory(str(_p))) except Exception: pass @@ -131,7 +138,7 @@ __DEVICE_API__ = "xpu" except OSError as os_error: warnings.warn( - f"Open3D was built with SYCL support, but an error occurred while loading the Open3D SYCL Python bindings. Check your oneAPI installation. Falling back to the CPU pybind library. Reported error: {os_error}.", + f"Open3D was built with SYCL support, but an error occurred while loading the Open3D SYCL Python bindings. Ensure the DPC++ runtime (dpcpp-cpp-rt) is installed in this Python environment. Falling back to the CPU pybind library. Reported error: {os_error}.", ImportWarning, ) except StopIteration: From 8bb1d129fadccd2b9811b9f7aea420f23be3542b Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Tue, 16 Jun 2026 15:27:17 -0700 Subject: [PATCH 06/27] fix --- .github/workflows/windows.yml | 46 +++++++------------------ util/ci_install_oneapi_windows_sycl.ps1 | 27 +++++++++++++++ 2 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 util/ci_install_oneapi_windows_sycl.ps1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index eee46bc1a43..a91666dcdb5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -34,7 +34,9 @@ env: NPROC: 6 DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }} ONEAPI_MKL_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" - ONEAPI_COMPILER_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79e069e4-f844-43df-8d73-3674c024b043/intel-fortran-compiler-2025.3.1.15_offline.exe" + # Intel oneAPI DPC++/C++ Compiler 2025.3.1 offline (MSVC toolset). Not the Fortran compiler package. + # https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html + ONEAPI_COMPILER_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/efc6b239-2694-4938-bf45-3b8fb9f0c5b1/intel-dpcpp-cpp-2025.3.1.18_offline.exe" jobs: windows: @@ -98,22 +100,14 @@ jobs: echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append echo "$CUDA_PATH\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append + - name: Checkout source code + uses: actions/checkout@v4 + - name: Install Intel oneAPI if: ${{ matrix.device == 'xpu' }} shell: pwsh - run: | - $MKL_URL = "${{ env.ONEAPI_MKL_URL }}" - $COMPILER_URL = "${{ env.ONEAPI_COMPILER_URL }}" - Write-Host "Downloading oneMKL..." - Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" - Write-Host "Downloading Intel Compiler..." - Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" - Write-Host "Installing oneMKL..." - $p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru - if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } - Write-Host "Installing Intel Compiler..." - $p2 = Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru - if ($p2.ExitCode -ne 0) { throw "Intel Compiler installation failed with exit code $($p2.ExitCode)" } + working-directory: ${{ env.SRC_DIR }} + run: ./util/ci_install_oneapi_windows_sycl.ps1 - name: Install glslang via vcpkg run: | @@ -122,9 +116,6 @@ jobs: $glslangBinPath = Join-Path $env:VCPKG_INSTALLATION_ROOT "installed\x64-windows\tools\glslang" $glslangBinPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Checkout source code - uses: actions/checkout@v4 - - name: Set up Python version uses: actions/setup-python@v5 with: @@ -330,22 +321,14 @@ jobs: steps: + - name: Checkout source code + uses: actions/checkout@v4 + - name: Install Intel oneAPI if: ${{ matrix.device == 'xpu' }} shell: pwsh - run: | - $MKL_URL = "${{ env.ONEAPI_MKL_URL }}" - $COMPILER_URL = "${{ env.ONEAPI_COMPILER_URL }}" - Write-Host "Downloading oneMKL..." - Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" - Write-Host "Downloading Intel Compiler..." - Invoke-WebRequest -Uri $COMPILER_URL -OutFile "intel-fortran-compiler.exe" - Write-Host "Installing oneMKL..." - $p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru - if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } - Write-Host "Installing Intel Compiler..." - $p2 = Start-Process -FilePath ".\intel-fortran-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru - if ($p2.ExitCode -ne 0) { throw "Intel Compiler installation failed with exit code $($p2.ExitCode)" } + working-directory: ${{ env.SRC_DIR }} + run: ./util/ci_install_oneapi_windows_sycl.ps1 - name: Install glslang via vcpkg run: | @@ -354,9 +337,6 @@ jobs: $glslangBinPath = Join-Path $env:VCPKG_INSTALLATION_ROOT "installed\x64-windows\tools\glslang" $glslangBinPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Checkout source code - uses: actions/checkout@v4 - - name: Checkout Open3D-ML uses: actions/checkout@v4 with: diff --git a/util/ci_install_oneapi_windows_sycl.ps1 b/util/ci_install_oneapi_windows_sycl.ps1 new file mode 100644 index 00000000000..4ec834ab602 --- /dev/null +++ b/util/ci_install_oneapi_windows_sycl.ps1 @@ -0,0 +1,27 @@ +# Install oneMKL and Intel oneAPI DPC++/C++ Compiler for Windows SYCL (xpu) CI builds. +# Requires env ONEAPI_MKL_URL and ONEAPI_COMPILER_URL (DPC++/C++ offline installer, not Fortran). +# See https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html +$ErrorActionPreference = 'Stop' + +$MKL_URL = $env:ONEAPI_MKL_URL +$DPCPP_URL = $env:ONEAPI_COMPILER_URL +if (-not $MKL_URL -or -not $DPCPP_URL) { + throw "ONEAPI_MKL_URL and ONEAPI_COMPILER_URL must be set." +} + +Write-Host "Downloading oneMKL..." +Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" +Write-Host "Downloading Intel DPC++ Compiler..." +Invoke-WebRequest -Uri $DPCPP_URL -OutFile "intel-dpcpp-compiler.exe" +Write-Host "Installing oneMKL..." +$p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru +if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } +Write-Host "Installing Intel DPC++ Compiler..." +$p2 = Start-Process -FilePath ".\intel-dpcpp-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru +if ($p2.ExitCode -ne 0) { throw "Intel DPC++ Compiler installation failed with exit code $($p2.ExitCode)" } + +$toolsetProps = Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter "*Intel*oneAPI*Compiler*.props" -ErrorAction SilentlyContinue | Select-Object -First 1 +if (-not $toolsetProps) { + throw "Intel oneAPI DPC++ Visual Studio toolset was not installed correctly." +} +Write-Host "Found Intel DPC++ VS toolset: $($toolsetProps.FullName)" From c685dc67c36b0fab8e0ef5c9a4c0605b18776532 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Wed, 17 Jun 2026 10:13:31 -0700 Subject: [PATCH 07/27] fix install --- .github/workflows/windows.yml | 62 +++++++++++++---- 3rdparty/README_SYCL.md | 4 ++ util/ci_install_oneapi_windows_sycl.ps1 | 92 ++++++++++++++++++++----- 3 files changed, 129 insertions(+), 29 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a91666dcdb5..09bcccc873c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,10 +33,9 @@ env: BUILD_DIR: "C:\\Open3D\\build" NPROC: 6 DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }} - ONEAPI_MKL_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae472ff5-aa01-4a72-a452-ce7b559ef041/intel-onemkl-2025.3.1.10_offline.exe" - # Intel oneAPI DPC++/C++ Compiler 2025.3.1 offline (MSVC toolset). Not the Fortran compiler package. - # https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html - ONEAPI_COMPILER_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/efc6b239-2694-4938-bf45-3b8fb9f0c5b1/intel-dpcpp-cpp-2025.3.1.18_offline.exe" + # oneAPI 2025.3 offline webimages (oneapi-src/oneapi-ci @ 0804a4c9281440d8a91ac0680388b101e5f673ad) + ONEAPI_BASEKIT_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1f18901e-877d-469d-a41a-a10f11b39336/intel-oneapi-base-toolkit-2025.3.0.372_offline.exe" + ONEAPI_HPCKIT_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/3a871580-f839-46ed-aeae-685084127279/intel-oneapi-hpc-toolkit-2025.3.0.378_offline.exe" jobs: windows: @@ -45,18 +44,57 @@ jobs: runs-on: windows-2022 strategy: fail-fast: false + # Eight matrix legs (S=BUILD_SHARED_LIBS, R=STATIC_RUNTIME) plus build-wheel/test-wheel. + # Covers cpu/cuda/xpu once where needed; devel zips, viewer, SYCL, and /MD static smoke. matrix: - BUILD_SHARED_LIBS: [ON, OFF] - STATIC_RUNTIME: [ON, OFF] - device: [cpu, cuda, xpu] - CONFIG: [Release, Debug] - exclude: - - BUILD_SHARED_LIBS: ON + include: + # OFF/ON: static lib + /MT (WebRTC on Release); wheel-like linkage + - BUILD_SHARED_LIBS: OFF + STATIC_RUNTIME: ON + device: cpu + CONFIG: Release + + # Debug /MT, tests, import + - BUILD_SHARED_LIBS: OFF STATIC_RUNTIME: ON - - device: cuda + device: cpu CONFIG: Debug - - device: xpu + + # SYCL, oneAPI install, tests, import + - BUILD_SHARED_LIBS: OFF + STATIC_RUNTIME: ON + device: xpu + CONFIG: Release + + # Single Windows CUDA compile leg + - BUILD_SHARED_LIBS: OFF + STATIC_RUNTIME: ON + device: cuda + CONFIG: Release + + # ON/OFF: shared + /MD devel packages (cpu Debug -> *-dbg.zip) + - BUILD_SHARED_LIBS: ON + STATIC_RUNTIME: OFF + device: cpu + CONFIG: Release + + # Shared SYCL devel zip + - BUILD_SHARED_LIBS: ON + STATIC_RUNTIME: OFF + device: xpu + CONFIG: Release + + # open3d-devel-*-dbg.zip + - BUILD_SHARED_LIBS: ON + STATIC_RUNTIME: OFF + device: cpu CONFIG: Debug + + # OFF/OFF: static lib + /MD linkage smoke + - BUILD_SHARED_LIBS: OFF + STATIC_RUNTIME: OFF + device: cpu + CONFIG: Release env: BUILD_CUDA_MODULE: ${{ matrix.device == 'cuda' && 'ON' || 'OFF' }} BUILD_SYCL_MODULE: ${{ matrix.device == 'xpu' && 'ON' || 'OFF' }} diff --git a/3rdparty/README_SYCL.md b/3rdparty/README_SYCL.md index 30f148c133c..bb04db44011 100644 --- a/3rdparty/README_SYCL.md +++ b/3rdparty/README_SYCL.md @@ -104,6 +104,10 @@ packages into the same Python environment. On Linux, ``pybind`` RPATH finds ``/lib``; on Windows, ``open3d/__init__.py`` registers ``site-packages/*.data/data/Library/bin`` with ``add_dll_directory``. +Windows CI (xpu) installs build-time oneAPI from Intel Base + HPC webimages with +selective components only (``util/ci_install_oneapi_windows_sycl.ps1``, aligned +with `oneapi-ci `_). + User: - https://pypi.org/user/IntelAutomationEngineering/ diff --git a/util/ci_install_oneapi_windows_sycl.ps1 b/util/ci_install_oneapi_windows_sycl.ps1 index 4ec834ab602..72e045381fc 100644 --- a/util/ci_install_oneapi_windows_sycl.ps1 +++ b/util/ci_install_oneapi_windows_sycl.ps1 @@ -1,24 +1,82 @@ -# Install oneMKL and Intel oneAPI DPC++/C++ Compiler for Windows SYCL (xpu) CI builds. -# Requires env ONEAPI_MKL_URL and ONEAPI_COMPILER_URL (DPC++/C++ offline installer, not Fortran). -# See https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html +# Install Intel oneAPI C++ essentials for Windows SYCL (xpu) CI builds. +# Pattern from oneapi-src/oneapi-ci (2025.3.0 URLs @ 0804a4c): +# https://github.com/oneapi-src/oneapi-ci/tree/0804a4c9281440d8a91ac0680388b101e5f673ad +# +# Requires env ONEAPI_BASEKIT_URL, ONEAPI_HPCKIT_URL, and optional component lists. +# Open3D uses CMake -T "Intel(R) oneAPI DPC++ Compiler", so VS 2022 integration is enabled +# (oneapi-ci samples disable it because they invoke icx via setvars). $ErrorActionPreference = 'Stop' -$MKL_URL = $env:ONEAPI_MKL_URL -$DPCPP_URL = $env:ONEAPI_COMPILER_URL -if (-not $MKL_URL -or -not $DPCPP_URL) { - throw "ONEAPI_MKL_URL and ONEAPI_COMPILER_URL must be set." +function Install-OneApiWebimage { + param( + [Parameter(Mandatory = $true)][string]$Url, + [Parameter(Mandatory = $true)][string]$Components, + [Parameter(Mandatory = $true)][string]$Label + ) + $TempRoot = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { $env:TEMP } + $WorkDir = Join-Path $TempRoot "open3d_oneapi_$([guid]::NewGuid().ToString('N'))" + New-Item -ItemType Directory -Force -Path $WorkDir | Out-Null + Push-Location $WorkDir + try { + Write-Host "Downloading $Label webimage..." + curl.exe --output webimage.exe --url $Url --retry 5 --retry-delay 5 --fail + Write-Host "Extracting $Label..." + $ExtractProc = Start-Process -FilePath ".\webimage.exe" -ArgumentList @( + "-s", "-x", "-f", "webimage_extracted", "--log", "extract.log" + ) -Wait -PassThru -NoNewWindow + if ($ExtractProc.ExitCode -ne 0) { + throw "$Label webimage extract failed with exit code $($ExtractProc.ExitCode)" + } + Remove-Item webimage.exe -Force + $Bootstrapper = Join-Path $WorkDir "webimage_extracted\bootstrapper.exe" + if (-not (Test-Path $Bootstrapper)) { + throw "bootstrapper.exe not found after extracting $Label" + } + Write-Host "Installing $Label components: $Components" + $InstallArgs = @( + "-s", "--action", "install", + "--components=$Components", + "--eula=accept", + "-p=NEED_VS2017_INTEGRATION=0", + "-p=NEED_VS2019_INTEGRATION=0", + "-p=NEED_VS2022_INTEGRATION=1", + "--log-dir=$WorkDir" + ) + $InstallProc = Start-Process -FilePath $Bootstrapper -ArgumentList $InstallArgs -Wait -PassThru -NoNewWindow + if ($InstallProc.ExitCode -ne 0) { + throw "$Label bootstrapper install failed with exit code $($InstallProc.ExitCode)" + } + } finally { + Pop-Location + Remove-Item -Recurse -Force $WorkDir -ErrorAction SilentlyContinue + } } -Write-Host "Downloading oneMKL..." -Invoke-WebRequest -Uri $MKL_URL -OutFile "intel-onemkl.exe" -Write-Host "Downloading Intel DPC++ Compiler..." -Invoke-WebRequest -Uri $DPCPP_URL -OutFile "intel-dpcpp-compiler.exe" -Write-Host "Installing oneMKL..." -$p1 = Start-Process -FilePath ".\intel-onemkl.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru -if ($p1.ExitCode -ne 0) { throw "oneMKL installation failed with exit code $($p1.ExitCode)" } -Write-Host "Installing Intel DPC++ Compiler..." -$p2 = Start-Process -FilePath ".\intel-dpcpp-compiler.exe" -ArgumentList "-s -a --silent --eula accept" -Wait -PassThru -if ($p2.ExitCode -ne 0) { throw "Intel DPC++ Compiler installation failed with exit code $($p2.ExitCode)" } +$BaseUrl = $env:ONEAPI_BASEKIT_URL +$HpcUrl = $env:ONEAPI_HPCKIT_URL +if (-not $BaseUrl -or -not $HpcUrl) { + throw "ONEAPI_BASEKIT_URL and ONEAPI_HPCKIT_URL must be set." +} + +# Base kit: DPC++ compiler (+ runtime deps), oneTBB, oneDPL, IPP (see .gitlab-ci.yml component names). +$BaseComponents = $env:ONEAPI_WIN_BASE_COMPONENTS +if (-not $BaseComponents) { + $BaseComponents = @( + "intel.oneapi.win.dpcpp-compiler", + "intel.oneapi.win.tbb.devel", + "intel.oneapi.win.dpl.devel", + "intel.oneapi.win.ipp.devel" + ) -join "," +} + +# HPC kit: oneMKL only (SYCL build uses OPEN3D_USE_ONEAPI_PACKAGES / static MKL). +$HpcComponents = $env:ONEAPI_WIN_HPC_COMPONENTS +if (-not $HpcComponents) { + $HpcComponents = "intel.oneapi.win.mkl.devel" +} + +Install-OneApiWebimage -Url $BaseUrl -Components $BaseComponents -Label "oneAPI Base Toolkit" +Install-OneApiWebimage -Url $HpcUrl -Components $HpcComponents -Label "oneAPI HPC Toolkit" $toolsetProps = Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter "*Intel*oneAPI*Compiler*.props" -ErrorAction SilentlyContinue | Select-Object -First 1 if (-not $toolsetProps) { From e1e2359f1424ae3c645ef3228284771591e8b434 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Wed, 17 Jun 2026 10:59:13 -0700 Subject: [PATCH 08/27] fix component names --- util/ci_install_oneapi_windows_sycl.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/ci_install_oneapi_windows_sycl.ps1 b/util/ci_install_oneapi_windows_sycl.ps1 index 72e045381fc..88afedb2bcf 100644 --- a/util/ci_install_oneapi_windows_sycl.ps1 +++ b/util/ci_install_oneapi_windows_sycl.ps1 @@ -62,17 +62,17 @@ if (-not $BaseUrl -or -not $HpcUrl) { $BaseComponents = $env:ONEAPI_WIN_BASE_COMPONENTS if (-not $BaseComponents) { $BaseComponents = @( - "intel.oneapi.win.dpcpp-compiler", - "intel.oneapi.win.tbb.devel", - "intel.oneapi.win.dpl.devel", - "intel.oneapi.win.ipp.devel" + "intel.oneapi.win.dpcpp", + "intel.oneapi.win.tbb", + "intel.oneapi.win.dpl", + "intel.oneapi.win.ipp" ) -join "," } # HPC kit: oneMKL only (SYCL build uses OPEN3D_USE_ONEAPI_PACKAGES / static MKL). $HpcComponents = $env:ONEAPI_WIN_HPC_COMPONENTS if (-not $HpcComponents) { - $HpcComponents = "intel.oneapi.win.mkl.devel" + $HpcComponents = "intel.oneapi.win.mkl" } Install-OneApiWebimage -Url $BaseUrl -Components $BaseComponents -Label "oneAPI Base Toolkit" From a69ac2fb7909abcbc7f86c314f0b2fc239eb608b Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Wed, 17 Jun 2026 23:28:06 -0700 Subject: [PATCH 09/27] fix installer components --- .github/workflows/windows.yml | 6 +- util/ci_install_oneapi_windows_sycl.ps1 | 85 ------------------------- util/install_oneapi_windows.ps1 | 58 +++++++++++++++++ 3 files changed, 59 insertions(+), 90 deletions(-) delete mode 100644 util/ci_install_oneapi_windows_sycl.ps1 create mode 100644 util/install_oneapi_windows.ps1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 09bcccc873c..e78aa46a840 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -4,7 +4,6 @@ # - PyTorch Ops in debug mode - DLL initialization error while loading open3d_torch_ops.dll # - CUDA - Draw.exe does not run due to CUDA DLL path issues - name: Windows permissions: {} @@ -33,9 +32,6 @@ env: BUILD_DIR: "C:\\Open3D\\build" NPROC: 6 DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }} - # oneAPI 2025.3 offline webimages (oneapi-src/oneapi-ci @ 0804a4c9281440d8a91ac0680388b101e5f673ad) - ONEAPI_BASEKIT_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1f18901e-877d-469d-a41a-a10f11b39336/intel-oneapi-base-toolkit-2025.3.0.372_offline.exe" - ONEAPI_HPCKIT_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/3a871580-f839-46ed-aeae-685084127279/intel-oneapi-hpc-toolkit-2025.3.0.378_offline.exe" jobs: windows: @@ -145,7 +141,7 @@ jobs: if: ${{ matrix.device == 'xpu' }} shell: pwsh working-directory: ${{ env.SRC_DIR }} - run: ./util/ci_install_oneapi_windows_sycl.ps1 + run: ./util/install_oneapi_windows.ps1 - name: Install glslang via vcpkg run: | diff --git a/util/ci_install_oneapi_windows_sycl.ps1 b/util/ci_install_oneapi_windows_sycl.ps1 deleted file mode 100644 index 88afedb2bcf..00000000000 --- a/util/ci_install_oneapi_windows_sycl.ps1 +++ /dev/null @@ -1,85 +0,0 @@ -# Install Intel oneAPI C++ essentials for Windows SYCL (xpu) CI builds. -# Pattern from oneapi-src/oneapi-ci (2025.3.0 URLs @ 0804a4c): -# https://github.com/oneapi-src/oneapi-ci/tree/0804a4c9281440d8a91ac0680388b101e5f673ad -# -# Requires env ONEAPI_BASEKIT_URL, ONEAPI_HPCKIT_URL, and optional component lists. -# Open3D uses CMake -T "Intel(R) oneAPI DPC++ Compiler", so VS 2022 integration is enabled -# (oneapi-ci samples disable it because they invoke icx via setvars). -$ErrorActionPreference = 'Stop' - -function Install-OneApiWebimage { - param( - [Parameter(Mandatory = $true)][string]$Url, - [Parameter(Mandatory = $true)][string]$Components, - [Parameter(Mandatory = $true)][string]$Label - ) - $TempRoot = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { $env:TEMP } - $WorkDir = Join-Path $TempRoot "open3d_oneapi_$([guid]::NewGuid().ToString('N'))" - New-Item -ItemType Directory -Force -Path $WorkDir | Out-Null - Push-Location $WorkDir - try { - Write-Host "Downloading $Label webimage..." - curl.exe --output webimage.exe --url $Url --retry 5 --retry-delay 5 --fail - Write-Host "Extracting $Label..." - $ExtractProc = Start-Process -FilePath ".\webimage.exe" -ArgumentList @( - "-s", "-x", "-f", "webimage_extracted", "--log", "extract.log" - ) -Wait -PassThru -NoNewWindow - if ($ExtractProc.ExitCode -ne 0) { - throw "$Label webimage extract failed with exit code $($ExtractProc.ExitCode)" - } - Remove-Item webimage.exe -Force - $Bootstrapper = Join-Path $WorkDir "webimage_extracted\bootstrapper.exe" - if (-not (Test-Path $Bootstrapper)) { - throw "bootstrapper.exe not found after extracting $Label" - } - Write-Host "Installing $Label components: $Components" - $InstallArgs = @( - "-s", "--action", "install", - "--components=$Components", - "--eula=accept", - "-p=NEED_VS2017_INTEGRATION=0", - "-p=NEED_VS2019_INTEGRATION=0", - "-p=NEED_VS2022_INTEGRATION=1", - "--log-dir=$WorkDir" - ) - $InstallProc = Start-Process -FilePath $Bootstrapper -ArgumentList $InstallArgs -Wait -PassThru -NoNewWindow - if ($InstallProc.ExitCode -ne 0) { - throw "$Label bootstrapper install failed with exit code $($InstallProc.ExitCode)" - } - } finally { - Pop-Location - Remove-Item -Recurse -Force $WorkDir -ErrorAction SilentlyContinue - } -} - -$BaseUrl = $env:ONEAPI_BASEKIT_URL -$HpcUrl = $env:ONEAPI_HPCKIT_URL -if (-not $BaseUrl -or -not $HpcUrl) { - throw "ONEAPI_BASEKIT_URL and ONEAPI_HPCKIT_URL must be set." -} - -# Base kit: DPC++ compiler (+ runtime deps), oneTBB, oneDPL, IPP (see .gitlab-ci.yml component names). -$BaseComponents = $env:ONEAPI_WIN_BASE_COMPONENTS -if (-not $BaseComponents) { - $BaseComponents = @( - "intel.oneapi.win.dpcpp", - "intel.oneapi.win.tbb", - "intel.oneapi.win.dpl", - "intel.oneapi.win.ipp" - ) -join "," -} - -# HPC kit: oneMKL only (SYCL build uses OPEN3D_USE_ONEAPI_PACKAGES / static MKL). -$HpcComponents = $env:ONEAPI_WIN_HPC_COMPONENTS -if (-not $HpcComponents) { - $HpcComponents = "intel.oneapi.win.mkl" -} - -Install-OneApiWebimage -Url $BaseUrl -Components $BaseComponents -Label "oneAPI Base Toolkit" -Install-OneApiWebimage -Url $HpcUrl -Components $HpcComponents -Label "oneAPI HPC Toolkit" - -$toolsetProps = Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter "*Intel*oneAPI*Compiler*.props" -ErrorAction SilentlyContinue | Select-Object -First 1 -if (-not $toolsetProps) { - throw "Intel oneAPI DPC++ Visual Studio toolset was not installed correctly." -} -Write-Host "Found Intel DPC++ VS toolset: $($toolsetProps.FullName)" diff --git a/util/install_oneapi_windows.ps1 b/util/install_oneapi_windows.ps1 new file mode 100644 index 00000000000..c8e40d6b22c --- /dev/null +++ b/util/install_oneapi_windows.ps1 @@ -0,0 +1,58 @@ +#Requires -RunAsAdministrator +# Install Intel oneAPI C++ essentials for Windows SYCL (xpu) CI builds. +# Pattern from oneapi-src/oneapi-ci (2025.3.0 URLs @ 0804a4c): +# https://github.com/oneapi-src/oneapi-ci/tree/0804a4c9281440d8a91ac0680388b101e5f673ad +# +# Open3D uses CMake -T "Intel(R) oneAPI DPC++ Compiler", so VS 2022 integration is enabled +# (oneapi-ci samples disable it because they invoke icx via setvars). +$ErrorActionPreference = 'Stop' + +# oneAPI 2025.3 offline webimages (oneapi-src/oneapi-ci @ 0804a4c9281440d8a91ac0680388b101e5f673ad) +$ONEAPI_BASEKIT_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1f18901e-877d-469d-a41a-a10f11b39336/intel-oneapi-base-toolkit-2025.3.0.372.exe" + +# Default components: +$ONEAPI_WIN_BASE_COMPONENTS = @( + "intel.oneapi.win.cpp-dpcpp-common", + "intel.oneapi.win.tbb.devel", + "intel.oneapi.win.dpl", + "intel.oneapi.win.ipp.devel", + "intel.oneapi.win.mkl.devel" +) -join ":" + +$TempRoot = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { $env:TEMP } +$WorkDir = Join-Path $TempRoot "open3d_oneapi_$([guid]::NewGuid().ToString('N'))" +New-Item -ItemType Directory -Force -Path $WorkDir | Out-Null +Push-Location $WorkDir +try { + Write-Host "Downloading OneAPI webimage..." + curl.exe --output webimage.exe --url $ONEAPI_BASEKIT_URL --retry 5 --retry-delay 5 --fail + Write-Host "Extracting OneAPI webimage..." + $ExtractProc = Start-Process -FilePath ".\webimage.exe" -ArgumentList @( + "-s", "-x", "-f", "webimage_extracted", "--log", "extract.log" + ) -Wait -PassThru -NoNewWindow + Remove-Item webimage.exe -Force + $Bootstrapper = Join-Path $WorkDir "webimage_extracted\bootstrapper.exe" + if (-not (Test-Path $Bootstrapper)) { + throw "bootstrapper.exe not found after extracting OneAPI webimage" + } + Write-Host "Installing OneAPI components: $ONEAPI_WIN_BASE_COMPONENTS" + $InstallArgs = @( + "-s", "--action", "install", + "--components=$ONEAPI_WIN_BASE_COMPONENTS", + "--eula=accept", + "-p=NEED_VS2017_INTEGRATION=0", + "-p=NEED_VS2019_INTEGRATION=0", + "-p=NEED_VS2022_INTEGRATION=1", + "--log-dir=$WorkDir" + ) + $InstallProc = Start-Process -FilePath $Bootstrapper -ArgumentList $InstallArgs -Wait -PassThru -NoNewWindow +} finally { + Pop-Location + Remove-Item -Recurse -Force $WorkDir -ErrorAction SilentlyContinue +} + +$toolsetProps = Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter "*Intel*oneAPI*Compiler*.props" -ErrorAction SilentlyContinue | Select-Object -First 1 +if (-not $toolsetProps) { + throw "Intel oneAPI DPC++ Visual Studio toolset was not installed correctly." +} +Write-Host "Found Intel DPC++ VS toolset: $($toolsetProps.FullName)" From 256c855cfabb5df57e70dfefc032992132ae59f9 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Thu, 18 Jun 2026 12:39:37 -0700 Subject: [PATCH 10/27] fix --- .github/workflows/windows.yml | 6 +++--- util/install_oneapi_windows.ps1 | 8 +------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e78aa46a840..243cfe0c8cd 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -362,7 +362,7 @@ jobs: if: ${{ matrix.device == 'xpu' }} shell: pwsh working-directory: ${{ env.SRC_DIR }} - run: ./util/ci_install_oneapi_windows_sycl.ps1 + run: ./util/install_oneapi_windows.ps1 - name: Install glslang via vcpkg run: | @@ -468,7 +468,7 @@ jobs: fail-fast: false matrix: python_version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - device: [cpu, xpu] + device: [cpu, xpu, cuda] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -481,7 +481,7 @@ jobs: - is_main: false python_version: '3.13' env: - BUILD_PYTORCH_OPS: ${{ matrix.device == 'xpu' && 'OFF' || 'ON' }} + BUILD_PYTORCH_OPS: ${{ matrix.device == 'cpu' && 'ON' || 'OFF' }} steps: - name: Checkout source code uses: actions/checkout@v4 diff --git a/util/install_oneapi_windows.ps1 b/util/install_oneapi_windows.ps1 index c8e40d6b22c..663191efb3d 100644 --- a/util/install_oneapi_windows.ps1 +++ b/util/install_oneapi_windows.ps1 @@ -49,10 +49,4 @@ try { } finally { Pop-Location Remove-Item -Recurse -Force $WorkDir -ErrorAction SilentlyContinue -} - -$toolsetProps = Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter "*Intel*oneAPI*Compiler*.props" -ErrorAction SilentlyContinue | Select-Object -First 1 -if (-not $toolsetProps) { - throw "Intel oneAPI DPC++ Visual Studio toolset was not installed correctly." -} -Write-Host "Found Intel DPC++ VS toolset: $($toolsetProps.FullName)" +} \ No newline at end of file From bd426681246c8942f841f5effbabd69187a02674 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Thu, 18 Jun 2026 12:40:19 -0700 Subject: [PATCH 11/27] debug prints --- .github/workflows/windows.yml | 52 ++++++++++- util/install_oneapi_windows.ps1 | 46 ++++++++- util/print_oneapi_windows_paths.ps1 | 139 ++++++++++++++++++++++++++++ 3 files changed, 233 insertions(+), 4 deletions(-) create mode 100644 util/print_oneapi_windows_paths.ps1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 243cfe0c8cd..2e142fcd7aa 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,6 +14,10 @@ on: description: "Set to OFF for Release wheels" required: false default: "ON" + oneapi_cmake_debug: + description: "Verbose oneAPI path diagnostics and CMAKE_FIND_DEBUG_MODE on xpu legs" + required: false + default: "OFF" push: branches: @@ -32,6 +36,8 @@ env: BUILD_DIR: "C:\\Open3D\\build" NPROC: 6 DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }} + # workflow_dispatch oneapi_cmake_debug=ON enables -Verbose install logs and cmake --debug-find + OPEN3D_ONEAPI_DEBUG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.oneapi_cmake_debug == 'ON' && '1' || '0' }} jobs: windows: @@ -141,8 +147,18 @@ jobs: if: ${{ matrix.device == 'xpu' }} shell: pwsh working-directory: ${{ env.SRC_DIR }} + env: + OPEN3D_ONEAPI_DEBUG: ${{ env.OPEN3D_ONEAPI_DEBUG }} run: ./util/install_oneapi_windows.ps1 + - name: Debug oneAPI layout before CMake + if: ${{ matrix.device == 'xpu' }} + shell: pwsh + working-directory: ${{ env.SRC_DIR }} + env: + OPEN3D_ONEAPI_DEBUG: ${{ env.OPEN3D_ONEAPI_DEBUG }} + run: ./util/print_oneapi_windows_paths.ps1 + - name: Install glslang via vcpkg run: | vcpkg install glslang[tools]:x64-windows @@ -193,9 +209,20 @@ jobs: $OpenCL_Include = (Join-Path $OpenCLLibFile.Directory.Parent "include").Replace('\', '/') $CMAKE_ARGS += "-DOpenCL_LIBRARY=$OpenCL_Library" $CMAKE_ARGS += "-DOpenCL_INCLUDE_DIR=$OpenCL_Include" + Write-Host "OpenCL for CMake: LIB=$OpenCL_Library INC=$OpenCL_Include" + } else { + Write-Host "WARNING: OpenCL.lib not found under compiler\latest; find_package(OpenCL) may fail. Run util/print_oneapi_windows_paths.ps1 for search paths." + } + if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { + Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" + $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' } } - cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS ` + $cmakeExtraArgs = @() + if ($env:OPEN3D_ONEAPI_DEBUG -eq '1' -and '${{ matrix.device }}' -eq 'xpu') { + $cmakeExtraArgs += '--debug-find' + } + cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS @cmakeExtraArgs ` -DDEVELOPER_BUILD=$Env:DEVELOPER_BUILD ` -DBUILD_EXAMPLES=OFF ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` @@ -362,8 +389,18 @@ jobs: if: ${{ matrix.device == 'xpu' }} shell: pwsh working-directory: ${{ env.SRC_DIR }} + env: + OPEN3D_ONEAPI_DEBUG: ${{ env.OPEN3D_ONEAPI_DEBUG }} run: ./util/install_oneapi_windows.ps1 + - name: Debug oneAPI layout before CMake + if: ${{ matrix.device == 'xpu' }} + shell: pwsh + working-directory: ${{ env.SRC_DIR }} + env: + OPEN3D_ONEAPI_DEBUG: ${{ env.OPEN3D_ONEAPI_DEBUG }} + run: ./util/print_oneapi_windows_paths.ps1 + - name: Install glslang via vcpkg run: | vcpkg install glslang[tools]:x64-windows @@ -417,9 +454,20 @@ jobs: $OpenCL_Include = (Join-Path $OpenCLLibFile.Directory.Parent "include").Replace('\', '/') $CMAKE_ARGS += "-DOpenCL_LIBRARY=$OpenCL_Library" $CMAKE_ARGS += "-DOpenCL_INCLUDE_DIR=$OpenCL_Include" + Write-Host "OpenCL for CMake: LIB=$OpenCL_Library INC=$OpenCL_Include" + } else { + Write-Host "WARNING: OpenCL.lib not found under compiler\latest; find_package(OpenCL) may fail. Run util/print_oneapi_windows_paths.ps1 for search paths." + } + if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { + Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" + $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' } } - cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS ` + $cmakeExtraArgs = @() + if ($env:OPEN3D_ONEAPI_DEBUG -eq '1' -and '${{ matrix.device }}' -eq 'xpu') { + $cmakeExtraArgs += '--debug-find' + } + cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS @cmakeExtraArgs ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DDEVELOPER_BUILD="$Env:DEVELOPER_BUILD" ` -DBUILD_SHARED_LIBS=OFF ` diff --git a/util/install_oneapi_windows.ps1 b/util/install_oneapi_windows.ps1 index 663191efb3d..53f64ba1641 100644 --- a/util/install_oneapi_windows.ps1 +++ b/util/install_oneapi_windows.ps1 @@ -5,12 +5,19 @@ # # Open3D uses CMake -T "Intel(R) oneAPI DPC++ Compiler", so VS 2022 integration is enabled # (oneapi-ci samples disable it because they invoke icx via setvars). +param( + [switch]$Verbose +) + $ErrorActionPreference = 'Stop' +if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { + $Verbose = $true +} # oneAPI 2025.3 offline webimages (oneapi-src/oneapi-ci @ 0804a4c9281440d8a91ac0680388b101e5f673ad) $ONEAPI_BASEKIT_URL = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1f18901e-877d-469d-a41a-a10f11b39336/intel-oneapi-base-toolkit-2025.3.0.372.exe" -# Default components: +# Default components: $ONEAPI_WIN_BASE_COMPONENTS = @( "intel.oneapi.win.cpp-dpcpp-common", "intel.oneapi.win.tbb.devel", @@ -19,9 +26,14 @@ $ONEAPI_WIN_BASE_COMPONENTS = @( "intel.oneapi.win.mkl.devel" ) -join ":" +$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +$PrintPathsScript = Join-Path $ScriptDir 'print_oneapi_windows_paths.ps1' + $TempRoot = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { $env:TEMP } $WorkDir = Join-Path $TempRoot "open3d_oneapi_$([guid]::NewGuid().ToString('N'))" +$InstallLogArchive = Join-Path $TempRoot 'open3d_oneapi_install_logs' New-Item -ItemType Directory -Force -Path $WorkDir | Out-Null +$InstallExitCode = 0 Push-Location $WorkDir try { Write-Host "Downloading OneAPI webimage..." @@ -30,12 +42,19 @@ try { $ExtractProc = Start-Process -FilePath ".\webimage.exe" -ArgumentList @( "-s", "-x", "-f", "webimage_extracted", "--log", "extract.log" ) -Wait -PassThru -NoNewWindow + if ($ExtractProc.ExitCode -ne 0) { + throw "OneAPI webimage extract failed with exit code $($ExtractProc.ExitCode)" + } Remove-Item webimage.exe -Force $Bootstrapper = Join-Path $WorkDir "webimage_extracted\bootstrapper.exe" if (-not (Test-Path $Bootstrapper)) { throw "bootstrapper.exe not found after extracting OneAPI webimage" } Write-Host "Installing OneAPI components: $ONEAPI_WIN_BASE_COMPONENTS" + if ($Verbose) { + Write-Host "Install work dir: $WorkDir" + Write-Host "NEED_VS2022_INTEGRATION=1 (required for cmake -T Intel DPC++ toolset)" + } $InstallArgs = @( "-s", "--action", "install", "--components=$ONEAPI_WIN_BASE_COMPONENTS", @@ -46,7 +65,30 @@ try { "--log-dir=$WorkDir" ) $InstallProc = Start-Process -FilePath $Bootstrapper -ArgumentList $InstallArgs -Wait -PassThru -NoNewWindow + $InstallExitCode = $InstallProc.ExitCode + if ($InstallExitCode -ne 0) { + throw "OneAPI bootstrapper install failed with exit code $InstallExitCode" + } } finally { + if ($Verbose -or $InstallExitCode -ne 0) { + if (Test-Path -LiteralPath $WorkDir) { + Write-Host "Archiving installer logs to $InstallLogArchive" + New-Item -ItemType Directory -Force -Path $InstallLogArchive | Out-Null + Copy-Item -Path (Join-Path $WorkDir '*') -Destination $InstallLogArchive -Recurse -Force -ErrorAction SilentlyContinue + Write-Host "See extract.log and installer logs under: $InstallLogArchive" + } + } Pop-Location Remove-Item -Recurse -Force $WorkDir -ErrorAction SilentlyContinue -} \ No newline at end of file +} + +Write-Host "OneAPI bootstrapper reported success (exit code 0)." +if (Test-Path -LiteralPath $PrintPathsScript) { + if ($Verbose) { + & $PrintPathsScript -Verbose + } else { + & $PrintPathsScript + } +} else { + Write-Warning "Missing $PrintPathsScript" +} diff --git a/util/print_oneapi_windows_paths.ps1 b/util/print_oneapi_windows_paths.ps1 new file mode 100644 index 00000000000..af269a57967 --- /dev/null +++ b/util/print_oneapi_windows_paths.ps1 @@ -0,0 +1,139 @@ +# Print Intel oneAPI layout and CMake-related paths on Windows (CI debugging). +# Usage: ./util/print_oneapi_windows_paths.ps1 [-Verbose] +# Env: OPEN3D_ONEAPI_DEBUG=1 enables extra detail (same as -Verbose). +param( + [switch]$Verbose +) + +$ErrorActionPreference = 'Continue' +if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { + $Verbose = $true +} + +function Write-Section($Title) { + Write-Host "" + Write-Host "========== $Title ==========" +} + +function Test-PathReport($Label, $Path) { + $exists = Test-Path -LiteralPath $Path + $mark = if ($exists) { '[OK]' } else { '[MISSING]' } + Write-Host "$mark $Label" + Write-Host " $Path" + return $exists +} + +function Find-FirstFile($Roots, $Pattern) { + foreach ($root in $Roots) { + if (-not (Test-Path -LiteralPath $root)) { continue } + $hit = Get-ChildItem -LiteralPath $root -Recurse -Filter $Pattern -ErrorAction SilentlyContinue | + Select-Object -First 1 + if ($hit) { return $hit } + } + return $null +} + +$OneApiRoot = 'C:\Program Files (x86)\Intel\oneAPI' +$MklCmakeDir = Join-Path $OneApiRoot 'mkl\latest\lib\cmake\mkl' +$TbbRoot = Join-Path $OneApiRoot 'tbb\latest' +$CompilerLatest = Join-Path $OneApiRoot 'compiler\latest' + +Write-Section 'oneAPI environment variables' +foreach ($name in @( + 'ONEAPI_ROOT', 'MKLROOT', 'TBBROOT', 'CMPLR_ROOT', 'DPL_ROOT', 'IPP_ROOT', + 'CMAKE_PREFIX_PATH', 'PATH' + )) { + $val = [Environment]::GetEnvironmentVariable($name, 'Process') + if (-not $val) { $val = [Environment]::GetEnvironmentVariable($name, 'Machine') } + if (-not $val) { $val = [Environment]::GetEnvironmentVariable($name, 'User') } + if ($name -eq 'PATH' -and $val) { + Write-Host "${name}: (length $($val.Length); use -Verbose for Intel entries)" + if ($Verbose) { + $val -split ';' | Where-Object { $_ -match 'Intel|oneAPI|icx' } | ForEach-Object { Write-Host " $_" } + } + } elseif ($val) { + Write-Host "${name}=$val" + } else { + Write-Host "${name}=" + } +} + +Write-Section 'oneAPI install tree (Open3D SYCL expectations)' +Test-PathReport 'oneAPI root' $OneApiRoot | Out-Null +Test-PathReport 'MKLConfig.cmake dir' $MklCmakeDir | Out-Null +Test-PathReport 'TBB package root (CMAKE_PREFIX_PATH)' $TbbRoot | Out-Null +Test-PathReport 'DPC++ compiler latest symlink' $CompilerLatest | Out-Null + +$mklConfig = Join-Path $MklCmakeDir 'MKLConfig.cmake' +Test-PathReport 'MKLConfig.cmake' $mklConfig | Out-Null +$tbbConfig = Join-Path $TbbRoot 'lib\cmake\tbb\TBBConfig.cmake' +Test-PathReport 'TBBConfig.cmake' $tbbConfig | Out-Null + +$icx = Join-Path $CompilerLatest 'bin\icx.exe' +Test-PathReport 'icx.exe' $icx | Out-Null + +Write-Section 'OpenCL (Windows SYCL / mkl_sycl link)' +$openClLib = Find-FirstFile @($CompilerLatest) 'OpenCL.lib' +if ($openClLib) { + Write-Host '[OK] OpenCL.lib' + Write-Host " $($openClLib.FullName)" + $incCandidate = Join-Path $openClLib.Directory.Parent.FullName 'include' + Test-PathReport 'OpenCL include (parent/include)' $incCandidate | Out-Null +} else { + Write-Host '[MISSING] OpenCL.lib under compiler\latest' + Write-Host " Search root: $CompilerLatest" +} + +Write-Section 'Visual Studio Intel DPC++ platform toolset (cmake -T)' +$vsRoots = @( + Join-Path $env:ProgramFiles 'Microsoft Visual Studio' + Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio' +) +$toolsetProps = $null +foreach ($vsRoot in $vsRoots) { + if (-not (Test-Path -LiteralPath $vsRoot)) { continue } + $toolsetProps = Get-ChildItem -LiteralPath $vsRoot -Recurse -ErrorAction SilentlyContinue | + Where-Object { + $_.Name -eq 'Toolset.props' -and + $_.FullName -match '\\PlatformToolsets\\Intel\(R\) oneAPI DPC\+\+ Compiler\\' + } | + Select-Object -First 1 + if ($toolsetProps) { break } +} +if ($toolsetProps) { + Write-Host '[OK] Intel(R) oneAPI DPC++ Compiler Toolset.props' + Write-Host " $($toolsetProps.FullName)" +} else { + Write-Host '[MISSING] Platform toolset Toolset.props (CMake -T may fail at build with MSB8020)' + foreach ($vsRoot in $vsRoots) { + Write-Host " Searched under: $vsRoot" + } +} + +Write-Section 'Suggested CMake configure hints (windows.yml xpu legs)' +Write-Host '-T "Intel(R) oneAPI DPC++ Compiler"' +Write-Host "-DCMAKE_PREFIX_PATH=$MklCmakeDir;$TbbRoot" +if ($openClLib) { + $oclLib = $openClLib.FullName.Replace('\', '/') + $oclInc = (Join-Path $openClLib.Directory.Parent.FullName 'include').Replace('\', '/') + Write-Host "-DOpenCL_LIBRARY=$oclLib" + Write-Host "-DOpenCL_INCLUDE_DIR=$oclInc" +} else { + Write-Host '-DOpenCL_LIBRARY=' +} + +if ($Verbose) { + Write-Section 'Directory listing (verbose)' + foreach ($sub in @('compiler', 'mkl', 'tbb', 'dpl', 'ipp')) { + $p = Join-Path $OneApiRoot $sub + if (Test-Path -LiteralPath $p) { + Write-Host "--- $p ---" + Get-ChildItem -LiteralPath $p -ErrorAction SilentlyContinue | ForEach-Object { Write-Host " $($_.Name)" } + } + } +} + +Write-Section 'setvars (optional alternative to CMAKE_PREFIX_PATH)' +$setvars = Join-Path $OneApiRoot 'setvars-vcvarsall.bat' +Test-PathReport 'setvars-vcvarsall.bat' $setvars | Out-Null +Write-Host 'Local builds often run: cmd /c "setvars-vcvarsall.bat" vs2022 before cmake.' From 8c4b84439b7af8ab971b9f7a3b9f69d13e075e43 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Thu, 18 Jun 2026 22:49:41 -0700 Subject: [PATCH 12/27] fix oneapi install, setup. --- .github/workflows/windows.yml | 60 +++++++++++++++++++-------------- util/install_oneapi_windows.ps1 | 4 +-- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2e142fcd7aa..2f5403b2802 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -201,18 +201,17 @@ jobs: cmake --version $CMAKE_ARGS = @() if ('${{ matrix.device }}' -eq 'xpu') { - $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' - $CMAKE_ARGS += '-DCMAKE_PREFIX_PATH=C:\Program Files (x86)\Intel\oneAPI\mkl\latest\lib\cmake\mkl;C:\Program Files (x86)\Intel\oneAPI\tbb\latest' - $OpenCLLibFile = Get-ChildItem -Path "C:\Program Files (x86)\Intel\oneAPI\compiler\latest" -Filter "OpenCL.lib" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 - if ($OpenCLLibFile) { - $OpenCL_Library = $OpenCLLibFile.FullName.Replace('\', '/') - $OpenCL_Include = (Join-Path $OpenCLLibFile.Directory.Parent "include").Replace('\', '/') - $CMAKE_ARGS += "-DOpenCL_LIBRARY=$OpenCL_Library" - $CMAKE_ARGS += "-DOpenCL_INCLUDE_DIR=$OpenCL_Include" - Write-Host "OpenCL for CMake: LIB=$OpenCL_Library INC=$OpenCL_Include" - } else { - Write-Host "WARNING: OpenCL.lib not found under compiler\latest; find_package(OpenCL) may fail. Run util/print_oneapi_windows_paths.ps1 for search paths." + # Runs setvars.bat via cmd and imports + # all resulting env vars into the current PowerShell process. + Write-Host "Initializing oneAPI environment via setvars.bat..." + $setOutput = cmd /c '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && set 2>&1' + if ($LASTEXITCODE -ne 0) { throw "setvars.bat failed (exit $LASTEXITCODE)" } + $setOutput | ForEach-Object { + if ($_ -match '^([^=]+)=(.*)$') { + [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) + } } + $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' @@ -320,6 +319,17 @@ jobs: cd build $CMAKE_ARGS = @() if ('${{ matrix.device }}' -eq 'xpu') { + # Initialize oneAPI environment in the same step as cmake (env vars + # don't persist across steps). Runs setvars.bat via cmd and imports + # all resulting env vars into the current PowerShell process. + Write-Host "Initializing oneAPI environment via setvars.bat..." + $setOutput = cmd /c '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && set 2>&1' + if ($LASTEXITCODE -ne 0) { throw "setvars.bat failed (exit $LASTEXITCODE)" } + $setOutput | ForEach-Object { + if ($_ -match '^([^=]+)=(.*)$') { + [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) + } + } $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' } cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS ` @@ -435,29 +445,29 @@ jobs: python -m pip install -U -r open3d_ml/requirements-torch.txt } - - name: Config + # Move build directory to C: https://github.com/actions/virtual-environments/issues/1341 run: | $ErrorActionPreference = 'Stop' - New-Item -Path ${{ env.BUILD_DIR }} -ItemType Directory - cd ${{ env.BUILD_DIR }} + New-Item -Path '${{ env.BUILD_DIR }}' -ItemType Directory + cd '${{ env.BUILD_DIR }}' if ($Env:DEVELOPER_BUILD -ne "OFF") { $Env:DEVELOPER_BUILD = "ON" } + cmake --version $CMAKE_ARGS = @() if ('${{ matrix.device }}' -eq 'xpu') { - $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' - $CMAKE_ARGS += '-DCMAKE_PREFIX_PATH=C:\Program Files (x86)\Intel\oneAPI\mkl\latest\lib\cmake\mkl;C:\Program Files (x86)\Intel\oneAPI\tbb\latest' - $OpenCLLibFile = Get-ChildItem -Path "C:\Program Files (x86)\Intel\oneAPI\compiler\latest" -Filter "OpenCL.lib" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 - if ($OpenCLLibFile) { - $OpenCL_Library = $OpenCLLibFile.FullName.Replace('\', '/') - $OpenCL_Include = (Join-Path $OpenCLLibFile.Directory.Parent "include").Replace('\', '/') - $CMAKE_ARGS += "-DOpenCL_LIBRARY=$OpenCL_Library" - $CMAKE_ARGS += "-DOpenCL_INCLUDE_DIR=$OpenCL_Include" - Write-Host "OpenCL for CMake: LIB=$OpenCL_Library INC=$OpenCL_Include" - } else { - Write-Host "WARNING: OpenCL.lib not found under compiler\latest; find_package(OpenCL) may fail. Run util/print_oneapi_windows_paths.ps1 for search paths." + # Runs setvars.bat via cmd and imports + # all resulting env vars into the current PowerShell process. + Write-Host "Initializing oneAPI environment via setvars.bat..." + $setOutput = cmd /c '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && set 2>&1' + if ($LASTEXITCODE -ne 0) { throw "setvars.bat failed (exit $LASTEXITCODE)" } + $setOutput | ForEach-Object { + if ($_ -match '^([^=]+)=(.*)$') { + [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) + } } + $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' diff --git a/util/install_oneapi_windows.ps1 b/util/install_oneapi_windows.ps1 index 53f64ba1641..9f0874be66b 100644 --- a/util/install_oneapi_windows.ps1 +++ b/util/install_oneapi_windows.ps1 @@ -3,8 +3,8 @@ # Pattern from oneapi-src/oneapi-ci (2025.3.0 URLs @ 0804a4c): # https://github.com/oneapi-src/oneapi-ci/tree/0804a4c9281440d8a91ac0680388b101e5f673ad # -# Open3D uses CMake -T "Intel(R) oneAPI DPC++ Compiler", so VS 2022 integration is enabled -# (oneapi-ci samples disable it because they invoke icx via setvars). +# Open3D uses the setvars.bat script to set up the oneAPI environment for icx compiler. +# VS 2022 integration is enabled for cmake -T Intel DPC++ toolset support. param( [switch]$Verbose ) From 174be2ac4073e443df2d43d57dfe7c7028531148 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Fri, 19 Jun 2026 23:22:43 -0700 Subject: [PATCH 13/27] fix cmake + oneapi setup --- .github/workflows/windows.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2f5403b2802..78561e6c0b4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -211,17 +211,22 @@ jobs: [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) } } - $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' + $CMAKE_GENERATOR = "Ninja Multi-Config" + $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` + "-DCMAKE_CONFIGURATION_TYPES=${{ matrix.CONFIG }}" if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' } + } else { + $CMAKE_GENERATOR = "Visual Studio 17 2022" + $CMAKE_ARGS += "-A", "x64" } $cmakeExtraArgs = @() if ($env:OPEN3D_ONEAPI_DEBUG -eq '1' -and '${{ matrix.device }}' -eq 'xpu') { $cmakeExtraArgs += '--debug-find' } - cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS @cmakeExtraArgs ` + cmake -G $CMAKE_GENERATOR @CMAKE_ARGS @cmakeExtraArgs ` -DDEVELOPER_BUILD=$Env:DEVELOPER_BUILD ` -DBUILD_EXAMPLES=OFF ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` @@ -330,9 +335,14 @@ jobs: [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) } } - $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' + $CMAKE_GENERATOR = "Ninja Multi-Config" + $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` + "-DCMAKE_CONFIGURATION_TYPES=${{ matrix.CONFIG }}" + } else { + $CMAKE_GENERATOR = "Visual Studio 17 2022" + $CMAKE_ARGS += "-A", "x64" } - cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS ` + cmake -G $CMAKE_GENERATOR @CMAKE_ARGS ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DSTATIC_WINDOWS_RUNTIME=${{ matrix.STATIC_RUNTIME }} ` .. @@ -467,17 +477,22 @@ jobs: [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) } } - $CMAKE_ARGS += '-T', 'Intel(R) oneAPI DPC++ Compiler' + $CMAKE_GENERATOR = "Ninja Multi-Config" + $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` + "-DCMAKE_CONFIGURATION_TYPES=Release" if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' } + } else { + $CMAKE_GENERATOR = "Visual Studio 17 2022" + $CMAKE_ARGS += "-A", "x64" } $cmakeExtraArgs = @() if ($env:OPEN3D_ONEAPI_DEBUG -eq '1' -and '${{ matrix.device }}' -eq 'xpu') { $cmakeExtraArgs += '--debug-find' } - cmake -G "Visual Studio 17 2022" -A x64 @CMAKE_ARGS @cmakeExtraArgs ` + cmake -G $CMAKE_GENERATOR @CMAKE_ARGS @cmakeExtraArgs ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DDEVELOPER_BUILD="$Env:DEVELOPER_BUILD" ` -DBUILD_SHARED_LIBS=OFF ` From 15b66dde7e21235918fee0f60ea111072760a838 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Sat, 20 Jun 2026 00:06:48 -0700 Subject: [PATCH 14/27] fix 2 --- .github/workflows/windows.yml | 53 ++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 78561e6c0b4..20a74ce64ec 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -211,9 +211,9 @@ jobs: [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) } } - $CMAKE_GENERATOR = "Ninja Multi-Config" + $CMAKE_GENERATOR = "Ninja" $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` - "-DCMAKE_CONFIGURATION_TYPES=${{ matrix.CONFIG }}" + "-DCMAKE_BUILD_TYPE=${{ matrix.CONFIG }}" if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' @@ -245,18 +245,23 @@ jobs: working-directory: ${{ env.BUILD_DIR }} run: | $ErrorActionPreference = 'Stop' - cmake --build . --parallel ${{ env.NPROC }} --config ${{ matrix.CONFIG }} ` - --target build-examples-iteratively - cmake --build . --parallel ${{ env.NPROC }} --config ${{ matrix.CONFIG }} ` - --target INSTALL + $buildArgs = @("--build", ".", "--parallel", "${{ env.NPROC }}") + if ('${{ matrix.device }}' -ne 'xpu') { + $buildArgs += "--config", "${{ matrix.CONFIG }}" + } + cmake @buildArgs --target build-examples-iteratively + cmake @buildArgs --target INSTALL - name: Package working-directory: ${{ env.BUILD_DIR }} if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' && matrix.device != 'cuda' }} run: | $ErrorActionPreference = 'Stop' - cmake --build . --parallel ${{ env.NPROC }} --config ${{ matrix.CONFIG }} ` - --target package + $buildArgs = @("--build", ".", "--parallel", "${{ env.NPROC }}") + if ('${{ matrix.device }}' -ne 'xpu') { + $buildArgs += "--config", "${{ matrix.CONFIG }}" + } + cmake @buildArgs --target package if ("${{ matrix.CONFIG }}" -eq "Debug") { Get-ChildItem package/open3d-devel-*.zip | Rename-Item -NewName ` {$_.name -Replace '.zip','-dbg.zip'} @@ -315,7 +320,8 @@ jobs: working-directory: ${{ env.BUILD_DIR }} run: | echo "Add --gtest_random_seed=SEED to the test command to repeat this test sequence." - .\bin\${{ matrix.CONFIG }}\tests.exe --gtest_shuffle --gtest_filter=-*ReduceSum64bit2DCase0*:*ReduceSum64bit2DCase3* + $testExe = if ('${{ matrix.device }}' -eq 'xpu') { ".\bin\tests.exe" } else { ".\bin\${{ matrix.CONFIG }}\tests.exe" } + & $testExe --gtest_shuffle --gtest_filter=-*ReduceSum64bit2DCase0*:*ReduceSum64bit2DCase3* - name: Linking to Open3D working-directory: ${{ env.SRC_DIR }}/examples/cmake/open3d-cmake-find-package run: | @@ -335,9 +341,9 @@ jobs: [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) } } - $CMAKE_GENERATOR = "Ninja Multi-Config" + $CMAKE_GENERATOR = "Ninja" $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` - "-DCMAKE_CONFIGURATION_TYPES=${{ matrix.CONFIG }}" + "-DCMAKE_BUILD_TYPE=${{ matrix.CONFIG }}" } else { $CMAKE_GENERATOR = "Visual Studio 17 2022" $CMAKE_ARGS += "-A", "x64" @@ -346,9 +352,14 @@ jobs: -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DSTATIC_WINDOWS_RUNTIME=${{ matrix.STATIC_RUNTIME }} ` .. - cmake --build . --config ${{ matrix.CONFIG }} + $buildArgs = @("--build", ".") + if ('${{ matrix.device }}' -ne 'xpu') { + $buildArgs += "--config", "${{ matrix.CONFIG }}" + } + cmake @buildArgs if ( '${{ matrix.device }}' -ne 'cuda' ) { # FIXME - .\${{ matrix.CONFIG }}\Draw.exe --skip-for-unit-test + $drawExe = if ('${{ matrix.device }}' -eq 'xpu') { ".\Draw.exe" } else { ".\${{ matrix.CONFIG }}\Draw.exe" } + & $drawExe --skip-for-unit-test } Remove-Item "C:\Program Files\Open3D" -Recurse - name: Install Open3D python build requirements @@ -361,7 +372,11 @@ jobs: working-directory: ${{ env.BUILD_DIR }} run: | $ErrorActionPreference = 'Stop' - cmake --build . --config ${{ matrix.CONFIG }} --target install-pip-package + $buildArgs = @("--build", ".", "--target", "install-pip-package") + if ('${{ matrix.device }}' -ne 'xpu') { + $buildArgs += "--config", "${{ matrix.CONFIG }}" + } + cmake @buildArgs - name: Import python package # If BUILD_SHARED_LIBS == ON, Open3D.dll needs to be copied, which is not recommended for python. if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.device != 'cuda' }} # FIXME @@ -477,9 +492,9 @@ jobs: [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) } } - $CMAKE_GENERATOR = "Ninja Multi-Config" + $CMAKE_GENERATOR = "Ninja" $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` - "-DCMAKE_CONFIGURATION_TYPES=Release" + "-DCMAKE_BUILD_TYPE=Release" if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" $CMAKE_ARGS += '-DCMAKE_FIND_DEBUG_MODE=ON' @@ -511,7 +526,11 @@ jobs: working-directory: ${{ env.BUILD_DIR }} run: | $ErrorActionPreference = 'Stop' - cmake --build . --parallel ${{ env.NPROC }} --config Release --target pip-package + $buildArgs = @("--build", ".", "--parallel", "${{ env.NPROC }}", "--target", "pip-package") + if ('${{ matrix.device }}' -ne 'xpu') { + $buildArgs += "--config", "Release" + } + cmake @buildArgs $PIP_PKG_NAME=(Get-ChildItem lib/python_package/pip_package/open3d*.whl).Name echo "PIP_PKG_NAME=$PIP_PKG_NAME" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append From b21187617706e410dd11e8924d828e1cda2ab45d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 18:50:54 +0000 Subject: [PATCH 15/27] Fix Windows xpu CI: use icx (MSVC-compatible) instead of icpx for CXX 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). --- .github/workflows/windows.yml | 13 ++++++++++--- 3rdparty/embree/embree.cmake | 9 ++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 20a74ce64ec..6ea372f5562 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -212,7 +212,10 @@ jobs: } } $CMAKE_GENERATOR = "Ninja" - $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` + # On Windows, icx.exe (MSVC-compatible) handles C++ and SYCL (-fsycl). + # icpx.exe identifies as GNU-like in oneAPI 2025.3+ which conflicts with + # CMake generating MSVC-style flags when C compiler (icx) is MSVC-like. + $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icx", ` "-DCMAKE_BUILD_TYPE=${{ matrix.CONFIG }}" if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" @@ -342,7 +345,9 @@ jobs: } } $CMAKE_GENERATOR = "Ninja" - $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` + # On Windows, icx.exe (MSVC-compatible) handles C++ and SYCL (-fsycl). + # See Config step for the reason icpx is not used. + $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icx", ` "-DCMAKE_BUILD_TYPE=${{ matrix.CONFIG }}" } else { $CMAKE_GENERATOR = "Visual Studio 17 2022" @@ -493,7 +498,9 @@ jobs: } } $CMAKE_GENERATOR = "Ninja" - $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icpx", ` + # On Windows, icx.exe (MSVC-compatible) handles C++ and SYCL (-fsycl). + # See Config step for the reason icpx is not used. + $CMAKE_ARGS += "-DCMAKE_C_COMPILER=icx", "-DCMAKE_CXX_COMPILER=icx", ` "-DCMAKE_BUILD_TYPE=Release" if ($env:OPEN3D_ONEAPI_DEBUG -eq '1') { Write-Host "OPEN3D_ONEAPI_DEBUG=1: enabling CMAKE_FIND_DEBUG_MODE and cmake --debug-find" diff --git a/3rdparty/embree/embree.cmake b/3rdparty/embree/embree.cmake index 36df1b1db6b..865bbbdf083 100644 --- a/3rdparty/embree/embree.cmake +++ b/3rdparty/embree/embree.cmake @@ -65,7 +65,14 @@ endif() if(BUILD_SYCL_MODULE) - set(ISA_ARGS ${ISA_ARGS} -DCMAKE_CXX_COMPILER=icpx) + # On Windows, icx.exe (MSVC-compatible) handles C++ and SYCL (-fsycl). + # icpx.exe (GNU-like in oneAPI 2025.3+) conflicts with MSVC-style flags + # generated by CMake when using Ninja on Windows. + if(WIN32) + set(ISA_ARGS ${ISA_ARGS} -DCMAKE_CXX_COMPILER=icx) + else() + set(ISA_ARGS ${ISA_ARGS} -DCMAKE_CXX_COMPILER=icpx) + endif() set(ISA_ARGS ${ISA_ARGS} -DCMAKE_C_COMPILER=icx) set(ISA_ARGS ${ISA_ARGS} -DEMBREE_SYCL_SUPPORT=ON) list(APPEND ISA_LIBS embree4_sycl ze_wrapper) From 07eb47c8b27206c3fa39595cf2f568f7473dfff7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 18:52:58 +0000 Subject: [PATCH 16/27] =?UTF-8?q?Fix=20SOURCE=5FDIR=20typo=20=E2=86=92=20S?= =?UTF-8?q?RC=5FDIR=20and=20update=20icx=20comment=20in=20install=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/windows.yml | 2 +- util/install_oneapi_windows.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6ea372f5562..9ded4de9672 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -368,7 +368,7 @@ jobs: } Remove-Item "C:\Program Files\Open3D" -Recurse - name: Install Open3D python build requirements - working-directory: ${{ env.SOURCE_DIR }} + working-directory: ${{ env.SRC_DIR }} run: | $ErrorActionPreference = 'Stop' python -m pip install -U pip==${{ env.PIP_VER }} diff --git a/util/install_oneapi_windows.ps1 b/util/install_oneapi_windows.ps1 index 9f0874be66b..34da6fd7794 100644 --- a/util/install_oneapi_windows.ps1 +++ b/util/install_oneapi_windows.ps1 @@ -3,8 +3,8 @@ # Pattern from oneapi-src/oneapi-ci (2025.3.0 URLs @ 0804a4c): # https://github.com/oneapi-src/oneapi-ci/tree/0804a4c9281440d8a91ac0680388b101e5f673ad # -# Open3D uses the setvars.bat script to set up the oneAPI environment for icx compiler. -# VS 2022 integration is enabled for cmake -T Intel DPC++ toolset support. +# Open3D uses the setvars.bat script to set up the oneAPI environment for icx (C +# and C++ compiler). VS 2022 integration is enabled for cmake -T Intel DPC++ toolset support. param( [switch]$Verbose ) From 209c6c7b5d959b76b052306fb227e27b6a660954 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Tue, 7 Jul 2026 00:12:58 -0700 Subject: [PATCH 17/27] Fix Windows SYCL CI: use TBB::tbb target and remove duplicate ze_wrapper 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. --- 3rdparty/embree/embree.cmake | 1 - cpp/tests/CMakeLists.txt | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/3rdparty/embree/embree.cmake b/3rdparty/embree/embree.cmake index 865bbbdf083..9a86cf94526 100644 --- a/3rdparty/embree/embree.cmake +++ b/3rdparty/embree/embree.cmake @@ -109,7 +109,6 @@ ExternalProject_Add( /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}sys${CMAKE_STATIC_LIBRARY_SUFFIX} /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}math${CMAKE_STATIC_LIBRARY_SUFFIX} /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}tasking${CMAKE_STATIC_LIBRARY_SUFFIX} - /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_wrapper${CMAKE_STATIC_LIBRARY_SUFFIX} ${ISA_BUILD_BYPRODUCTS} ) diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index cb8c4f31d30..761a586879e 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -52,11 +52,14 @@ endif() open3d_show_and_abort_on_warning(tests) open3d_set_global_properties(tests) # On Windows, running tests from the build folder needs tbb.dll to be in the same folder. +# Use the TBB::tbb namespaced target, since it exists both when TBB is built from +# source (bare "tbb" target, aliased to TBB::tbb) and when it's found via the oneAPI +# TBB package for SYCL builds (only TBB::tbb is defined, no bare "tbb" target). if (WIN32) add_custom_command( TARGET tests POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/" + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/" ) endif() From 09b8d384fde45af638e1e72a76c04a552e62cb7b Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Tue, 7 Jul 2026 07:50:31 -0700 Subject: [PATCH 18/27] Fix Windows xpu CI: correct build dir var in iterative example build, 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. --- .github/workflows/windows.yml | 5 ++++- examples/cpp/CMakeLists.txt | 7 ++++++- examples/cpp/iterative_build_examples.cmake | 9 ++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 14af17fe1d2..c3b1ef3e8da 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -257,7 +257,10 @@ jobs: $buildArgs += "--config", "${{ matrix.CONFIG }}" } cmake @buildArgs --target build-examples-iteratively - cmake @buildArgs --target INSTALL + # Use lowercase "install" (works case-insensitively for MSBuild/VS + # generator too) since Ninja's generated meta-target is lowercase + # only; uppercase "INSTALL" is unknown to Ninja. + cmake @buildArgs --target install - name: Package working-directory: ${{ env.BUILD_DIR }} diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index ee6d747977b..1313dfdbef8 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -112,10 +112,15 @@ include(ProcessorCount) ProcessorCount(NPROC) # build-examples-iteratively is used to conserve space on CI machine. +# NOTE: CMAKE_BINARY_DIR cannot be forwarded via -D here: CMake's script mode +# (cmake -P) always resets CMAKE_BINARY_DIR/CMAKE_SOURCE_DIR/CMAKE_CURRENT_BINARY_DIR +# to the script's invocation directory, silently ignoring any -D override. Use a +# differently-named variable (EXAMPLE_TOP_BUILD_DIR) instead so the script can +# reliably locate the top-level build tree regardless of its own working directory. add_custom_target(build-examples-iteratively COMMAND ${CMAKE_COMMAND} -DEXAMPLE_TARGETS="${EXAMPLE_TARGETS}" - -DCMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}" + -DEXAMPLE_TOP_BUILD_DIR="${CMAKE_BINARY_DIR}" -DEXAMPLE_BIN_DIR="${EXAMPLE_BIN_DIR}" -DCMAKE_BUILD_TYPE="$" -DNPROC="${NPROC}" diff --git a/examples/cpp/iterative_build_examples.cmake b/examples/cpp/iterative_build_examples.cmake index 1414ee52c47..58d7d4e3b3c 100644 --- a/examples/cpp/iterative_build_examples.cmake +++ b/examples/cpp/iterative_build_examples.cmake @@ -1,17 +1,20 @@ +# NOTE: use EXAMPLE_TOP_BUILD_DIR (not CMAKE_BINARY_DIR) as the build tree root. +# CMake script mode (-P) always resets CMAKE_BINARY_DIR to this script's own +# invocation directory, ignoring any -D override, so it cannot be used here. string(REPLACE " " ";" EXAMPLE_TARGETS_LIST "${EXAMPLE_TARGETS}") foreach(EXAMPLE_TARGET ${EXAMPLE_TARGETS_LIST}) message(STATUS "[Iterative example build] building: ${EXAMPLE_TARGET}.") execute_process( COMMAND ${CMAKE_COMMAND} --build . --verbose --config ${CMAKE_BUILD_TYPE} --target ${EXAMPLE_TARGET} --parallel ${NPROC} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${EXAMPLE_TOP_BUILD_DIR} ) message(STATUS "[Iterative example build] deleting: ${EXAMPLE_TARGET}.") execute_process( COMMAND ${CMAKE_COMMAND} -E remove_directory ${EXAMPLE_BIN_DIR} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${EXAMPLE_TOP_BUILD_DIR} ) execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${EXAMPLE_BIN_DIR} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${EXAMPLE_TOP_BUILD_DIR} ) endforeach() From 3840981cd7502dbbbdfa10a7a7fffa980d5c9c06 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Tue, 7 Jul 2026 15:47:14 -0700 Subject: [PATCH 19/27] Fix Windows SYCL (xpu) build: /MP, MSVC STL SAL macro, and MT/MD runtime 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 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. --- .github/workflows/windows.yml | 7 ++++- .gitignore | 1 + 3rdparty/civetweb/civetweb.cmake | 11 +++++++- 3rdparty/embree/embree.cmake | 30 +++++++++++++++------ 3rdparty/filament/filament_build.cmake | 2 +- 3rdparty/filament/filament_download.cmake | 6 ++++- 3rdparty/find_dependencies.cmake | 15 +++++++++-- 3rdparty/jsoncpp/jsoncpp.cmake | 11 +++++++- 3rdparty/libjpeg-turbo/libjpeg-turbo.cmake | 2 +- 3rdparty/vtk/vtk_build.cmake | 7 ++++- 3rdparty/webrtc/webrtc_download.cmake | 18 ++++++++++++- 3rdparty/zeromq/zeromq_build.cmake | 24 +++++++++++------ CMakeLists.txt | 8 +++++- cmake/Open3DSetGlobalProperties.cmake | 31 +++++++++++++++++++++- 14 files changed, 145 insertions(+), 28 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c3b1ef3e8da..f9c3eb50ecb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -104,7 +104,12 @@ jobs: env: BUILD_CUDA_MODULE: ${{ matrix.device == 'cuda' && 'ON' || 'OFF' }} BUILD_SYCL_MODULE: ${{ matrix.device == 'xpu' && 'ON' || 'OFF' }} - BUILD_WEBRTC: ${{ ( matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' ) && 'ON' || 'OFF' }} + # Pre-built WebRTC on Windows is only available for the static + # (/MT, /MTd) MSVC runtime. SYCL (xpu) builds always force the dynamic + # (/MD, /MDd) runtime instead (icx rejects -fsycl combined with /MT), + # so WebRTC must stay disabled for xpu legs regardless of + # STATIC_RUNTIME, to avoid RuntimeLibrary link mismatches. + BUILD_WEBRTC: ${{ ( matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.device != 'xpu' ) && 'ON' || 'OFF' }} BUILD_PYTORCH_OPS: ${{ ( matrix.device == 'cuda' || matrix.device == 'xpu' || matrix.CONFIG == 'Debug' ) && 'OFF' || 'ON' }} # FIXME steps: diff --git a/.gitignore b/.gitignore index 66eaaea98e2..8a2e68745aa 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ cmake-build-release/ util/pip_package/dist/ doxygen/ node_modules/ +.yarn # Editor files *.*~ diff --git a/3rdparty/civetweb/civetweb.cmake b/3rdparty/civetweb/civetweb.cmake index 4a4c0de61c8..1b9d19cfcca 100644 --- a/3rdparty/civetweb/civetweb.cmake +++ b/3rdparty/civetweb/civetweb.cmake @@ -19,7 +19,16 @@ ExternalProject_Add( -DCIVETWEB_DISABLE_CGI=ON -DCMAKE_INSTALL_PREFIX= -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=$ $<$:/EHsc>" + # Note: on Windows, keep this as a single flag (no embedded space by + # combining with another flag in the same string). The Intel + # oneAPI DPC++/C++ compiler (icx), used when BUILD_SYCL_MODULE=ON, + # parses each CMAKE_ARGS string as one literal argv token; a + # combined "-D /EHsc" string gets misparsed by icx as the + # macro's value swallowing "/EHsc", silently leaving exceptions + # disabled (MSVC cl.exe tolerates this, icx does not). Since + # _GLIBCXX_USE_CXX11_ABI only matters for libstdc++ (not used on + # Windows/MSVC STL), it is safe to only set one flag per platform. + -DCMAKE_CXX_FLAGS=$,/EHsc,-D_GLIBCXX_USE_CXX11_ABI=$> ${ExternalProject_CMAKE_ARGS_hidden} BUILD_BYPRODUCTS /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}civetweb${CMAKE_STATIC_LIBRARY_SUFFIX} diff --git a/3rdparty/embree/embree.cmake b/3rdparty/embree/embree.cmake index 9a86cf94526..b0a40b4e444 100644 --- a/3rdparty/embree/embree.cmake +++ b/3rdparty/embree/embree.cmake @@ -50,14 +50,28 @@ endif() if(WIN32) - set(WIN_CMAKE_ARGS "-DCMAKE_CXX_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_CXX_FLAGS_DEBUG_INIT}" - "-DCMAKE_CXX_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELEASE_INIT}" - "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" - "-DCMAKE_CXX_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" - "-DCMAKE_C_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_C_FLAGS_DEBUG_INIT}" - "-DCMAKE_C_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_C_FLAGS_RELEASE_INIT}" - "-DCMAKE_C_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" - "-DCMAKE_C_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_C_FLAGS_MINSIZEREL_INIT}" + # icx.exe hard-errors ("invalid argument 'MT' not allowed with + # '-fsycl'") when compiling any translation unit with -fsycl together + # with the static (/MT, /MTd) MSVC runtime. Since embree's SYCL support + # (embree4_sycl, ze_wrapper) is built in the same ExternalProject + # configure/build as the non-SYCL ISA libs, force the dynamic runtime + # (/MD, /MDd) for all of embree's libs when BUILD_SYCL_MODULE=ON, + # regardless of STATIC_WINDOWS_RUNTIME. This also matches upstream + # embree's own Windows SYCL build docs, which never enable + # USE_STATIC_RUNTIME (default OFF) together with EMBREE_SYCL_SUPPORT. + if(BUILD_SYCL_MODULE) + set(EMBREE_USE_STATIC_RUNTIME OFF) + else() + set(EMBREE_USE_STATIC_RUNTIME ${STATIC_WINDOWS_RUNTIME}) + endif() + set(WIN_CMAKE_ARGS "-DCMAKE_CXX_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_CXX_FLAGS_DEBUG_INIT}" + "-DCMAKE_CXX_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELEASE_INIT}" + "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" + "-DCMAKE_CXX_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" + "-DCMAKE_C_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_C_FLAGS_DEBUG_INIT}" + "-DCMAKE_C_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_C_FLAGS_RELEASE_INIT}" + "-DCMAKE_C_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" + "-DCMAKE_C_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_C_FLAGS_MINSIZEREL_INIT}" ) else() set(WIN_CMAKE_ARGS "") diff --git a/3rdparty/filament/filament_build.cmake b/3rdparty/filament/filament_build.cmake index ee520798111..ccb982f6b6b 100644 --- a/3rdparty/filament/filament_build.cmake +++ b/3rdparty/filament/filament_build.cmake @@ -70,7 +70,7 @@ ExternalProject_Add( -DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER} -DCMAKE_CXX_FLAGS:STRING=${filament_cxx_flags} -DCMAKE_INSTALL_PREFIX=${FILAMENT_ROOT} - -DUSE_STATIC_CRT=${STATIC_WINDOWS_RUNTIME} + -DUSE_STATIC_CRT=$,OFF,${STATIC_WINDOWS_RUNTIME}> -DUSE_STATIC_LIBCXX=ON -DFILAMENT_SKIP_SDL2=ON -DFILAMENT_SKIP_SAMPLES=ON diff --git a/3rdparty/filament/filament_download.cmake b/3rdparty/filament/filament_download.cmake index 8795e5bfb91..d2314802086 100644 --- a/3rdparty/filament/filament_download.cmake +++ b/3rdparty/filament/filament_download.cmake @@ -15,7 +15,11 @@ else() if(WIN32) set(FILAMENT_URL https://github.com/google/filament/releases/download/v1.54.0/filament-v1.54.0-windows.tgz) set(FILAMENT_SHA256 370b85dbaf1a3be26a5a80f60c912f11887748ddd1c42796a83fe989f5805f7b) - if (STATIC_WINDOWS_RUNTIME) + # Note: when BUILD_SYCL_MODULE is ON, Open3D forces the dynamic + # (/MD, /MDd) MSVC runtime for the whole project regardless of + # STATIC_WINDOWS_RUNTIME (icx rejects -fsycl combined with the + # static runtime), so the prebuilt Filament libs must match. + if (STATIC_WINDOWS_RUNTIME AND NOT BUILD_SYCL_MODULE) string(APPEND lib_dir /x86_64/mt) else() string(APPEND lib_dir /x86_64/md) diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake index 385bd45e0c5..52f6075c77c 100644 --- a/3rdparty/find_dependencies.cmake +++ b/3rdparty/find_dependencies.cmake @@ -1356,7 +1356,10 @@ if(BUILD_GUI) set(FILAMENT_RUNTIME_VER x86_64) endif() else() # WIN32 - if (STATIC_WINDOWS_RUNTIME) + # Match the prebuilt Filament archive's runtime selection in + # filament_download.cmake: SYCL builds always use the dynamic + # runtime regardless of STATIC_WINDOWS_RUNTIME. + if (STATIC_WINDOWS_RUNTIME AND NOT BUILD_SYCL_MODULE) set(FILAMENT_RUNTIME_VER "x86_64/mt$<$:d>") else() set(FILAMENT_RUNTIME_VER "x86_64/md$<$:d>") @@ -1608,11 +1611,19 @@ if(OPEN3D_USE_ONEAPI_PACKAGES) set(MKL_THREADING tbb_thread) set(MKL_LINK static) find_package(MKL REQUIRED) + # oneAPI MKL's lib layout differs by platform: Linux nests libs under an + # "intel64" subdirectory, while Windows (verified with oneAPI 2025.3) + # places them directly in "lib". + if(WIN32) + set(MKL_LIB_DIR ${MKL_ROOT}/lib) + else() + set(MKL_LIB_DIR ${MKL_ROOT}/lib/intel64) + endif() open3d_import_3rdparty_library(3rdparty_mkl HIDDEN GROUPED INCLUDE_DIRS ${MKL_INCLUDE}/ - LIB_DIR ${MKL_ROOT}/lib/intel64 + LIB_DIR ${MKL_LIB_DIR} LIBRARIES $<$:mkl_sycl> mkl_intel_ilp64 mkl_tbb_thread mkl_core ) if (BUILD_SYCL_MODULE) diff --git a/3rdparty/jsoncpp/jsoncpp.cmake b/3rdparty/jsoncpp/jsoncpp.cmake index 2f5b48d428a..efd128c8ede 100644 --- a/3rdparty/jsoncpp/jsoncpp.cmake +++ b/3rdparty/jsoncpp/jsoncpp.cmake @@ -2,6 +2,15 @@ include(ExternalProject) find_package(Git QUIET REQUIRED) +# SYCL builds always force the dynamic (/MD, /MDd) MSVC runtime for the +# whole project regardless of STATIC_WINDOWS_RUNTIME (icx rejects -fsycl +# combined with the static runtime), so jsoncpp must match. +if(BUILD_SYCL_MODULE) + set(JSONCPP_USE_STATIC_RUNTIME OFF) +else() + set(JSONCPP_USE_STATIC_RUNTIME ${STATIC_WINDOWS_RUNTIME}) +endif() + ExternalProject_Add( ext_jsoncpp PREFIX jsoncpp @@ -19,7 +28,7 @@ ExternalProject_Add( -DBUILD_OBJECT_LIBS=OFF -DJSONCPP_WITH_TESTS=OFF -DJSONCPP_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI} - -DJSONCPP_STATIC_WINDOWS_RUNTIME=${STATIC_WINDOWS_RUNTIME} + -DJSONCPP_STATIC_WINDOWS_RUNTIME=${JSONCPP_USE_STATIC_RUNTIME} ${ExternalProject_CMAKE_ARGS_hidden} BUILD_BYPRODUCTS /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX} diff --git a/3rdparty/libjpeg-turbo/libjpeg-turbo.cmake b/3rdparty/libjpeg-turbo/libjpeg-turbo.cmake index 32094ea9530..03f0b73308b 100644 --- a/3rdparty/libjpeg-turbo/libjpeg-turbo.cmake +++ b/3rdparty/libjpeg-turbo/libjpeg-turbo.cmake @@ -35,7 +35,7 @@ else() message(STATUS "NASM assembler not found - libjpeg-turbo performance may suffer") endif() -if (STATIC_WINDOWS_RUNTIME) +if (STATIC_WINDOWS_RUNTIME AND NOT BUILD_SYCL_MODULE) set(WITH_CRT_DLL OFF) else() set(WITH_CRT_DLL ON) diff --git a/3rdparty/vtk/vtk_build.cmake b/3rdparty/vtk/vtk_build.cmake index eb8430e8e46..062580d0655 100644 --- a/3rdparty/vtk/vtk_build.cmake +++ b/3rdparty/vtk/vtk_build.cmake @@ -313,7 +313,12 @@ else() #### download prebuilt vtk ) set(VTK_SHA256 28e36654ed18aa9f668a0486a6c3d26a0ca6cf6a593dbd15be4736b40880a82b) elseif(WIN32) - if (STATIC_WINDOWS_RUNTIME) + # Note: when BUILD_SYCL_MODULE is ON, Open3D's own CMakeLists.txt + # forces the dynamic (/MD, /MDd) MSVC runtime for the whole project + # regardless of STATIC_WINDOWS_RUNTIME (icx rejects -fsycl combined + # with the static runtime). The prebuilt VTK archive must match, or + # linking fails with LNK2038 "RuntimeLibrary mismatch" errors. + if (STATIC_WINDOWS_RUNTIME AND NOT BUILD_SYCL_MODULE) set(VTK_URL https://github.com/isl-org/open3d_downloads/releases/download/vtk/vtk_${VTK_VERSION}_win_staticrt.tar.gz ) diff --git a/3rdparty/webrtc/webrtc_download.cmake b/3rdparty/webrtc/webrtc_download.cmake index 8ac5a0b6ef7..794e3979733 100644 --- a/3rdparty/webrtc/webrtc_download.cmake +++ b/3rdparty/webrtc/webrtc_download.cmake @@ -4,6 +4,14 @@ include(ExternalProject) +# Sub-directory (below ) where the extracted archive places its +# static libs. On Windows the archive layout has a per-config subfolder. +if(WIN32) + set(WEBRTC_BYPRODUCT_SUBDIR "$,Debug,Release>/lib") +else() + set(WEBRTC_BYPRODUCT_SUBDIR "lib") +endif() + set(WEBRTC_VER 60e6748) if (APPLE) set(WEBRTC_URL @@ -46,7 +54,15 @@ ExternalProject_Add( CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" - BUILD_BYPRODUCTS "" + # Declare the pre-compiled libs extracted from the downloaded archive as + # byproducts. This is required by the Ninja generator (used for Windows + # xpu/SYCL builds), which -- unlike Makefiles -- refuses to link a target + # against a file with "no known rule to make it". Makefiles/VS generators + # tolerated the previously-empty BUILD_BYPRODUCTS since they don't track + # output freshness for custom/external targets as strictly. + BUILD_BYPRODUCTS + /${WEBRTC_BYPRODUCT_SUBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}webrtc${CMAKE_STATIC_LIBRARY_SUFFIX} + /${WEBRTC_BYPRODUCT_SUBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}webrtc_extra${CMAKE_STATIC_LIBRARY_SUFFIX} ) ExternalProject_Get_Property(ext_webrtc SOURCE_DIR) diff --git a/3rdparty/zeromq/zeromq_build.cmake b/3rdparty/zeromq/zeromq_build.cmake index f0bf964655d..d5d2b119e4a 100644 --- a/3rdparty/zeromq/zeromq_build.cmake +++ b/3rdparty/zeromq/zeromq_build.cmake @@ -5,14 +5,22 @@ include(ExternalProject) # Define the compile flags for Windows if(WIN32) - set(WIN_CMAKE_ARGS "-DCMAKE_CXX_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_CXX_FLAGS_DEBUG_INIT}" - "-DCMAKE_CXX_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELEASE_INIT}" - "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" - "-DCMAKE_CXX_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" - "-DCMAKE_C_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_C_FLAGS_DEBUG_INIT}" - "-DCMAKE_C_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_C_FLAGS_RELEASE_INIT}" - "-DCMAKE_C_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" - "-DCMAKE_C_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_C_FLAGS_MINSIZEREL_INIT}" + # SYCL builds always force the dynamic (/MD, /MDd) MSVC runtime for the + # whole project regardless of STATIC_WINDOWS_RUNTIME (icx rejects + # -fsycl combined with the static runtime), so zeromq must match. + if(BUILD_SYCL_MODULE) + set(ZEROMQ_USE_STATIC_RUNTIME OFF) + else() + set(ZEROMQ_USE_STATIC_RUNTIME ${STATIC_WINDOWS_RUNTIME}) + endif() + set(WIN_CMAKE_ARGS "-DCMAKE_CXX_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_CXX_FLAGS_DEBUG_INIT}" + "-DCMAKE_CXX_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELEASE_INIT}" + "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" + "-DCMAKE_CXX_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" + "-DCMAKE_C_FLAGS_DEBUG=$,/MTd,/MDd> ${CMAKE_C_FLAGS_DEBUG_INIT}" + "-DCMAKE_C_FLAGS_RELEASE=$,/MT,/MD> ${CMAKE_C_FLAGS_RELEASE_INIT}" + "-DCMAKE_C_FLAGS_RELWITHDEBINFO=$,/MT,/MD> ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" + "-DCMAKE_C_FLAGS_MINSIZEREL=$,/MT,/MD> ${CMAKE_C_FLAGS_MINSIZEREL_INIT}" ) set(lib_name libzmq) if(CMAKE_VS_PLATFORM_TOOLSET) diff --git a/CMakeLists.txt b/CMakeLists.txt index d07954b59cf..bc0ddcfad17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -521,9 +521,15 @@ if(WIN32) # objects exceeded"). /Zc:inline will remove unreferenced data and functions from object files. add_compile_options($<$:/Zc:inline>) endif() - if (STATIC_WINDOWS_RUNTIME) + if (STATIC_WINDOWS_RUNTIME AND NOT BUILD_SYCL_MODULE) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") else() + # The Intel oneAPI DPC++/C++ compiler (icx) hard-errors ("invalid + # argument 'MT' not allowed with '-fsycl'") when compiling any + # translation unit that has -fsycl enabled together with the static + # (/MT, /MTd) MSVC runtime. SYCL compilation therefore always + # requires the dynamic runtime on Windows, regardless of + # STATIC_WINDOWS_RUNTIME. set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") endif() endif() diff --git a/cmake/Open3DSetGlobalProperties.cmake b/cmake/Open3DSetGlobalProperties.cmake index ab34eb8affc..8571fc87776 100644 --- a/cmake/Open3DSetGlobalProperties.cmake +++ b/cmake/Open3DSetGlobalProperties.cmake @@ -142,12 +142,41 @@ function(open3d_set_global_properties target) if(MSVC) target_compile_definitions(${target} PRIVATE NOMINMAX _USE_MATH_DEFINES _ENABLE_EXTENDED_ALIGNED_STORAGE) target_compile_options(${target} PRIVATE $<$:/EHsc>) + if(BUILD_SYCL_MODULE) + # The Intel oneAPI DPC++/C++ compiler (icx) fails to parse + # recent MSVC STL versions' header (pulled in + # transitively by oneDPL's , which is + # used by SYCL kernels for host-side algorithms), which + # implements a work-stealing deque annotated with the + # concurrency SAL macro `_Guarded_by_`. icx/clang-cl does not + # expand this macro the same way cl.exe does, causing + # "error: unknown type name '_Guarded_by_'". Since this macro + # is purely a static-analysis annotation (a no-op outside of + # /analyze builds), it is safe to force it to expand to + # nothing for SYCL translation units. + # Note: use target_compile_options (not + # target_compile_definitions) because CMake does not reliably + # escape parentheses in compile definitions across + # generators/shells, which can corrupt the flag. Also avoid + # wrapping this in a $ generator + # expression: CMake's generator-expression parser mishandles + # the literal parentheses in the flag text, splitting it into + # multiple separate command-line arguments. + target_compile_options(${target} PRIVATE "-D_Guarded_by_(x)=") + endif() # Multi-thread compile, two ways to enable # Option 1, at build time: cmake --build . --parallel %NUMBER_OF_PROCESSORS% # https://stackoverflow.com/questions/36633074/set-the-number-of-threads-in-a-cmake-build # Option 2, at configure time: add /MP flag, no need to use Option 1 # https://docs.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes?view=vs-2019 - target_compile_options(${target} PRIVATE $<$:/MP>) + # Note: /MP is not compatible with the Intel oneAPI DPC++/C++ + # compiler (icx) when SYCL offloading (-fsycl) is enabled: icx + # errors with "'-MP' is not supported with offloading enabled". + # Use build-time parallelism (Option 1) instead when + # BUILD_SYCL_MODULE is ON. + if(NOT BUILD_SYCL_MODULE) + target_compile_options(${target} PRIVATE $<$:/MP>) + endif() if(BUILD_GUI) # GLEW and Open3D make direct OpenGL calls and link to opengl32.lib; # Filament needs to link through bluegl.lib. From 406237993b7e6a7c03e9baa337fe1845af52ec59 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:50:34 -0700 Subject: [PATCH 20/27] Fix Windows xpu CI: persist oneAPI env vars across workflow steps 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. --- .github/workflows/windows.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f9c3eb50ecb..2f501532d14 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -210,14 +210,26 @@ jobs: cmake --version $CMAKE_ARGS = @() if ('${{ matrix.device }}' -eq 'xpu') { - # Runs setvars.bat via cmd and imports - # all resulting env vars into the current PowerShell process. + # Runs setvars.bat via cmd and imports all resulting env vars into + # the current PowerShell process AND into $GITHUB_ENV. The latter + # is required because each workflow step ("Config", "Build", + # "Package", ...) runs in a brand new process: env vars set only + # via [System.Environment]::SetEnvironmentVariable (default scope + # Process) do NOT survive past this step. Without $GITHUB_ENV, + # later steps (e.g. Build) lose LIB/INCLUDE/PATH set by + # setvars.bat, so icx fails to find its own runtime libs (e.g. + # libircmt.lib) when ExternalProject sub-builds (zlib, + # directxheaders, ...) run their own fresh compiler ABI detection + # during the Build step. Write-Host "Initializing oneAPI environment via setvars.bat..." $setOutput = cmd /c '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && set 2>&1' if ($LASTEXITCODE -ne 0) { throw "setvars.bat failed (exit $LASTEXITCODE)" } $setOutput | ForEach-Object { if ($_ -match '^([^=]+)=(.*)$') { - [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) + $varName = $Matches[1] + $varValue = $Matches[2] + [System.Environment]::SetEnvironmentVariable($varName, $varValue) + "$varName=$varValue" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append } } $CMAKE_GENERATOR = "Ninja" From 27eb42457bf6b66cfea0964fa74d33369b67086e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:29:52 +0000 Subject: [PATCH 21/27] Fix Windows xpu CI: suppress ICX -Wcharacter-conversion in googletest, 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. --- .github/workflows/windows.yml | 18 +++++++++++++++--- 3rdparty/googletest/googletest.cmake | 11 +++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2f501532d14..78ad9e07060 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -530,14 +530,26 @@ jobs: cmake --version $CMAKE_ARGS = @() if ('${{ matrix.device }}' -eq 'xpu') { - # Runs setvars.bat via cmd and imports - # all resulting env vars into the current PowerShell process. + # Runs setvars.bat via cmd and imports all resulting env vars into + # the current PowerShell process AND into $GITHUB_ENV. The latter + # is required because each workflow step ("Config", "Build Python + # package", ...) runs in a brand new process: env vars set only + # via [System.Environment]::SetEnvironmentVariable (default scope + # Process) do NOT survive past this step. Without $GITHUB_ENV, + # later steps (e.g. Build) lose LIB/INCLUDE/PATH set by + # setvars.bat, so icx fails to find its own runtime libs (e.g. + # libircmt.lib) when ExternalProject sub-builds (uvatlas, zlib, + # directxheaders, ...) run their own fresh compiler ABI detection + # during the Build step. Write-Host "Initializing oneAPI environment via setvars.bat..." $setOutput = cmd /c '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && set 2>&1' if ($LASTEXITCODE -ne 0) { throw "setvars.bat failed (exit $LASTEXITCODE)" } $setOutput | ForEach-Object { if ($_ -match '^([^=]+)=(.*)$') { - [System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) + $varName = $Matches[1] + $varValue = $Matches[2] + [System.Environment]::SetEnvironmentVariable($varName, $varValue) + "$varName=$varValue" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append } } $CMAKE_GENERATOR = "Ninja" diff --git a/3rdparty/googletest/googletest.cmake b/3rdparty/googletest/googletest.cmake index 50666cc8896..b7a8211d3ab 100644 --- a/3rdparty/googletest/googletest.cmake +++ b/3rdparty/googletest/googletest.cmake @@ -14,3 +14,14 @@ FetchContent_Declare( FetchContent_MakeAvailable(ext_googletest) FetchContent_GetProperties(ext_googletest SOURCE_DIR GOOGLETEST_SOURCE_DIR) + +# Suppress -Wcharacter-conversion error in googletest when using IntelLLVM/ICX. +# ICX's Clang front-end treats the implicit char16_t->char32_t conversion in +# gtest-printers.h(524) as a hard error. Suppress it on FetchContent targets. +if(CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") + foreach(_gt_tgt gtest gtest_main gmock gmock_main) + if(TARGET ${_gt_tgt}) + target_compile_options(${_gt_tgt} PRIVATE -Wno-character-conversion) + endif() + endforeach() +endif() From 211cf59a854a59db4f6d8302823c14e787a55bde Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Wed, 8 Jul 2026 19:06:10 -0700 Subject: [PATCH 22/27] Fix librealsense target features under icx and macos gfortran installation --- .github/workflows/macos.yml | 2 +- 3rdparty/librealsense/librealsense.cmake | 18 +++++++++++++++++- cpp/pybind/t/geometry/pointcloud.cpp | 7 ++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 495049bbb35..32578698f7f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -66,7 +66,7 @@ jobs: - name: Install dependencies run: | - brew install ccache glslang spirv-cross + brew install ccache glslang spirv-cross gcc # Fix gfortran not found issue ln -s $(brew --prefix gcc)/bin/gfortran-* /usr/local/bin/gfortran diff --git a/3rdparty/librealsense/librealsense.cmake b/3rdparty/librealsense/librealsense.cmake index b4af1af2ff6..e998ed56ef3 100644 --- a/3rdparty/librealsense/librealsense.cmake +++ b/3rdparty/librealsense/librealsense.cmake @@ -57,6 +57,21 @@ if(NOT WIN32) endif() endif() +# icx (IntelLLVM), used as the CXX/C compiler for Windows SYCL (xpu) builds, +# enforces target-feature checks that MSVC's cl.exe does not: librealsense's +# SSE helper files (sse-align.cpp, sse-pointcloud.cpp, sse imagery) call +# always_inline intrinsics like _mm_shuffle_epi8 without enabling ssse3 for +# the translation unit, which fails to compile under icx with "requires +# target feature 'ssse3'". Explicitly enable ssse3 for icx on Windows; Clang +# accepts -m flags even in its MSVC-compatible ("icx.exe") driver +# mode. +set(LIBREALSENSE_WIN_CMAKE_C_FLAGS "") +set(LIBREALSENSE_WIN_CMAKE_CXX_FLAGS "") +if(WIN32 AND BUILD_SYCL_MODULE) + set(LIBREALSENSE_WIN_CMAKE_C_FLAGS "-mssse3") + set(LIBREALSENSE_WIN_CMAKE_CXX_FLAGS "-mssse3") +endif() + ExternalProject_Add( ext_librealsense PREFIX librealsense @@ -84,7 +99,8 @@ ExternalProject_Add( -DCMAKE_POLICY_VERSION_MINIMUM=3.5 # Syncing GLIBCXX_USE_CXX11_ABI for MSVC causes problems, but directly # checking CXX_COMPILER_ID is not supported. - $,"",-DCMAKE_CXX_FLAGS=${LIBREALSENSE_CMAKE_CXX_FLAGS}> + $,-DCMAKE_CXX_FLAGS=${LIBREALSENSE_WIN_CMAKE_CXX_FLAGS},-DCMAKE_CXX_FLAGS=${LIBREALSENSE_CMAKE_CXX_FLAGS}> + $<$:-DCMAKE_C_FLAGS=${LIBREALSENSE_WIN_CMAKE_C_FLAGS}> $<$:-DBUILD_WITH_OPENMP=OFF> $<$:-DHWM_OVER_XU=OFF> $<$:-DBUILD_WITH_STATIC_CRT=${STATIC_WINDOWS_RUNTIME}> diff --git a/cpp/pybind/t/geometry/pointcloud.cpp b/cpp/pybind/t/geometry/pointcloud.cpp index f46c16aa559..67efde2ff60 100644 --- a/cpp/pybind/t/geometry/pointcloud.cpp +++ b/cpp/pybind/t/geometry/pointcloud.cpp @@ -261,9 +261,10 @@ void pybind_pointcloud_definitions(py::module& m) { "non-negative number less than number of points in the " "input pointcloud.", "start_index"_a = 0); - pointcloud.def("remove_radius_outliers", &PointCloud::RemoveRadiusOutliers, - "nb_points"_a, "search_radius"_a, - R"(Remove points that have less than nb_points neighbors in a + pointcloud.def( + "remove_radius_outliers", &PointCloud::RemoveRadiusOutliers, + "nb_points"_a, "search_radius"_a, + R"(Remove points that have less than nb_points neighbors in a sphere of a given search radius. Args: From 47f66444dd17c283bbc2f14384faa0433dc3893b Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Wed, 8 Jul 2026 22:34:24 -0700 Subject: [PATCH 23/27] Support win32 single config generators in WebRTC prebuilt down-loader --- 3rdparty/webrtc/webrtc_download.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/3rdparty/webrtc/webrtc_download.cmake b/3rdparty/webrtc/webrtc_download.cmake index 4544a9c6768..3ae6097e6da 100644 --- a/3rdparty/webrtc/webrtc_download.cmake +++ b/3rdparty/webrtc/webrtc_download.cmake @@ -12,9 +12,6 @@ set(WEBRTC_BASE_URL # generators pick Debug vs Release at build time via $; single-config # generators download one variant at configure time (Release if unset). get_property(WEBRTC_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if (WIN32 AND NOT WEBRTC_MULTI_CONFIG) - message(SEND_ERROR "CMake config does not support Windows single config generators!") -endif() if (APPLE) set(WEBRTC_URL @@ -65,7 +62,7 @@ else() # Linux set(WEBRTC_SHA256 0209f722974fa7b9da9d1c8e279694cf2c4db81e079a325bcadb1b6e0c3b6981) endif() -if(WIN32) +if(WIN32 AND WEBRTC_MULTI_CONFIG) # ExternalProject_Add cannot vary URL per config; use add_custom_command + webrtc_fetch_variant.cmake. set(WEBRTC_PREBUILT_ROOT "${CMAKE_BINARY_DIR}/webrtc/$") set(WEBRTC_STAMP "${WEBRTC_PREBUILT_ROOT}/webrtc_fetch.stamp") From 3f635a68fb4bda4882198d4e5495de0a88fd66d6 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:08:58 -0700 Subject: [PATCH 24/27] Revert accidental style changes to pointcloud.cpp --- cpp/pybind/t/geometry/pointcloud.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cpp/pybind/t/geometry/pointcloud.cpp b/cpp/pybind/t/geometry/pointcloud.cpp index 67efde2ff60..f46c16aa559 100644 --- a/cpp/pybind/t/geometry/pointcloud.cpp +++ b/cpp/pybind/t/geometry/pointcloud.cpp @@ -261,10 +261,9 @@ void pybind_pointcloud_definitions(py::module& m) { "non-negative number less than number of points in the " "input pointcloud.", "start_index"_a = 0); - pointcloud.def( - "remove_radius_outliers", &PointCloud::RemoveRadiusOutliers, - "nb_points"_a, "search_radius"_a, - R"(Remove points that have less than nb_points neighbors in a + pointcloud.def("remove_radius_outliers", &PointCloud::RemoveRadiusOutliers, + "nb_points"_a, "search_radius"_a, + R"(Remove points that have less than nb_points neighbors in a sphere of a given search radius. Args: From 431e83682a346a1f18b1ba30de28492f8bd8b166 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:20:53 -0700 Subject: [PATCH 25/27] Fix librealsense exceptions by preserving /EHsc flag when building with icx on Windows SYCL --- 3rdparty/librealsense/librealsense.cmake | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/3rdparty/librealsense/librealsense.cmake b/3rdparty/librealsense/librealsense.cmake index e998ed56ef3..986fc74e174 100644 --- a/3rdparty/librealsense/librealsense.cmake +++ b/3rdparty/librealsense/librealsense.cmake @@ -45,7 +45,23 @@ endif() set(LIBREALSENSE_CMAKE_C_FLAGS "") set(LIBREALSENSE_CMAKE_CXX_FLAGS "") set(LIBREALSENSE_EXTRA_CMAKE_ARGS "") -if(NOT WIN32) +if(WIN32) + # icx (IntelLLVM), used as the CXX/C compiler for Windows SYCL (xpu) builds, + # enforces target-feature checks that MSVC's cl.exe does not: librealsense's + # SSE helper files (sse-align.cpp, sse-pointcloud.cpp, sse imagery) call + # always_inline intrinsics like _mm_shuffle_epi8 without enabling ssse3 for + # the translation unit, which fails to compile under icx with "requires + # target feature 'ssse3'". Explicitly enable ssse3 for icx on Windows; Clang + # accepts -m flags even in its MSVC-compatible ("icx.exe") driver + # mode. Ensure we keep /EHsc (C++ exception handling) enabled, since overriding + # CMAKE_CXX_FLAGS clobbers CMake's standard default flag /EHsc on Windows. + if(BUILD_SYCL_MODULE) + list(APPEND LIBREALSENSE_EXTRA_CMAKE_ARGS + "-DCMAKE_C_FLAGS:STRING=-mssse3" + "-DCMAKE_CXX_FLAGS:STRING=/EHsc -mssse3" + ) + endif() +else() if(LIBUSB1_CMAKE_C_FLAGS_EXTRA) set(LIBREALSENSE_CMAKE_C_FLAGS "${LIBUSB1_CMAKE_C_FLAGS_EXTRA}") list(APPEND LIBREALSENSE_EXTRA_CMAKE_ARGS "-DCMAKE_C_FLAGS=${LIBUSB1_CMAKE_C_FLAGS_EXTRA}") @@ -55,21 +71,7 @@ if(NOT WIN32) if(LIBUSB1_CMAKE_CXX_FLAGS_EXTRA) set(LIBREALSENSE_CMAKE_CXX_FLAGS "${LIBREALSENSE_CMAKE_CXX_FLAGS} ${LIBUSB1_CMAKE_CXX_FLAGS_EXTRA}") endif() -endif() - -# icx (IntelLLVM), used as the CXX/C compiler for Windows SYCL (xpu) builds, -# enforces target-feature checks that MSVC's cl.exe does not: librealsense's -# SSE helper files (sse-align.cpp, sse-pointcloud.cpp, sse imagery) call -# always_inline intrinsics like _mm_shuffle_epi8 without enabling ssse3 for -# the translation unit, which fails to compile under icx with "requires -# target feature 'ssse3'". Explicitly enable ssse3 for icx on Windows; Clang -# accepts -m flags even in its MSVC-compatible ("icx.exe") driver -# mode. -set(LIBREALSENSE_WIN_CMAKE_C_FLAGS "") -set(LIBREALSENSE_WIN_CMAKE_CXX_FLAGS "") -if(WIN32 AND BUILD_SYCL_MODULE) - set(LIBREALSENSE_WIN_CMAKE_C_FLAGS "-mssse3") - set(LIBREALSENSE_WIN_CMAKE_CXX_FLAGS "-mssse3") + list(APPEND LIBREALSENSE_EXTRA_CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${LIBREALSENSE_CMAKE_CXX_FLAGS}") endif() ExternalProject_Add( @@ -99,8 +101,6 @@ ExternalProject_Add( -DCMAKE_POLICY_VERSION_MINIMUM=3.5 # Syncing GLIBCXX_USE_CXX11_ABI for MSVC causes problems, but directly # checking CXX_COMPILER_ID is not supported. - $,-DCMAKE_CXX_FLAGS=${LIBREALSENSE_WIN_CMAKE_CXX_FLAGS},-DCMAKE_CXX_FLAGS=${LIBREALSENSE_CMAKE_CXX_FLAGS}> - $<$:-DCMAKE_C_FLAGS=${LIBREALSENSE_WIN_CMAKE_C_FLAGS}> $<$:-DBUILD_WITH_OPENMP=OFF> $<$:-DHWM_OVER_XU=OFF> $<$:-DBUILD_WITH_STATIC_CRT=${STATIC_WINDOWS_RUNTIME}> From be6586f6e7366e222cb150949b509f52182d3eac Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Thu, 9 Jul 2026 17:46:35 -0700 Subject: [PATCH 26/27] relasense fix 2 --- 3rdparty/librealsense/librealsense.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/3rdparty/librealsense/librealsense.cmake b/3rdparty/librealsense/librealsense.cmake index 986fc74e174..d7aadfc82b8 100644 --- a/3rdparty/librealsense/librealsense.cmake +++ b/3rdparty/librealsense/librealsense.cmake @@ -53,12 +53,14 @@ if(WIN32) # the translation unit, which fails to compile under icx with "requires # target feature 'ssse3'". Explicitly enable ssse3 for icx on Windows; Clang # accepts -m flags even in its MSVC-compatible ("icx.exe") driver - # mode. Ensure we keep /EHsc (C++ exception handling) enabled, since overriding - # CMAKE_CXX_FLAGS clobbers CMake's standard default flag /EHsc on Windows. + # mode. Start from the inherited ${CMAKE_CXX_FLAGS} (which already carries + # CMake's standard Windows defaults, e.g. /DWIN32 /D_WINDOWS /EHsc) rather + # than a hardcoded literal, so librealsense's WIN32-guarded code (e.g. + # rostime's sys/timeb.h vs sys/time.h switch) keeps seeing WIN32 defined. if(BUILD_SYCL_MODULE) list(APPEND LIBREALSENSE_EXTRA_CMAKE_ARGS - "-DCMAKE_C_FLAGS:STRING=-mssse3" - "-DCMAKE_CXX_FLAGS:STRING=/EHsc -mssse3" + "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} -mssse3" + "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -mssse3" ) endif() else() From 129c32e33fcf54e1ea19f79d95fe4214e5431b24 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> Date: Thu, 9 Jul 2026 21:42:52 -0700 Subject: [PATCH 27/27] Fix Windows XPU build: link WebRTC dynamically on SYCL and support single-config generators --- 3rdparty/webrtc/webrtc_download.cmake | 4 ++-- cpp/apps/CMakeLists.txt | 9 ++++++++- cpp/tests/CMakeLists.txt | 8 +++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/3rdparty/webrtc/webrtc_download.cmake b/3rdparty/webrtc/webrtc_download.cmake index 3ae6097e6da..c5c9ab78b7b 100644 --- a/3rdparty/webrtc/webrtc_download.cmake +++ b/3rdparty/webrtc/webrtc_download.cmake @@ -19,12 +19,12 @@ if (APPLE) ) set(WEBRTC_SHA256 3c2592a3bd9efcee591924007857342fec3753e2ae68695baeb2b8774f0e3abc) elseif (WIN32) - if (BUILD_SHARED_LIBS AND STATIC_WINDOWS_RUNTIME) + if (BUILD_SHARED_LIBS AND STATIC_WINDOWS_RUNTIME AND NOT BUILD_SYCL_MODULE) message(FATAL_ERROR "Pre-built WebRTC does not support " "BUILD_SHARED_LIBS=ON with STATIC_WINDOWS_RUNTIME=ON. Use " "STATIC_WINDOWS_RUNTIME=OFF or BUILD_WEBRTC_FROM_SOURCE=ON.") endif() - if(STATIC_WINDOWS_RUNTIME) + if(STATIC_WINDOWS_RUNTIME AND NOT BUILD_SYCL_MODULE) set(WEBRTC_DEBUG_TAG Debug_mt) set(WEBRTC_DEBUG_SHA256 b537cce72f758fbcd214fbca80ecfb26228d23c728119abc499c4b333e5f0786) set(WEBRTC_RELEASE_TAG Release_mt) diff --git a/cpp/apps/CMakeLists.txt b/cpp/apps/CMakeLists.txt index de28eb9179f..ef905bafaee 100644 --- a/cpp/apps/CMakeLists.txt +++ b/cpp/apps/CMakeLists.txt @@ -87,10 +87,17 @@ macro(open3d_add_app_gui SRC_DIR APP_NAME TARGET_NAME) # MSVC puts the binary in bin/Open3D/Release/Open3D.exe # so we can't just install() the build results, and need to do them piecemeal. + get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if (IS_MULTI_CONFIG) + set(APP_BINARY_DIR "${APP_DIR}/$") + else() + set(APP_BINARY_DIR "${APP_DIR}") + endif() + install(DIRECTORY "${APP_DIR}/resources" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/${APP_NAME}" USE_SOURCE_PERMISSIONS) - install(FILES "${APP_DIR}/$/${TARGET_NAME}.exe" + install(FILES "${APP_BINARY_DIR}/${TARGET_NAME}.exe" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/${APP_NAME}" RENAME "${APP_NAME}.exe") else() diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 761a586879e..69b016855b9 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -56,10 +56,16 @@ open3d_set_global_properties(tests) # source (bare "tbb" target, aliased to TBB::tbb) and when it's found via the oneAPI # TBB package for SYCL builds (only TBB::tbb is defined, no bare "tbb" target). if (WIN32) + get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if (IS_MULTI_CONFIG) + set(TBB_COPY_DEST_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/") + else() + set(TBB_COPY_DEST_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/") + endif() add_custom_command( TARGET tests POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/" + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ "${TBB_COPY_DEST_DIR}" ) endif()