Repository navigation
executable file
·716 lines (661 loc) · 31 KB
/
Copy pathwindows.yml
File metadata and controls
executable file
·716 lines (661 loc) · 31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# FIXME:
# - librealsense upgrade needed to build with MSVC 17
# - MSVC 17 and CUDA 12.4+ error while building CreateCUDAHashBackend.cu (Debug only)
# - 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: {}
on:
workflow_dispatch:
inputs:
developer_build:
description: "Set to OFF for Release wheels"
required: false
default: "ON"
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize] # Rebuild on new pushes to PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
PIP_VER: "24.3.1"
CUDA_VERSION: "12.6.3"
SRC_DIR: "D:\\a\\open3d\\open3d"
BUILD_DIR: "C:\\Open3D\\build"
INSTALL_DIR: "C:\\Program Files\\Open3D"
NPROC: 6
DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }}
jobs:
build-lib:
name: Build lib
permissions:
contents: write # upload
id-token: write
attestations: write
artifact-metadata: write
runs-on: windows-2022
strategy:
fail-fast: false
# Seven 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:
include:
# OFF/ON: static lib + /MT -> for viewer
- BUILD_SHARED_LIBS: OFF
STATIC_RUNTIME: ON
device: cpu
CONFIG: Release
# Shared Windows CUDA Release
- BUILD_SHARED_LIBS: ON
STATIC_RUNTIME: OFF
device: cuda
CONFIG: Release
# Shared Windows CPU Release
- BUILD_SHARED_LIBS: ON
STATIC_RUNTIME: OFF
device: cpu
CONFIG: Release
# Shared Windows SYCL/XPU Release
- BUILD_SHARED_LIBS: ON
STATIC_RUNTIME: OFF
device: xpu
CONFIG: Release
# Shared Windows SYCL/XPU Debug
# TODO: Restore after Windows ninja + IntelLLVM debug builds are fixed in cmake
# (or restrict IntelLLVM to sycl code only)
# - BUILD_SHARED_LIBS: ON
# STATIC_RUNTIME: OFF
# device: xpu
# CONFIG: Debug
# Shared Windows CPU Debug -> Debug only with CPU + shared lib
- BUILD_SHARED_LIBS: ON
STATIC_RUNTIME: OFF
device: cpu
CONFIG: Debug
env:
BUILD_CUDA_MODULE: ${{ matrix.device == 'cuda' && 'ON' || 'OFF' }}
BUILD_SYCL_MODULE: ${{ matrix.device == 'xpu' && 'ON' || 'OFF' }}
BUILD_PYTORCH_OPS: ${{ ( matrix.device == 'cuda' || matrix.CONFIG == 'Debug' ) && 'OFF' || 'ON' }} # FIXME
steps:
- name: Disk space used
run: Get-PSDrive
- name: Checkout source code
uses: actions/checkout@v4
- name: Install CUDA
if: ${{ matrix.device == 'cuda' }}
shell: pwsh
run: ./util/install_cuda_windows.ps1
- name: Install Intel oneAPI
if: ${{ matrix.device == 'xpu' }}
shell: pwsh
working-directory: ${{ env.SRC_DIR }}
run: ./util/install_oneapi_windows.ps1
- name: Install glslang via vcpkg
run: |
# Classic mode: repo vcpkg.json enables manifest mode, which rejects
# ad-hoc package installs used only for glslangValidator on CI.
vcpkg install --classic glslang[tools]:x64-windows
# Write install path to GITHUB_PATH to persist for future steps
$glslangBinPath = Join-Path $env:VCPKG_INSTALLATION_ROOT "installed\x64-windows\tools\glslang"
$glslangBinPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set up Python version
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Checkout Open3D-ML
uses: actions/checkout@v4
with:
repository: isl-org/Open3D-ML
path: open3d_ml
- name: Install PyTorch requirements
if: ${{ env.BUILD_PYTORCH_OPS == 'ON' }}
run: |
if ( '${{ matrix.device }}' -eq 'cuda' ) {
python -m pip install -r open3d_ml/requirements-torch-cuda.txt
} elseif ( '${{ matrix.device }}' -eq 'xpu' ) {
python -m pip install -r open3d_ml/requirements-torch-xpu.txt
} else {
python -m pip install -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 }}'
if ($Env:DEVELOPER_BUILD -ne "OFF") {
$Env:DEVELOPER_BUILD = "ON"
}
cmake --version
$CMAKE_ARGS = @()
if ('${{ matrix.device }}' -eq 'xpu') {
# Runs setvars.bat via cmd and imports all resulting env vars into
# the current PowerShell process AND into $GITHUB_ENV. The latter
# is required because each workflow step ("Config", "Build",
# "Package", ...) runs in a brand new process: env vars set only
# via [System.Environment]::SetEnvironmentVariable (default scope
# Process) do NOT survive past this step. Without $GITHUB_ENV,
# later steps (e.g. Build) lose LIB/INCLUDE/PATH set by
# setvars.bat, so icx fails to find its own runtime libs (e.g.
# libircmt.lib) when ExternalProject sub-builds (zlib,
# directxheaders, ...) run their own fresh compiler ABI detection
# during the Build step.
Write-Host "Initializing oneAPI environment via setvars.bat..."
$setOutput = cmd /c '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && set 2>&1'
if ($LASTEXITCODE -ne 0) { throw "setvars.bat failed (exit $LASTEXITCODE)" }
$setOutput | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$') {
$varName = $Matches[1]
$varValue = $Matches[2]
[System.Environment]::SetEnvironmentVariable($varName, $varValue)
"$varName=$varValue" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
}
}
$CMAKE_GENERATOR = "Ninja"
# 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"
$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'
}
# Keep 3rdparty downloads inside BUILD_DIR so the build artifact zip
# reused by build-wheel includes headers (e.g. vk_mem_alloc.hpp) that
# ExternalProject stamps would otherwise skip re-downloading on a
# fresh checkout. build-lib builds the C++ library only
# (BUILD_PYTHON_MODULE=OFF); build-wheel reuses it to build the wheel.
cmake -G $CMAKE_GENERATOR @CMAKE_ARGS @cmakeExtraArgs `
-DDEVELOPER_BUILD="${{ github.event.inputs.developer_build || 'ON' }}" `
-DBUILD_EXAMPLES=OFF `
-DBUILD_PYTHON_MODULE=OFF `
-DCMAKE_INSTALL_PREFIX="$env:INSTALL_DIR" `
-DOPEN3D_THIRD_PARTY_DOWNLOAD_DIR="$env:BUILD_DIR/3rdparty_downloads" `
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} `
-DSTATIC_WINDOWS_RUNTIME=${{ matrix.STATIC_RUNTIME }} `
-DBUILD_COMMON_ISPC_ISAS=ON `
-DBUILD_GUI=ON `
-DBUILD_AZURE_KINECT=ON `
-DBUILD_LIBREALSENSE=ON `
-DBUILD_WEBRTC=ON `
-DBUILD_UNIT_TESTS=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 }}
- name: Build (build-lib)
working-directory: ${{ env.BUILD_DIR }}
run: |
$ErrorActionPreference = 'Stop'
$buildArgs = @("--build", ".", "--parallel", "${{ env.NPROC }}")
if ('${{ matrix.device }}' -ne 'xpu') {
$buildArgs += "--config", "${{ matrix.CONFIG }}"
}
cmake @buildArgs --target build-examples-iteratively
# Use lowercase "install" (works case-insensitively for MSBuild/VS
# generator too) since Ninja's generated meta-target is lowercase
# only; uppercase "INSTALL" is unknown to Ninja.
cmake @buildArgs --target install
- name: Package
working-directory: ${{ env.BUILD_DIR }}
if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' }}
run: |
$ErrorActionPreference = 'Stop'
$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'}
}
$DEVEL_PKG_NAME=(Get-ChildItem package/open3d-devel-*.zip).Name
echo "DEVEL_PKG_NAME=$DEVEL_PKG_NAME" | Out-File -FilePath `
$Env:GITHUB_ENV -Encoding utf8 -Append
- name: Generate package attestation
if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' }}
uses: actions/attest@v4
with:
subject-path: ${{ env.BUILD_DIR }}/package/${{ env.DEVEL_PKG_NAME }}
- name: Upload Package
if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' }}
uses: actions/upload-artifact@v4
with:
name: open3d-devel-windows-${{ matrix.device == 'xpu' && 'sycl' || matrix.device }}-${{ matrix.CONFIG }}
path: ${{ env.BUILD_DIR }}/package/${{ env.DEVEL_PKG_NAME }}
if-no-files-found: error
- name: Update devel release with package
if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' }}
env:
GH_TOKEN: ${{ github.token }}
shell: bash
working-directory: ${{ env.BUILD_DIR }}
run: |
$GITHUB_WORKSPACE/.github/workflows/update_release.sh package/${{ env.DEVEL_PKG_NAME }}
- name: Viewer App
working-directory: ${{ env.BUILD_DIR }}
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 }} `
--target Open3DViewer
Remove-Item -LiteralPath $env:INSTALL_DIR -Recurse -Force -ErrorAction SilentlyContinue
cmake --install . --config ${{ matrix.CONFIG }} --component Unspecified
$version = (Select-String -Path "${{ env.BUILD_DIR }}/CMakeCache.txt" `
-Pattern "OPEN3D_VERSION_FULL").Line.Split('=')[1]
$viewerZip = "${{ env.BUILD_DIR }}/open3d-$version-app-windows-amd64.zip"
Compress-Archive -Path "${{ env.INSTALL_DIR }}/bin/Open3D" `
-DestinationPath $viewerZip
"VIEWER_ZIP_PATH=$viewerZip" | Out-File -FilePath $Env:GITHUB_ENV `
-Encoding utf8 -Append
- name: Upload Viewer
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
path: ${{ env.VIEWER_ZIP_PATH }}
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.device == 'cpu' && matrix.CONFIG == 'Release' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
bash .github/workflows/update_release.sh "${{ env.VIEWER_ZIP_PATH }}"
- name: Setup WinApp CLI
if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.device == 'cpu' && matrix.CONFIG == 'Release' }}
uses: microsoft/setup-WinAppCli@v0.1
- name: Build MSIX
working-directory: ${{ env.BUILD_DIR }}
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 }} `
--target Open3DViewerMSIX
- name: Upload MSIX test package
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-msix-amd64
path: |
${{ env.MSIX_PATH }}
${{ env.BUILD_DIR }}\msix-package\Open3D.cer
if-no-files-found: error
- name: Run C++ unit tests
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."
$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: |
$ErrorActionPreference = 'Stop'
mkdir build
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_GENERATOR = "Ninja"
# 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 }}"
# SYCL Open3D is always built with the dynamic runtime (/MD): icx
# -fsycl rejects the static runtime (/MT). The downstream example
# must match, otherwise linking Open3D.lib (/MD) into Draw (/MT)
# fails with LNK2038, so force STATIC_WINDOWS_RUNTIME=OFF here
# regardless of matrix.STATIC_RUNTIME.
$STATIC_RUNTIME = "OFF"
} else {
$CMAKE_GENERATOR = "Visual Studio 17 2022"
$CMAKE_ARGS += "-A", "x64"
$STATIC_RUNTIME = "${{ matrix.STATIC_RUNTIME }}"
}
cmake -G $CMAKE_GENERATOR @CMAKE_ARGS `
-DCMAKE_INSTALL_PREFIX="$env:INSTALL_DIR" `
-DSTATIC_WINDOWS_RUNTIME=$STATIC_RUNTIME `
..
$buildArgs = @("--build", ".")
if ('${{ matrix.device }}' -ne 'xpu') {
$buildArgs += "--config", "${{ matrix.CONFIG }}"
}
cmake @buildArgs
if ( '${{ matrix.device }}' -ne 'cuda' ) { # FIXME
$drawExe = if ('${{ matrix.device }}' -eq 'xpu') { ".\Draw.exe" } else { ".\${{ matrix.CONFIG }}\Draw.exe" }
& $drawExe --skip-for-unit-test
}
Remove-Item -LiteralPath $env:INSTALL_DIR -Recurse -Force -ErrorAction SilentlyContinue
- name: Disk space used
run: Get-PSDrive
build-wheel:
name: Build wheel
permissions:
contents: write # upload
id-token: write
attestations: write
artifact-metadata: write
runs-on: windows-2022
needs: build-lib
# Build wheels even if build-lib failed (e.g. flaky unit tests): still run
# whichever matrix legs have devel package artifacts available.
if: ${{ always() && !cancelled() }}
strategy:
fail-fast: false
# 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, cuda]
is_main:
- ${{ github.ref == 'refs/heads/main' }}
exclude:
- is_main: false
python_version: '3.10'
- is_main: false
python_version: '3.11'
- is_main: false
python_version: '3.12'
- is_main: false
python_version: '3.13'
env:
BUILD_CUDA_MODULE: ${{ matrix.device == 'cuda' && 'ON' || 'OFF' }}
BUILD_SYCL_MODULE: ${{ matrix.device == 'xpu' && 'ON' || 'OFF' }}
BUILD_PYTORCH_OPS: ${{ matrix.device == 'cuda' && 'OFF' || 'ON' }}
# Bundles the Open3D-ML models and pipelines when ML ops are built.
OPEN3D_ML_ROOT: ${{ github.workspace }}/open3d_ml
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install CUDA
if: ${{ matrix.device == 'cuda' }}
shell: pwsh
run: ./util/install_cuda_windows.ps1
- name: Install Intel oneAPI
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: Checkout Open3D-ML
uses: actions/checkout@v4
with:
repository: isl-org/Open3D-ML
path: open3d_ml
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
# Build pybind (+ ML ops) against the devel package produced by build-lib's
# "Package" step (find_package(Open3D), OPEN3D_USE_INSTALLED_LIBRARY=ON),
# instead of recompiling/reconfiguring the whole C++ core per Python version.
# Ignore failure if the specific device's devel package is missing, so other devices
# in the matrix are not blocked.
- name: Download devel package
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: open3d-devel-windows-${{ matrix.device == 'xpu' && 'sycl' || matrix.device }}-Release
path: ${{ env.SRC_DIR }}/open3d_devel
- name: Extract devel package
id: extract_devel
run: |
$ErrorActionPreference = 'Stop'
$zip = Get-ChildItem "${{ env.SRC_DIR }}/open3d_devel/open3d-devel-*.zip" -ErrorAction SilentlyContinue | Select-Object -First 1
if (-not $zip) {
Write-Warning "Devel package zip not found for ${{ matrix.device }}! Skipping build."
echo "SKIPPED=true" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
exit 0
}
Expand-Archive -Path $zip.FullName -DestinationPath "${{ env.SRC_DIR }}/open3d_devel_extracted" -Force
$config = Get-ChildItem "${{ env.SRC_DIR }}/open3d_devel_extracted" -Recurse -Filter Open3DConfig.cmake | Select-Object -First 1
if (-not $config) {
throw "Open3DConfig.cmake not found in extracted devel package"
}
$root = $config.Directory.Parent
echo "OPEN3D_INSTALL_ROOT=$($root.FullName)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "SKIPPED=false" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Install Python dependencies
if: ${{ env.SKIPPED != 'true' }}
working-directory: ${{ env.SRC_DIR }}
run: |
$ErrorActionPreference = 'Stop'
python -m pip install -U pip==${{ env.PIP_VER }}
# maturin>1.7.8 breaks dependency y-py (Python 3.12) and pywinpty (Python 3.8) wheel building
# https://github.com/MichaIng/DietPi/issues/7329#issuecomment-2565130837
python -m pip install maturin==1.7.8
python -m pip install -U -r python/requirements.txt `
-r python/requirements_build.txt `
-r python/requirements_jupyter_build.txt
if ('${{ env.BUILD_CUDA_MODULE }}' -eq 'ON') {
python -m pip install -U -r python/requirements_win_cuda.txt
}
if ('${{ env.BUILD_SYCL_MODULE }}' -eq 'ON') {
python -m pip install -U -r python/requirements_sycl.txt
}
if (('${{ env.BUILD_TENSORFLOW_OPS }}' -eq 'ON') -or
('${{ env.BUILD_PYTORCH_OPS }}' -eq 'ON')) {
python -m pip install -U -r open3d_ml/requirements.txt
}
if ('${{ env.BUILD_PYTORCH_OPS }}' -eq 'ON') {
if ('${{ matrix.device }}' -eq 'xpu') {
python -m pip install -U -r open3d_ml/requirements-torch-xpu.txt
} else {
python -m pip install -U -r open3d_ml/requirements-torch.txt
}
}
- name: Config
if: ${{ env.SKIPPED != 'true' }}
# Move build directory to C: https://github.com/actions/virtual-environments/issues/1341
run: |
$ErrorActionPreference = 'Stop'
New-Item -Path '${{ env.BUILD_DIR }}' -ItemType Directory -Force
cd '${{ env.BUILD_DIR }}'
if ($Env:DEVELOPER_BUILD -ne "OFF") {
$Env:DEVELOPER_BUILD = "ON"
}
cmake --version
$CMAKE_ARGS = @()
if ('${{ matrix.device }}' -eq 'xpu') {
# Runs setvars.bat via cmd and imports all resulting env vars into
# the current PowerShell process AND into $GITHUB_ENV. The latter
# is required because each workflow step ("Config", "Build Python
# package", ...) runs in a brand new process: env vars set only
# via [System.Environment]::SetEnvironmentVariable (default scope
# Process) do NOT survive past this step. Without $GITHUB_ENV,
# later steps (e.g. Build) lose LIB/INCLUDE/PATH set by
# setvars.bat, so icx fails to find its own runtime libs (e.g.
# libircmt.lib).
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 '^([^=]+)=(.*)$') {
$varName = $Matches[1]
$varValue = $Matches[2]
[System.Environment]::SetEnvironmentVariable($varName, $varValue)
"$varName=$varValue" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
}
}
$CMAKE_GENERATOR = "Ninja"
# On Windows, icx.exe (MSVC-compatible) handles C++ and SYCL (-fsycl).
# See build-lib's 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"
$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'
}
# Build pybind (+ ML ops) only, against the devel package extracted
# above (find_package(Open3D)); skips recompiling the C++ core.
# STATIC_WINDOWS_RUNTIME=OFF must match the installed Open3D.dll's
# runtime linkage (/MD), otherwise pybind fails to link against it.
cmake -G $CMAKE_GENERATOR @CMAKE_ARGS @cmakeExtraArgs `
-DOPEN3D_USE_INSTALLED_LIBRARY=ON `
-DOpen3D_ROOT="$env:OPEN3D_INSTALL_ROOT" `
-DCMAKE_PREFIX_PATH="$env:OPEN3D_INSTALL_ROOT" `
-DCMAKE_INSTALL_PREFIX="$env:INSTALL_DIR" `
-DDEVELOPER_BUILD="${{ github.event.inputs.developer_build || 'ON' }}" `
-DOPEN3D_THIRD_PARTY_DOWNLOAD_DIR="$env:BUILD_DIR/3rdparty_downloads" `
-DBUILD_SHARED_LIBS=ON `
-DSTATIC_WINDOWS_RUNTIME=OFF `
-DBUILD_GUI=ON `
-DBUILD_PYTHON_MODULE=ON `
-DBUILD_AZURE_KINECT=ON `
-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 }} `
-DPython3_EXECUTABLE=$((Get-Command python).Source) `
${{ env.SRC_DIR }}
- name: Build Python package
if: ${{ env.SKIPPED != 'true' }}
working-directory: ${{ env.BUILD_DIR }}
run: |
$ErrorActionPreference = 'Stop'
$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
- name: Generate wheel attestation
if: ${{ github.ref == 'refs/heads/main' && env.SKIPPED != 'true' }}
uses: actions/attest@v4
with:
subject-path: ${{ env.BUILD_DIR }}/lib/python_package/pip_package/${{ env.PIP_PKG_NAME }}
- name: Upload wheel
if: ${{ env.SKIPPED != 'true' }}
uses: actions/upload-artifact@v4
with:
name: open3d-wheel-${{ matrix.device }}-${{ matrix.python_version }}
path: ${{ env.BUILD_DIR }}/lib/python_package/pip_package/${{ env.PIP_PKG_NAME }}
if-no-files-found: error
- name: Update devel release with wheel
if: ${{ env.SKIPPED != 'true' && github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
shell: bash
working-directory: ${{ env.BUILD_DIR }}
run: |
$GITHUB_WORKSPACE/.github/workflows/update_release.sh lib/python_package/pip_package/${{ env.PIP_PKG_NAME }}
test-wheel:
name: Test wheel
permissions:
contents: read
runs-on: windows-2022
needs: [build-wheel]
if: ${{ always() && !cancelled() }}
strategy:
fail-fast: false
matrix:
python_version: ['3.10', '3.11', '3.12', '3.13', '3.14']
device: [cpu, xpu, cuda]
is_main:
- ${{ github.ref == 'refs/heads/main' }}
exclude:
- is_main: false
python_version: '3.10'
- is_main: false
python_version: '3.11'
- is_main: false
python_version: '3.12'
- is_main: false
python_version: '3.13'
env:
BUILD_PYTORCH_OPS: ${{ matrix.device == 'cuda' && 'OFF' || 'ON' }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Checkout Open3D-ML
uses: actions/checkout@v4
with:
repository: isl-org/Open3D-ML
path: open3d_ml
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: open3d-wheel-${{ matrix.device }}-${{ matrix.python_version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Test Python package
run: |
$ErrorActionPreference = 'Stop'
python -V
python -m venv open3d_test_venv
open3d_test_venv\Scripts\Activate.ps1
python -m pip install -U pip==${{ env.PIP_VER }}
python -m pip install -U -r python/requirements_build.txt `
-r python/requirements_test.txt
if ('${{ env.BUILD_PYTORCH_OPS }}' -eq 'ON') {
if ('${{ matrix.device }}' -eq 'xpu') {
python -m pip install -U -r open3d_ml/requirements-torch-xpu.txt
} else {
python -m pip install -U -r open3d_ml/requirements-torch.txt
}
}
$PIP_PKG_NAME = (Get-ChildItem *.whl -ErrorAction SilentlyContinue | Select-Object -First 1).FullName
if (-not $PIP_PKG_NAME) {
$PIP_PKG_NAME = (Get-ChildItem -Recurse *.whl -ErrorAction SilentlyContinue | Select-Object -First 1).FullName
}
if (-not $PIP_PKG_NAME) {
Write-Error "Could not find a valid Open3D wheel!"
exit 1
}
echo "Installing Open3D wheel $PIP_PKG_NAME in virtual environment..."
python -m pip install $PIP_PKG_NAME
# Wheels bundling Open3D-ML declare its Python dependencies as the
# `ml` extra, needed by the models, pipelines and datasets.
$bundlesML = python -c "import open3d; print(open3d._build_config['BUNDLE_OPEN3D_ML'])" |
Select-Object -Last 1
if ($bundlesML.Trim() -eq 'True') { python -m pip install "${PIP_PKG_NAME}[ml]" }
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
# No CUDA GPUs, so skip CUDA python tests
if: ${{ matrix.device != 'cuda' }}
run: |
$ErrorActionPreference = 'Stop'
open3d_test_venv\Scripts\Activate.ps1
echo "Running Open3D python tests..."
echo "Add --randomly-seed=SEED to the test command to reproduce test order."
python -m pytest python/test/
deactivate