Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
290 changes: 240 additions & 50 deletions .github/workflows/windows.yml

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions 3rdparty/README_SYCL.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ 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
``<venv>/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 <https://github.com/oneapi-src/oneapi-ci/tree/0804a4c9281440d8a91ac0680388b101e5f673ad>`_).

User:
- https://pypi.org/user/IntelAutomationEngineering/
Expand Down
7 changes: 6 additions & 1 deletion 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<$<PLATFORM_ID:Linux,Darwin>:$<$<COMPILE_LANGUAGE:CXX>:-m64>>")
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions cmake/Open3DPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions cpp/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/$<IF:$<BOOL:${BUILD_CUDA_MODULE}>,cuda,cpu>")
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Python/$<IF:$<BOOL:${BUILD_CUDA_MODULE}>,cuda,$<IF:$<BOOL:${BUILD_SYCL_MODULE}>,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
Expand Down
2 changes: 1 addition & 1 deletion cpp/pybind/make_python_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
16 changes: 13 additions & 3 deletions docs/sycl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------
Expand All @@ -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.

Expand All @@ -30,7 +31,9 @@ and (optionally) SYCL runtime for your `Nvidia
<https://developer.codeplay.com/products/oneapi/amd/download>`_ 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
<https://dgpu-docs.intel.com/driver/client/overview.html>`_ for your GPU. For
raycasting on Intel GPUs, you will also need the
`intel-level-zero-gpu-raytracing` package.
Expand All @@ -48,6 +51,13 @@ raycasting on Intel GPUs, you will also need the
- `Python 3.14 <https://github.com/isl-org/Open3D/releases/download/main-devel/open3d_xpu-0.19.0-cp314-cp314-manylinux_2_31_x86_64.whl>`__
- `C++ x86_64 <https://github.com/isl-org/Open3D/releases/download/v0.19.0/open3d_xpu-devel-linux-x86_64-0.19.0.tar.xz>`__

* - Windows SYCL
- `Python 3.10 <https://github.com/isl-org/Open3D/releases/download/main-devel/open3d_xpu-0.19.0-cp310-cp310-win_amd64.whl>`__
- `Python 3.11 <https://github.com/isl-org/Open3D/releases/download/main-devel/open3d_xpu-0.19.0-cp311-cp311-win_amd64.whl>`__
- `Python 3.12 <https://github.com/isl-org/Open3D/releases/download/main-devel/open3d_xpu-0.19.0-cp312-cp312-win_amd64.whl>`__
- `Python 3.13 <https://github.com/isl-org/Open3D/releases/download/main-devel/open3d_xpu-0.19.0-cp313-cp313-win_amd64.whl>`__
- `Python 3.14 <https://github.com/isl-org/Open3D/releases/download/main-devel/open3d_xpu-0.19.0-cp314-cp314-win_amd64.whl>`__

Usage
------

Expand Down
57 changes: 56 additions & 1 deletion python/open3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -27,8 +28,32 @@
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))
# 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(str(_p)))
except Exception:
pass

__DEVICE_API__ = "cpu"
if _build_config["BUILD_CUDA_MODULE"]:
Expand Down Expand Up @@ -85,7 +110,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:
Expand All @@ -96,6 +121,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 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:
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,
Expand Down Expand Up @@ -211,4 +264,6 @@ def _jupyter_nbextension_paths():

if sys.platform == "win32":
_win32_dll_dir.close()
for _d in _added_dll_dirs:
_d.close()
del os, sys, CDLL, find_library, Path, warnings, _insert_pybind_names
2 changes: 2 additions & 0 deletions python/open3d/ml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *

Expand Down
2 changes: 2 additions & 0 deletions python/open3d/ml/contrib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
4 changes: 4 additions & 0 deletions python/open3d/visualization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
94 changes: 94 additions & 0 deletions util/install_oneapi_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#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 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
)

$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:
$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 ":"

$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..."
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
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",
"--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
$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
}

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"
}
Loading
Loading