Skip to content

Commit 81201f9

Browse files
authored
Fix CI tests - macOS, Ubuntu, SYCL (#7087)
* Cache storage change: gz->xz, 5->4GB * Use github OS default xcode versions. Each macOS version now comes with a single xcode version. * Add SYCL fallback CPU device as last SYCL device to allow distinguishing CPU and GPU devices. * Hide symbols from core and visualization to reduce Windows DLL size. * Skip last SYCL device (CPU fallback) in testing * Disable MSVC std compliance due to PoissonRecon header error
1 parent 601516a commit 81201f9

18 files changed

Lines changed: 182 additions & 117 deletions

.github/workflows/macos.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
# macos-12 is Intel runner, macos-14 is Apple Silicon
35+
# macos-13 is Intel runner, macos-14 is Apple Silicon
3636
# https://github.com/actions/runner-images
37-
os: [macos-12, macos-14]
37+
os: [macos-13, macos-14]
3838
CONFIG: [ON, OFF]
3939
env:
4040
BUILD_SHARED_LIBS: ${{ matrix.CONFIG }}
@@ -68,23 +68,16 @@ jobs:
6868
run: |
6969
brew install ccache pkg-config
7070
71-
if [[ ${{ runner.arch}} == "ARM64" ]]; then
71+
if [[ ${{ runner.arch }} == "ARM64" ]]; then
7272
# Fix gfortran not found issue
7373
ln -s $(which gfortran-13) /usr/local/bin/gfortran
74-
75-
# Default macos-14 image Xcode (version 15.0.1) linker causes build issues.
76-
# Newer Xcode versions work, but embree recommends Apple clang <= 14 on
77-
# arm64 to avoid possible "EXEC_BAD_INSTRUCTION" runtime exceptions:
78-
# https://github.com/embree/embree/releases/tag/v4.3.1
79-
sudo xcode-select -switch /Applications/Xcode_14.3.1.app
8074
fi
8175
8276
# Install libomp 11.1.0 from old brew bottle for x64 catalina (10.15)
8377
# / arm64 big sur (11.0). Directly installing the Ruby formula will
8478
# install for the current OS.
8579
# https://github.com/microsoft/LightGBM/issues/4229
8680
if [[ ${{ runner.arch}} == "X64" ]]; then
87-
brew unlink libomp
8881
# x64 catalina (10.15) bottle
8982
export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
9083
else # ARM64
@@ -142,7 +135,7 @@ jobs:
142135
permissions:
143136
contents: write # Release upload
144137
name: Fuse x64 and ARM64 viewer app
145-
runs-on: [macos-12]
138+
runs-on: [macos-13]
146139
needs: [MacOS]
147140
steps:
148141
- name: Checkout source code # for gh release upload
@@ -191,9 +184,9 @@ jobs:
191184
fail-fast: false
192185
# https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6
193186
matrix:
194-
# macos-12 is Intel runner, macos-14 is Apple Silicon
187+
# macos-13 is Intel runner, macos-14 is Apple Silicon
195188
# https://github.com/actions/runner-images
196-
os: [macos-12, macos-14]
189+
os: [macos-13, macos-14]
197190
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
198191
is_main:
199192
- ${{ github.ref == 'refs/heads/main' }}
@@ -260,12 +253,10 @@ jobs:
260253
# Fix macos-14 arm64 runner image issues, see comments in MacOS job.
261254
if [[ ${{ runner.arch}} == "ARM64" ]]; then
262255
ln -s $(which gfortran-13) /usr/local/bin/gfortran
263-
sudo xcode-select -switch /Applications/Xcode_14.3.1.app
264256
fi
265257
266258
# Install libomp 11.1.0. See comment above.
267259
if [[ ${{ runner.arch}} == "X64" ]]; then
268-
brew unlink libomp
269260
# x64 catalina (10.15) bottle
270261
export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
271262
else # ARM64
@@ -308,7 +299,7 @@ jobs:
308299
name: Fuse universal2 wheel
309300
permissions:
310301
contents: write # Release upload
311-
runs-on: [macos-12]
302+
runs-on: [macos-13]
312303
needs: [build-wheel]
313304
strategy:
314305
fail-fast: false
@@ -379,7 +370,7 @@ jobs:
379370
strategy:
380371
fail-fast: false
381372
matrix:
382-
os: [macos-12, macos-14]
373+
os: [macos-13, macos-14]
383374
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
384375
is_main:
385376
- ${{ github.ref == 'refs/heads/main' }}

.github/workflows/ubuntu-cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
gcloud compute ssh "${INSTANCE_NAME}" \
181181
--zone="${GCE_ZONE}" \
182182
--command="ls -alh \
183-
&& gsutil cp ${CCACHE_TAR_NAME}.tar.gz gs://open3d-ci-cache/"
183+
&& gsutil cp ${CCACHE_TAR_NAME}.tar.xz gs://open3d-ci-cache/"
184184
185185
- name: VM delete
186186
if: always()

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ if(WIN32)
476476
# Then, we could use -fvisibility=hidden for Linux as well
477477
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
478478
if(MSVC)
479+
# MSVC standards-compliant mode: Error in PoissonRecon 3rd party header
480+
# add_compile_options($<$<COMPILE_LANGUAGE:CXX>:"/permissive-">)
479481
# Make sure we don't hit the 65535 object member limit with MSVC
480482
#
481483
# /bigobj allows object files with more than 65535 members

cpp/open3d/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ target_sources(Open3D PRIVATE
8989
open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE
9090
camera
9191
core
92+
core_impl
9293
data
9394
geometry
9495
tgeometry
@@ -101,6 +102,7 @@ open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE
101102
tpipelines_kernel
102103
utility
103104
visualization
105+
visualization_impl
104106
)
105107

106108
if (BUILD_GUI)

cpp/open3d/core/CMakeLists.txt

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,7 @@ target_sources(core PRIVATE
4141
hashmap/HashBackendBuffer.cpp
4242
hashmap/HashMap.cpp
4343
hashmap/HashSet.cpp
44-
kernel/Arange.cpp
45-
kernel/ArangeCPU.cpp
46-
kernel/BinaryEW.cpp
47-
kernel/BinaryEWCPU.cpp
48-
kernel/IndexGetSet.cpp
49-
kernel/IndexGetSetCPU.cpp
50-
kernel/IndexReduction.cpp
51-
kernel/IndexReductionCPU.cpp
5244
kernel/Kernel.cpp
53-
kernel/NonZero.cpp
54-
kernel/NonZeroCPU.cpp
55-
kernel/Reduction.cpp
56-
kernel/ReductionCPU.cpp
57-
kernel/UnaryEW.cpp
58-
kernel/UnaryEWCPU.cpp
59-
kernel/UnaryEWSYCL.cpp
6045
linalg/AddMM.cpp
6146
linalg/AddMMCPU.cpp
6247
linalg/Det.cpp
@@ -82,11 +67,33 @@ target_sources(core PRIVATE
8267
nns/NNSIndex.cpp
8368
)
8469

70+
# core_impl contains the implementation of core functions that are not exposed in the public API
71+
open3d_ispc_add_library(core_impl OBJECT)
72+
set_target_properties(core_impl PROPERTIES CXX_VISIBILITY_PRESET "hidden")
73+
74+
target_sources(core_impl PRIVATE
75+
kernel/Arange.cpp
76+
kernel/ArangeCPU.cpp
77+
kernel/BinaryEW.cpp
78+
kernel/BinaryEWCPU.cpp
79+
kernel/IndexGetSet.cpp
80+
kernel/IndexGetSetCPU.cpp
81+
kernel/IndexReduction.cpp
82+
kernel/IndexReductionCPU.cpp
83+
kernel/NonZero.cpp
84+
kernel/NonZeroCPU.cpp
85+
kernel/Reduction.cpp
86+
kernel/ReductionCPU.cpp
87+
kernel/UnaryEW.cpp
88+
kernel/UnaryEWCPU.cpp
89+
kernel/UnaryEWSYCL.cpp
90+
)
91+
8592
if (BUILD_CUDA_MODULE)
8693
target_sources(core PRIVATE
8794
MemoryManagerCUDA.cpp
8895
)
89-
target_sources(core PRIVATE
96+
target_sources(core_impl PRIVATE
9097
hashmap/CUDA/CreateCUDAHashBackend.cu
9198
hashmap/CUDA/CUDAHashBackendBuffer.cu
9299
hashmap/CUDA/SlabNodeManager.cu
@@ -116,6 +123,8 @@ endif()
116123
if (BUILD_ISPC_MODULE)
117124
target_sources(core PRIVATE
118125
Indexer.ispc
126+
)
127+
target_sources(core_impl PRIVATE
119128
kernel/BinaryEWCPU.ispc
120129
kernel/UnaryEWCPU.ispc
121130
)
@@ -126,6 +135,12 @@ open3d_set_global_properties(core)
126135
open3d_set_open3d_lib_properties(core)
127136
open3d_link_3rdparty_libraries(core)
128137

138+
open3d_show_and_abort_on_warning(core_impl)
139+
open3d_set_global_properties(core_impl)
140+
open3d_set_open3d_lib_properties(core_impl)
141+
open3d_link_3rdparty_libraries(core_impl)
142+
129143
if(BUILD_CUDA_MODULE)
130144
target_include_directories(core SYSTEM PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
145+
target_include_directories(core_impl SYSTEM PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
131146
endif()

cpp/open3d/core/SYCLContext.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ SYCLContext::SYCLContext() {
5454
} catch (const sycl::exception &e) {
5555
}
5656

57-
if (devices_.size() == 0) {
58-
// SYCL CPU fallback.
59-
// This could happen if the Intel GPGPU driver is not installed or if
60-
// your CPU does not have integrated GPU.
61-
try {
62-
const sycl::device &sycl_device =
63-
sycl::device(sycl::cpu_selector_v);
64-
const Device open3d_device = Device("SYCL:0");
57+
// SYCL CPU fallback.
58+
// This could happen if the Intel GPGPU driver is not installed or if
59+
// your CPU does not have integrated GPU.
60+
try {
61+
if (devices_.size() == 0) {
6562
utility::LogWarning(
6663
"SYCL GPU device is not available, falling back to SYCL "
6764
"host device.");
68-
devices_.push_back(open3d_device);
69-
device_to_sycl_device_[open3d_device] = sycl_device;
70-
device_to_default_queue_[open3d_device] = sycl::queue(sycl_device);
71-
} catch (const sycl::exception &e) {
7265
}
66+
const sycl::device &sycl_device = sycl::device(sycl::cpu_selector_v);
67+
const Device open3d_device =
68+
Device("SYCL:" + std::to_string(devices_.size()));
69+
devices_.push_back(open3d_device);
70+
device_to_sycl_device_[open3d_device] = sycl_device;
71+
device_to_default_queue_[open3d_device] = sycl::queue(sycl_device);
72+
} catch (const sycl::exception &e) {
7373
}
7474

7575
if (devices_.size() == 0) {

cpp/open3d/core/SYCLUtils.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,32 @@ static std::string SYCLDeviceToString(const sycl::device &device) {
118118

119119
void PrintSYCLDevices(bool print_all) {
120120
#ifdef BUILD_SYCL_MODULE
121-
const char *filter = std::getenv("SYCL_DEVICE_FILTER");
121+
const char *filter = std::getenv("ONEAPI_DEVICE_SELECTOR");
122122
if (filter) {
123123
utility::LogWarning(
124-
"SYCL_DEVICE_FILTER environment variable is set to {}. To see "
125-
"the correct device id, please unset SYCL_DEVICE_FILTER.",
124+
"ONEAPI_DEVICE_SELECTOR environment variable is set to {}. To "
125+
"see the correct device id, please unset "
126+
"ONEAPI_DEVICE_SELECTOR.",
126127
filter);
127128
}
128129

130+
int nd = 0;
131+
utility::LogInfo("# Open3D SYCL device");
132+
try {
133+
utility::LogInfo(
134+
"- Device(\"SYCL:{}\"): {}", nd,
135+
SYCLDeviceToString(sycl::device(sycl::gpu_selector_v)));
136+
++nd;
137+
} catch (const sycl::exception &e) {
138+
}
139+
try {
140+
utility::LogInfo("# Open3D SYCL device (CPU fallback)");
141+
utility::LogInfo(
142+
"- Device(\"SYCL:{}\"): {}", nd,
143+
SYCLDeviceToString(sycl::device(sycl::cpu_selector_v)));
144+
} catch (const sycl::exception &e) {
145+
if (nd == 0) utility::LogInfo("- Device(\"SYCL:0\"): N/A");
146+
}
129147
if (print_all) {
130148
utility::LogInfo("# All SYCL devices");
131149
const std::vector<sycl::platform> &platforms =
@@ -168,24 +186,6 @@ void PrintSYCLDevices(bool print_all) {
168186
} catch (const sycl::exception &e) {
169187
utility::LogInfo("- sycl::accelerator_selector_v: N/A");
170188
}
171-
172-
utility::LogInfo("# Open3D SYCL device");
173-
try {
174-
const sycl::device &device = sycl::device(sycl::gpu_selector_v);
175-
utility::LogInfo("- Device(\"SYCL:0\"): {}",
176-
SYCLDeviceToString(device));
177-
} catch (const sycl::exception &e) {
178-
utility::LogInfo("- Device(\"SYCL:0\"): N/A");
179-
}
180-
} else {
181-
utility::LogInfo("# Open3D SYCL device");
182-
try {
183-
const sycl::device &device = sycl::device(sycl::gpu_selector_v);
184-
utility::LogInfo("- Device(\"SYCL:0\"): {}",
185-
SYCLDeviceToString(device));
186-
} catch (const sycl::exception &e) {
187-
utility::LogInfo("- Device(\"SYCL:0\"): N/A");
188-
}
189189
}
190190

191191
#else

cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace open3d {
1919
namespace geometry {
20+
namespace {
2021

2122
class BallPivotingVertex;
2223
class BallPivotingEdge;
@@ -733,6 +734,7 @@ class BallPivoting {
733734
std::vector<BallPivotingVertexPtr> vertices;
734735
std::shared_ptr<TriangleMesh> mesh_;
735736
};
737+
} // namespace
736738

737739
std::shared_ptr<TriangleMesh> TriangleMesh::CreateFromPointCloudBallPivoting(
738740
const PointCloud& pcd, const std::vector<double>& radii) {

cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
namespace open3d {
4141
namespace geometry {
42-
namespace poisson {
42+
namespace {
4343

4444
// The order of the B-Spline used to splat in data for color interpolation
4545
static const int DATA_DEGREE = 0;
@@ -713,7 +713,7 @@ void Execute(const open3d::geometry::PointCloud& pcd,
713713
Time() - startTime, FEMTree<Dim, Real>::MaxMemoryUsage());
714714
}
715715

716-
} // namespace poisson
716+
} // namespace
717717

718718
std::tuple<std::shared_ptr<TriangleMesh>, std::vector<double>>
719719
TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd,
@@ -722,10 +722,9 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd,
722722
float scale,
723723
bool linear_fit,
724724
int n_threads) {
725-
static const BoundaryType BType = poisson::DEFAULT_FEM_BOUNDARY;
725+
static const BoundaryType BType = DEFAULT_FEM_BOUNDARY;
726726
typedef IsotropicUIntPack<
727-
poisson::DIMENSION,
728-
FEMDegreeAndBType</* Degree */ 1, BType>::Signature>
727+
DIMENSION, FEMDegreeAndBType</* Degree */ 1, BType>::Signature>
729728
FEMSigs;
730729

731730
if (!pcd.HasNormals()) {
@@ -746,8 +745,8 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd,
746745

747746
auto mesh = std::make_shared<TriangleMesh>();
748747
std::vector<double> densities;
749-
poisson::Execute<float>(pcd, mesh, densities, static_cast<int>(depth),
750-
width, scale, linear_fit, FEMSigs());
748+
Execute<float>(pcd, mesh, densities, static_cast<int>(depth), width, scale,
749+
linear_fit, FEMSigs());
751750

752751
ThreadPool::Terminate();
753752

0 commit comments

Comments
 (0)