CUDA runtime error when running extract_triangle_mesh() from o3d.t.geometry.VoxelBlockGrid()
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).
### My Question
Hello,
Thanks for your great work :)
I am running into the following error when extracting a triangle mesh from a VoxelBlockGrid. Integrating each pair color/depth works fine, but when I try to extract the triangle mesh I get the following error:
```
mesh = volume.extract_triangle_mesh()
RuntimeError: [Open3D Error] (void open3d::core::__OPEN3D_CUDA_CHECK(cudaError_t, const char*, int)) /root/Open3D/cpp/open3d/core/CUDAUtils.cpp:301: /root/Open3D/cpp/open3d/core/MemoryManagerCUDA.cpp:91 CUDA runtime error: an illegal memory access was encountered
```
Additionally, if I try to save the voxelblockgrid and load it again, I get a bunch of `index out of bounds errors`.
Here is the piece of code I used:
```
volume = o3d.t.geometry.VoxelBlockGrid(
attr_names=("tsdf", "weight", "color"),
attr_dtypes=(o3c.float32, o3c.float32, o3c.float32),
attr_channels=((1), (1), (3)),
voxel_size=3.0 / 512,
block_resolution=16,
block_count=50000,
device=o3d.core.Device("CUDA:0"),
)
for i in tqdm.tqdm(range(len(rgbd_frames))):
color = o3d.t.io.read_image(str(image_dir.joinpath(rgbd_frames[i]))).to(
o3d.core.Device("CUDA:0")
)
depth = o3d.t.io.read_image(str(depth_dir.joinpath(rgbd_frames[i]))).to(
o3d.core.Device("CUDA:0")
)
intrinsics = o3d.core.Tensor(
camera_intrinsics[recording_id].intrinsic_matrix,
)
extrinsics = o3d.core.Tensor(
np.linalg.inv(camera.parameters[i].extrinsic),
)
frustum_block_coords = volume.compute_unique_block_coordinates(
depth, intrinsics, extrinsics, depth_max=self.depth_trunc
)
volume.integrate(
frustum_block_coords,
depth,
color,
intrinsics,
extrinsics,
depth_max=self.depth_trunc,
)
mesh = volume.extract_triangle_mesh()
```
What am I missing? I checked if the gpu was full but only 8/16 GB were being used.
Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.