Hi everyone,
I'm using fVDB Reality Capture 0.4.0 with fVDB-core v. 0.4.2 to reconstruct very complex meshes where I need to preserve a very high level of geometric detail.
My dataset consists of:
~600 high-quality images
Resolution: 6000×4000
Running on a cloud instance with an NVIDIA L4 GPU (24 GB VRAM)
To preserve reconstruction quality, I need to keep both:
a small voxel_size
a small truncation_margin
However, during the call to integrate_tsdf_with_features, I consistently hit a CUDA Out-Of-Memory (OOM) error.
Below is the relevant integration loop:
enumerator = tqdm.tqdm(dataloader, unit="imgs", desc="Extracting TSDF") if show_progress else dataloader
for i, tsdf_input in enumerate(enumerator):
cam_to_world_matrix = camera_to_world_matrices[i].to(dtype=torch.float32, device=device)
projection_matrix = projection_matrices[i].to(dtype=torch.float32, device=device)
rgb_image, depth_image, weight_image = tsdf_input
# Convert rgb image to feature dtype
if feature_dtype == torch.uint8:
rgb_image = (rgb_image * 255).to(feature_dtype)
else:
rgb_image = rgb_image.to(feature_dtype)
# Prepare depth and weight tensors
depth_image = depth_image.to(dtype)
weight_image = weight_image.to(dtype)
# Build the full feature tensor (B, H, W, 3) for integration
rgb_for_integration = rgb_image
accum_grid, tsdf, weights, features = accum_grid.integrate_tsdf_with_features(
truncation_margin,
projection_matrix.to(dtype),
cam_to_world_matrix.to(dtype),
tsdf,
features,
weights,
depth_image.squeeze(0).to(device),
rgb_for_integration.squeeze(0).to(device),
weight_image.squeeze(0).to(device),
)
if show_progress:
assert isinstance(enumerator, tqdm.tqdm)
enumerator.set_postfix({"accumulated_voxels": accum_grid.num_voxels})
# Prune out zero weight voxels to save memory
new_grid = accum_grid.pruned_grid(weights > 0.0)
tsdf = new_grid.inject_from(accum_grid, tsdf)
features = new_grid.inject_from(accum_grid, features)
weights = new_grid.inject_from(accum_grid, weights)
accum_grid = new_grid
del rgb_image, depth_image, weight_image
torch.cuda.synchronize()
torch.cuda.empty_cache()
Questions
Is this level of memory usage expected for this function with high-resolution images and dense voxel grids?
Are there recommended strategies to reduce VRAM usage while preserving reconstruction quality?
Would more aggressive voxel pruning help?
Right now I only prune voxels with weights > 0.0
Is there a way to not load everything on GPU?
I'm not using masks
At the moment it feels like memory usage grows excessively fast when using small voxel sizes and truncation margins.
Any suggestions would be greatly appreciated.
Hi everyone,
I'm using fVDB Reality Capture 0.4.0 with fVDB-core v. 0.4.2 to reconstruct very complex meshes where I need to preserve a very high level of geometric detail.
My dataset consists of:
~600 high-quality images
Resolution: 6000×4000
Running on a cloud instance with an NVIDIA L4 GPU (24 GB VRAM)
To preserve reconstruction quality, I need to keep both:
a small voxel_size
a small truncation_margin
However, during the call to integrate_tsdf_with_features, I consistently hit a CUDA Out-Of-Memory (OOM) error.
Below is the relevant integration loop:
Questions
Is this level of memory usage expected for this function with high-resolution images and dense voxel grids?
Are there recommended strategies to reduce VRAM usage while preserving reconstruction quality?
Would more aggressive voxel pruning help?
Right now I only prune voxels with weights > 0.0
Is there a way to not load everything on GPU?
I'm not using masks
At the moment it feels like memory usage grows excessively fast when using small voxel sizes and truncation margins.
Any suggestions would be greatly appreciated.