-
Notifications
You must be signed in to change notification settings - Fork 103
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
Mac/Windows Support #3
Comments
It's working on Windows Changes
|
That's awesome! Thanks for testing and confirming it works. Would you be interested in opening a pull request with these changes? 🙏 |
Okay |
Mac support will likely require porting gsplat to CPU (maybe via HIP). |
Hi, this is great stuff, thank you for doing it. I am trying to recompile it too on Windows but I got an error when it reaches make -j$(nproc) command. |
run |
@Disa-Kizonda My versions: I had no success building with: I had success building with: I got many warnings - but exe seems to start. |
Instructions for Windows will be a bit different (e.g. using |
Now, I used libtorch 2.1.0 for cuda 11.8 edit: not listed, but this seems more updated version according to this, it's best selection I had no more bad warnings. Only during compiling cuda: DetailsC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include\cuda\std\detail\libcxx\include\support\atomic\atomic_msvc.h(15): warning C4005: "_Compiler_barrier": Makro-Neudefinition C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xatomic.h(55): note: Siehe vorherige Definition von "_Compiler_barrier" C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include\cuda\std\detail\libcxx\include\support\atomic\atomic_msvc.h(15): warning C4005: "_Compiler_barrier": Makro-Neudefinition C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xatomic.h(55): note: Siehe vorherige Definition von "_Compiler_barrier" I don't know if this is normal... |
Confirming Windows compilation, this is what you should see when it all works -- Building for: Visual Studio 16 2019 -- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8 (found version "11.8") It shows a few warnings (in yellow), but the exe will be generated in opensplat.vcxproj -> E:\OpenSplat\build\Debug\opensplat.exe |
Installed software: Build: Optional: Edit cuda target (only if required) before cmake --build . Run: |
@dm-de did you manage to make it working? I'm trying but after building & running "opensplat /path/to/banana -n 2000" it just loads the images and stops. |
@pierotofy Any ideas to port gsplat cuda code into MPS, MLX or CPU based architecture? I can easily compile gsplat with Mac M2 chip in NO_CUDA mode. But the most important part (csrc cuda extension) would be skipped. https://github.com/nerfstudio-project/gsplat/blob/main/setup.py#L132 |
not enough vram try -d 8 |
@Disa-Kizonda Your solution works but I have an A6000 with 48gb of vram and the opensplat command is barely using vram while running. It's crashing in oversplat.cpp on this line. |
I have got it working... I used also : |
That's strange; I've run the banana dataset with the defaults on a card that has 2GB of memory. There might be something going on. |
@pfxuan gsplat currently requires CUDA. (The BUILD_NO_CUDA option does not make it work without CUDA, it just doesn't build the CUDA parts for you, which is helpful during development). Adding CPU support will require a rewrite of gsplat for the CPU using multithreading, or porting the CUDA coda to HIP (https://github.com/ROCm/HIP) which should have support for compiling to CPU. The latter might be easier to do. |
banana with -d 3 with banana -d 2 edit: crash typically happen, when the graphics memory runs out GFX Card: Quadro RTX 4000 |
I wonder if it's Windows related (I've run the software on Linux). |
I've tested this on Windows with RTX 2080 and 8GB of memory. I can run
Also it currently seem to be CPU-bound, where |
Thanks for testing and the detailed explanation of changes! Would you be interested in opening a pull request with the aforementioned changes? It might help other users on Windows. |
I can do that. There are obviously multiple ways of fixing some things like the scaleOutputResolution(), personally I would remove that function altogether and do the calculations inside Model::forward() as it's safer not to modify the original camera parameters. But I can make a pull request and you can decide if those fixes sound good to you :) |
Something is going on. I try it on Ubuntu 22.04 LTS, and it consumes >10 GB with |
My results Windows x64 / Quadro RTX 4000 8GB
|
Indeed, there is a problem with the memory management where the refining steps (densify/culling) will essentially recreate all tensors (by using Tensor::index) and the current cuda memory manager likes to keep old tensors in memory for caching. While this may work in some projects, but here it will just exhaust all memory which after everything slows down dramatically. Fortunately, there is an easy fix to empty the cuda memory cache after every refine step. In Here's a comparison before and after the change: Windows 10 / RTX 2080 / 8GB VRAM
Previously learning stalled after 2600 steps when VRAM was full, 3000 steps took 16 minutes where it now takes 4 minutes when the cache is cleared after refining. Now I can finally use this project with bigger data sets and without running out of VRAM even with an 8GB card. |
Thanks for bringing up the cache issue. It appears GPU: AMD RX 6700 XT Before After I'll add this fix into both cuda and rocm code shortly. |
Its important fix (also fixing #43), I think @pierotofy should tagging OpenSplat v1.0.3. |
Is rewriting the CUDA kernels in MSL possible? This is something I'd be interested in learning how to do over the summer, has anyone started this? |
That would be a cool project! I don't see why it wouldn't; I'm very close to having a CPU-only implementation ready (https://github.com/pierotofy/OpenSplat/tree/cpudiff), so a MSL version would just be another port. |
@josephldobson fyi! #76 |
Haven't tested there, but should work with minimal/no changes.
The text was updated successfully, but these errors were encountered: