Open hooyahliu opened 8 months ago
When running the tutorial /examples/python/pipelines/rgbd_integration_uniform.py
I get a segmentation fault or the program hangs indefinitely at voxel_grid = volume.extract_voxel_grid()
.
The probable cause is that VoxelGrid
is a std::unordered_map
, which is not thread-safe, so OpenMP hangs forever or throws a segfault. Problematic line: voxel_grid->voxels_[index] = geometry::Voxel(index, color);
in cpp/open3d/pipelines/integration/UniformTSDFVolume.cpp
.
An easy fix would be to remove the OpenMP parallelization (fix 1.). Other possible fixes are (fix 2.) use tbb:concurrent_unordered_map
which is thread-safe, but then you have to convert it back to a std::unordered_map
(which I presume is O(n)?), or (fix 3.) use multiple std::unordered_map
s, one for each thread, and then merge them after the parallelization (which would be O(n) average case). I have tested fix 1. and fix 2. for multiple voxel resolutions (16, 32, 64, 128, 256, 512, 768), and their timings are practically the same. @ssheorey do you have any other ideas?
Checklist
main
branch).Describe the issue
When using Open3D 0.18.0 to execute self._volume.extract_voxel_grid() on the generated TSDF volume, the program exits with the error Segmentation fault (core dumped). But using 0.12.0 no error occurs.
Steps to reproduce the bug
Error message
Segmentation fault (core dumped)
Expected behavior
Return voxels.
Open3D, Python and System information
Additional information
No response