nerfstudio-project / gsplat

CUDA accelerated rasterization of gaussian splatting
https://docs.gsplat.studio/
Apache License 2.0
2.2k stars 277 forks source link

torch missing when running setup.py #363

Closed martinResearch closed 1 month ago

martinResearch commented 2 months ago

Problem I am trying to install gsplat from source among other librairies with a requirements.txt and pip install -r requirements but that fails because it tries to compile gsplat with pytorch before pytorch is installed (all the package get installed at the end after all the packages are build).

Solution To prevent this, pytorch should be listed in a list provided of packages needed to run setup.py through the setup_requires argument in setup.py (see https://setuptools.pypa.io/en/latest/references/keywords.html) or using https://peps.python.org/pep-0518/

liruilong940607 commented 2 months ago

Hey! It's actually pretty tricky to put pytorch into setup.py so we rely on user to install it manually before installing gsplat.

Installation of pytorch depends on the CUDA version that lives in your machine, and different CUDA corresponds to different installation command, as shown here: https://pytorch.org/get-started/locally/

The fundamental reason is that the platform compatibility tags supported by PyPI does not include CUDA version. So PyPI can not be used to host wheels for different CUDA versions (and thats why PyTorch was hosting them on their own server and ask user to install via --index-url https://download.pytorch.org/whl/cuXXX)

gsplat also depends on CUDA, and has one more dependence, which is PyTorch. Neither of them can be recognized by PyPI tages so if we build wheels we would have to host it somewhere else, just like PyTorch.

martinResearch commented 1 month ago

Closing as there is not obvious solution to this problem. The precompiled wheels are now available (https://github.com/nerfstudio-project/gsplat/pull/365) which provides a work around.