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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] =?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 )