Skip to content

Conversation

@MrZoyo
Copy link

@MrZoyo MrZoyo commented Oct 24, 2025

Hello.

This pull request introduces several improvements and fixes across mesh processing, rasterization, and C++ extension compatibility.

I need to clarify: some changes were made for my personal testing convenience. For instance, since my GPU VRAM configuration is low, I had to rewrite nvdiff_rasterization to use chunked processing to reduce VRAM overflow. The clean_convert_mesh.py script was created for my personal convenience in obtaining obj/glb formats.

These changes have only been tested on my specific device and configuration, without extensive verification.

Modifications to header files to enforce ABI=1 may adversely affect users of older versions. I apologize for not having older hardware available for testing.

These concerns are also why I didn't submit a PR earlier. I request that your team test my modifications whenever feasible and feel free to make any changes.

===========================================
Mesh Processing Utility:

  • Added a new standalone script clean_convert_mesh.py for cleaning, simplifying, and converting mesh files (PLY/OBJ/GLB) with options for component filtering and triangle count reduction. This script leverages pymeshlab and optionally trimesh for robust mesh handling and exports.

Rasterization Improvements:

  • Introduced a new nvdiff_rasterization function in mesh.py that supports chunked rasterization for large meshes (controlled via the MILO_RAST_TRI_CHUNK environment variable) and fixes a critical compatibility issue by ensuring the ranges argument for nvdiffrast is always on the CPU.
  • Updated the mesh class initialization to allow selection of nvdiffrast backend (gl or cuda) via the NVDIFRAST_BACKEND environment variable, improving flexibility for different hardware setups.

C++ Extension Compatibility:

  • Added a new header force_abi.h to force use of the C++11 ABI for GCC's libstdc++ in the tetra_triangulation extension, preventing runtime linker errors with recent PyTorch versions. This header is now included as the first line in all relevant C++ sources.
    CUDA and Header Hygiene:

  • Added missing standard headers (<cstdint>, <cstddef>) to several rasterizer implementations for improved portability and reliability.

  • Fixed CUDA pointer usage in spatial.cu by switching from .data<float>() to .data_ptr<float>() for compatibility with newer PyTorch versions.

  • Added <cfloat> to simple_knn.cu and removed redundant macro definition for better CUDA compilation hygiene.

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.

1 participant