Skip to content

Conversation

MetinovAdik
Copy link

This pull request introduces several crucial fixes to enable a successful build and a smooth user experience on a standard Windows environment with the MSVC compiler and NVIDIA CUDA toolkit. The project currently fails to build on Windows out-of-the-box, and these changes address the root causes.

Summary of Changes

  1. Streamlined Dependencies for Inference:
    The deepspeed package, while potentially useful for training, causes significant installation failures on Windows and is not required for running inference. This PR removes deepspeed from the primary requirements.txt to ensure a smooth default installation for the majority of users. A new section has been added to the README.md with clear, optional instructions for advanced users who wish to install it for training purposes.

  2. MSVC Compatibility for custom_rasterizer:
    Patched the C++ source files (grid_neighbor.cpp and rasterizer.cpp) to resolve two common Windows-specific compilation and linking issues:

    • Fixed error C2398: narrowing conversion: Explicitly cast vector sizes to int64_t within torch::zeros initializers, as required by the stricter MSVC compiler.
    • Fixed error LNK2001: unresolved external symbol for data_ptr<long>(): Changed all instances of long* and data_ptr<long>() to the platform-agnostic int64_t* and data_ptr<int64_t>(). This resolves a type size mismatch, as long is 32-bit on Windows but 64-bit on Linux.
  3. Modernized Build for DifferentiableRenderer:
    Replaced the Linux-specific compile_mesh_painter.sh shell script with a new, cross-platform setup.py file. This leverages torch.utils.cpp_extension to automate the build process, making the installation of this module robust and seamless on all operating systems without manual intervention.

These changes collectively allow the project to be cloned and run successfully on Windows. The C++ modifications are platform-agnostic and improve code correctness, while the dependency and build system changes vastly improve the user experience for a wider audience.

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