Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically add the visual studio compiler folder to the environment path #352

Open
martinResearch opened this issue Aug 21, 2024 · 3 comments

Comments

@martinResearch
Copy link
Contributor

Problem:
In some case gsplat needs to compile cuda/c++ code on the fly (just-in-time compilation),
to handle different number of color channels for example, like done in the test test_rasterize_to_pixels when using channels=128.

In that case cl.exe needs to be on the path when on windows in order for pytorch to be able to do the compilation.
One can follow the step documented here
but that requires a manual step each time time one wants to use gsplat, which very unconvenient.

Solution:
We can instead add the folder automatically to the path at runtime using a mechanism used in CuPy here to discover the folder that contains the cl.exe file.

Ideally this mechanism would be implemented in pytorch, but that may take a while to be completed. We can implement it in gsplat in the mean time.

@martinResearch
Copy link
Contributor Author

a possible implementation #351

@martinResearch
Copy link
Contributor Author

I realized the problem is in the nerfacc library, not in gsplat.
The installation using pip install nerfacc uses the pipy.org file nerfacc-0.5.3-py3-none-any.whl and not nerfacc-0.5.3.tar.gz and as a results the CUDA code is not compiled during the installation, but compiled one the fly the first time nerfacc is imported.
On windows, this requires cl.exe to be on the path at runtime. A workaround is to install nerfacc from source using pip install --no-binary=nerfacc nerfacc

@martinResearch
Copy link
Contributor Author

actually the problem also appears with gsplat if one used pip install gsplat because the published wheel does not come with precompiled CUDA binaries and the installation from the wheel does not run the compilation (one needs to install gsplat from source to compile the CUDA code during the installation, either using pip install --no-binary=gsplat gsplat or installing from the git clone )

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

No branches or pull requests

1 participant