Skip to content

Offloading points and voxelmaps on GPU#235

Open
koide3 wants to merge 4 commits intomasterfrom
offload
Open

Offloading points and voxelmaps on GPU#235
koide3 wants to merge 4 commits intomasterfrom
offload

Conversation

@koide3
Copy link
Owner

@koide3 koide3 commented Jun 25, 2025

This PR enables offloading point and voxelmap data of old submaps from GPU memory. It effectively reduces GPU memory consumption with a slight degradation of global optimization speed up to CPU-GPU data IO. A new parameter "gpu_memory_offload_mb" in "global_mapping_gpu.json" controls the threshold for GPU memory usage.

  // gpu_memory_offload_mb          : Threshold for GPU memory offloading in MB (0 = disable offloading).
  //                                : If GPU memory usage exceeds this value, old submap points and voxelmaps are offloaded to CPU memory.
  //                                : Note that the current implementation doesn't support offloading of factors and graphics data, and thus
  //                                : the actual GPU memory usage will be much larger than this value.
  //                                : (Setting this to a half or quarter of the total GPU memory would be a good choice).

TODO : Offloading in offline_viewer

@TokyoWarfare
Copy link

I've excelent news @koide3 ! The GPU offload works wonderfully!!

Previously, it would OOM at about a cuarter of the lenght of the road you see in the picture. As of now with a value of 4096 in the JSON it is workign wonders!!

imagen

this is all 14KM mapped at max resolution
imagen

Dataset:
#271

Dense config with GPU offload set at 4096 (GPU--->3090Ti)
02_Dense_gpu_offload.zip

@TokyoWarfare
Copy link

sadly, as spected, OOM occurs in the offline viewer:

[2025-12-26 20:09:15.382] [viewer] [info] Use config from /data/MyHorizonBags/ROS2/00_Graphs/BAG_04_B112_HD/dump/config [2025-12-26 20:09:15.382] [viewer] [info] Export classes from libimu_validator.so [2025-12-26 20:09:18.135] [viewer] [info] enable_optimization=true [2025-12-26 20:09:18.256] [global] [info] Load submaps (session_id=0) warning: cudaErrorMemoryAllocation : out of memory warning: cudaErrorMemoryAllocation : out of memory warning: cudaErrorInvalidValue : invalid argument warning: cudaErrorIllegalAddress : an illegal memory access was encountered warning: cudaErrorIllegalAddress

I hope this GPU offload feature can be finished as would be a huge step for mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants