Add Windows Build Support & Improve Build System #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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 removesdeepspeed
from the primaryrequirements.txt
to ensure a smooth default installation for the majority of users. A new section has been added to theREADME.md
with clear, optional instructions for advanced users who wish to install it for training purposes.MSVC Compatibility for
custom_rasterizer
:Patched the C++ source files (
grid_neighbor.cpp
andrasterizer.cpp
) to resolve two common Windows-specific compilation and linking issues:error C2398: narrowing conversion
: Explicitly cast vector sizes toint64_t
withintorch::zeros
initializers, as required by the stricter MSVC compiler.error LNK2001: unresolved external symbol
fordata_ptr<long>()
: Changed all instances oflong*
anddata_ptr<long>()
to the platform-agnosticint64_t*
anddata_ptr<int64_t>()
. This resolves a type size mismatch, aslong
is 32-bit on Windows but 64-bit on Linux.Modernized Build for
DifferentiableRenderer
:Replaced the Linux-specific
compile_mesh_painter.sh
shell script with a new, cross-platformsetup.py
file. This leveragestorch.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.