bennyguo / instant-nsr-pl

Neural Surface reconstruction based on Instant-NGP. Efficient and customizable boilerplate for your research projects. Train NeuS in 10min!
MIT License
857 stars 84 forks source link

How to extract high resolution mesh #46

Closed SarahWeiii closed 1 year ago

SarahWeiii commented 1 year ago

I was wondering if it is feasible to extract a mesh with very high resolution using the Marching Cube algorithm, say 2048**3? In theory, it shouldn't require excessive memory, but we seem to be encountering difficulties with both the CPU and GPU, resulting in cuda out of memory errors. Could you help us with this problem?

bennyguo commented 1 year ago

Building a 2048^32 float32 grid literally requires 32GB memory. So the current version could not run on GPUs with less than 32GB memory. I tried using the CPU and found that the grid was first transferred to the GPU and then split as network input, which would cause CUDA OOM when the resolution is high. I fixed this issue in the latest commit. Thanks for reporting!

bennyguo commented 1 year ago

BTW, it could take a very long time to extract the surface if you set the resolution to larger values like 2048. If so, you may try increasing model.isosurface.chunk as long as the program fits in the GPU memory.

SarahWeiii commented 1 year ago

Thank you for the quick reply!