InternLandMark / FlashGS

MIT License
94 stars 5 forks source link

Cuda Memory Exception #14

Open xohm opened 3 days ago

xohm commented 3 days ago

Hi,

First of all, thank you so much for this fantastic library!

I encountered CUDA memory exceptions when using free camera views that were different from the original cameras in the test dataset (e.g., counter).

My setup is as follows:

The crashes occurred when the camera viewport was partially or fully outside the bounds of the Gaussian splats.

I managed to resolve the issue, but I must admit that I don’t fully understand your code yet. Here are the changes I made:

  1. After Preprocess

    • If there are no Gaussian splats to draw, abort the sorting and rendering processes. Otherwise, memory exceptions occur.
  2. renderCUDA

    • I identified an uninitialized variable in certain cases and an array out-of-bounds access when a Gaussian splat was skipped. I did attach a patch. crashFixes.zip
chensiyan96 commented 3 days ago

Your GPU memory is small, so maybe there's an oom? Set MAX_NUM_RENDERED = 2 ** 26 and try a small scene.

xohm commented 3 days ago

Yes, your right, i already did this: _rasterizer = std::make_shared(*_scene, 1 << 24, 1 << 18);

Otherwise it would have right away oom. With these settings i do see the splats, but as mentioned above, if i move into an area where the splats are clipped i see the crashes.