2DGS
This is an attempt to integrate 2DGS https://surfsplatting.github.io/ into gsplat. You can run simple 2D traning example with:
2D verification examples:
python examples/2d_example.py --model-type {3dgs, 2dgs}
Image fitting:
python examples/image_fitting.py --model-type {3dgs, 2dgs}
- [x] Integrate with V 1.0 (Currently I'm working on this)
- [x] Depth Distortion Loss (forward & backward)
- [x] Normal Consistency Loss (forward & backward)
- [x] Nerfstudio model
This is a wonderful start! I think it would be great to have similar numerical testing the same way that we have for the 3dgs, but we can coordinate this.
I'm inclined to separate the two into separate functions and interfaces, what are your thoughts @liruilong940607? There is also a lot of repeated code but that's not a big problem for now, we can figure out if/how we can share between 2dgs and 3dgs later once.
Yes totally agree. I definitely recommend start with developing as separate functions (or even separate files). This would make the development so much easier and faster without the need of considering compatibility and it won't interrupting what's already in there.
I imagine some helper functions might be able to get reused, like on the python side, there is sorting related functions, and maybe also rasterization? The projection is definitely different between 2D and 3D GS so would be nice to have different interfaces.
Merging is kinda like a cleanup, which we can certainly do it later.
I am highly interested in having this handy. Just curious, will this also be able to support things like Gaussian Surfels (which is pretty much the same as 2DGS), but interesting losses: https://github.com/turandai/gaussian_surfels
Forward pass works on simple 2D experiments for v1.0
Slant views
(3DGS)
(2DGS)
2D Image fitting is working now.
(2DGS)
(3DGS)
Go Bairs!
Hello, if I want test 2DGS with ns-train splatfacto, is it possible?
Hello, if I want test 2DGS with
ns-train splatfacto, is it possible?
Hey @ichsan2895 , Thanks for your interests! Currently we are integrating 2DGS into gsplat so ns-train splatfacto won't work for now; but we will definitely try to add a nerfstudio after we have a stable version. Stay tune!
For the current version I am working on, you can run the above experiments with the following commands:
2D verification examples:
python examples/2d_example.py --model-type {3dgs, 2dgs}
Image fitting:
python examples/image_fitting.py --model-type {3dgs, 2dgs}
So the 3D reconstruction runs now; here's the examples
(2DGS, PSNR: 21)
(3DGS, PSNR: 25)
There are bugs that cause blurriness in 2DGS, most likely in the backward pass or densification. I feel like it's a good time to work on the numerical tests we discussed earlier, and I can catch up on the progress made by @vye16. Do you @liruilong940607, @vye16, and everyone else have any thoughts or recommendations?
@FantasticOven2 Fantastic Progress!!!
Yes now should be the time for numerical tests!! Ideally we should have torch implementation for every CUDA kernel so that we can check both the forward and backward. I would have some time this week to play with this PR so I could also write some tests. If you list out the functions that you would like to have numerical tests I could take some of them (let's use our offline channel to sync on this).
Also, btw just curious, do you believe the current performance gap between 2dgs and 3dgs is not from the missing losses, e.g., distortion loss and normal loss, but bugs in the fwd/bwd? I'm just thinking what performance should we target on without the extra losses.
Also, btw just curious, do you believe the current performance gap between 2dgs and 3dgs is not from the missing losses, e.g., distortion loss and normal loss, but bugs in the fwd/bwd? I'm just thinking what performance should we target on without the extra losses.
I am working on the original repo see if I can do an ablation on the additional losses.
Hey @FantasticOven2 , great efforts so far. Thanks. :+1:
BTW there is a PR about 3DGS-MCMC. Can we also create 2DGS-MCMC, isn't it? Hopefully it creates new SOTA and won't breaks each other.
Hey @FantasticOven2 , great efforts so far. Thanks. 👍
BTW there is a PR about 3DGS-MCMC. Can we also create 2DGS-MCMC, isn't it? Hopefully it creates new SOTA and won't breaks each other.
Exactly. This is planned already!
@FantasticOven2 I implemented normal consistency loss on 3dgs in #273 and wrapped diff-surfel-rasterization as 2dgs_inria. It might be useful for you to compare against / share helper functions.
@FantasticOven2 I implemented normal consistency loss on 3dgs in #273 and wrapped diff-surfel-rasterization as 2dgs_inria. It might be useful for you to compare against / share helper functions.
Thanks @jefequien, this is very helpful for baseline/numerical testing!
First of all, thanks for the great implementation. As I was running some tests with your code, I have just found a small bug for absgrad calculation in 2dgs. It seems like in file rasterization.cu you need to add
if (v_means2d_abs != nullptr) {
v_xy_abs_local = {abs(v_xy_local.x), abs(v_xy_local.y)};
}
to the function rasterize_to_pixels_bwd_2dgs_kernel in line 2222.
First of all, thanks for the great implementation. As I was running some tests with your code, I have just found a small bug for absgrad calculation in 2dgs. It seems like in file rasterization.cu you need to add
if (v_means2d_abs != nullptr) { v_xy_abs_local = {abs(v_xy_local.x), abs(v_xy_local.y)}; }to the function rasterize_to_pixels_bwd_2dgs_kernel in line 2222.
@ozgunthirddimension thanks for pointing this out! I will add this once I have the basic 2DGS working and ready to merge.
I know this PR is still a draft, but just a note: You haven't added the diff-surfel-rasterization to .gitmodules yet, causing clean installs to fail. I assume that's intended to be hbb1's repo:
[submodule "gsplat/cuda/csrc/third_party/glm"]
path = gsplat/cuda/csrc/third_party/glm
url = https://github.com/g-truc/glm.git
[submodule "gsplat/diff-surfel-rasterization"]
path = gsplat/diff-surfel-rasterization
url = https://github.com/hbb1/diff-surfel-rasterization.git
(Edit: though even with that added I can't get it installed due to some compilation errors, so perhaps not?)
I know this PR is still a draft, but just a note: You haven't added the diff-surfel-rasterization to .gitmodules yet, causing clean installs to fail. I assume that's intended to be hbb1's repo:
[submodule "gsplat/cuda/csrc/third_party/glm"] path = gsplat/cuda/csrc/third_party/glm url = https://github.com/g-truc/glm.git [submodule "gsplat/diff-surfel-rasterization"] path = gsplat/diff-surfel-rasterization url = https://github.com/hbb1/diff-surfel-rasterization.git(Edit: though even with that added I can't get it installed due to some compilation errors, so perhaps not?)
Hi, I installed diff-surfel-rasterization by clone its repo into gsplat and run cd gsplat/diff-surfel-rasterization then pip install -e .
Also we likely won't include diff-surfel-rasterization as a submodule when we release as the main purpose of inria kernel is for tests and comparison.
@FantasticOven2 thanks for this PR. I am not able to install from source. The system slows down and then crashed.
@FantasticOven2 thanks for this PR. I am not able to install from source. The system slows down and then crashed.
Hey, can you share the commands you used for installation and the error messages? I was able to build from source on my server.
https://github.com/nerfstudio-project/gsplat/pull/208#issuecomment-2273887911 Does this apply to your case?
Also we likely won't include diff-surfel-rasterization as a submodule when we release as the main purpose of inria kernel is for tests and comparison.
It already is (recognized as) a submodule:
(0) sebastiaan@almavm:~/src $ git clone https://github.com/nerfstudio-project/gsplat
Cloning into 'gsplat'...
remote: Enumerating objects: 5814, done.
remote: Counting objects: 100% (1070/1070), done.
remote: Compressing objects: 100% (301/301), done.
remote: Total 5814 (delta 885), reused 865 (delta 763), pack-reused 4744
Receiving objects: 100% (5814/5814), 97.53 MiB | 23.67 MiB/s, done.
Resolving deltas: 100% (3925/3925), done.
(0) sebastiaan@almavm:~/src $ cd gsplat/
(0) sebastiaan@almavm:~/src/gsplat $ git fetch origin pull/208/head:pr-208
remote: Enumerating objects: 2144, done.
remote: Counting objects: 100% (1290/1290), done.
remote: Compressing objects: 100% (377/377), done.
remote: Total 2144 (delta 1011), reused 954 (delta 913), pack-reused 854
Receiving objects: 100% (2144/2144), 4.49 MiB | 14.61 MiB/s, done.
Resolving deltas: 100% (1412/1412), completed with 24 local objects.
From https://github.com/nerfstudio-project/gsplat
* [new ref] refs/pull/208/head -> pr-208
(0) sebastiaan@almavm:~/src/gsplat $ git checkout pr-208
Switched to branch 'pr-208'
(0) sebastiaan@almavm:~/src/gsplat $ git submodule update --init --recursive
Submodule 'gsplat/cuda/csrc/third_party/glm' (https://github.com/g-truc/glm.git) registered for path 'gsplat/cuda/csrc/third_party/glm'
fatal: No url found for submodule path 'gsplat/diff-surfel-rasterization' in .gitmodules
This also means that, as long as it is, gsplat cannot be installed via pip install git+ since it will first recursively checkout all submodules and run into this same error:
(0) sebastiaan@almavm:~/src/nerfstudio $ pip install 'git+https://github.com/nerfstudio-project/gsplat.git@refs/pull/208/head'
Collecting git+https://github.com/nerfstudio-project/gsplat.git@refs/pull/208/head
Cloning https://github.com/nerfstudio-project/gsplat.git (to revision refs/pull/208/head) to /tmp/pip-req-build-xfy7s3eh
Running command git clone --filter=blob:none --quiet https://github.com/nerfstudio-project/gsplat.git /tmp/pip-req-build-xfy7s3eh
WARNING: Did not find branch or tag 'refs/pull/208/head', assuming revision or ref.
Running command git fetch -q https://github.com/nerfstudio-project/gsplat.git refs/pull/208/head
Running command git checkout -q 0a62fe84860462756dc697354e268a463371e185
Resolved https://github.com/nerfstudio-project/gsplat.git to commit 0a62fe84860462756dc697354e268a463371e185
Running command git submodule update --init --recursive -q
fatal: No url found for submodule path 'gsplat/diff-surfel-rasterization' in .gitmodules
error: subprocess-exited-with-error
× git submodule update --init --recursive -q did not run successfully.
│ exit code: 128
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× git submodule update --init --recursive -q did not run successfully.
│ exit code: 128
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
If it is not the intention for this to be a submodule, the current approach probably needs to be revised.
Edit: Or did you mean it currently is, but you were going to change it anyway? In that case I didn't say anything, heh.
w/o regularization
| Scene | PSNR (inria / gsplat) | Train Time (min:sec) | Num GS |
|---|---|---|---|
| Garden | 26.88 / 26.94 | 23:20 / 18:00 | 2.91M / 2.65M |
| Counter | 29.08 / 29.20 | 09:33 / 07:40 | 0.65M / 0.64M |
| Room | 31.60 / 31.76 | --- / --- | 0.99M / 1.1M |
| Kitchen | 31.58 / 31.58 | 10:02 / 07:43 | 0.75M / 0.75M |
Also we likely won't include diff-surfel-rasterization as a submodule when we release as the main purpose of inria kernel is for tests and comparison.
It already is (recognized as) a submodule:
(0) sebastiaan@almavm:~/src $ git clone https://github.com/nerfstudio-project/gsplat Cloning into 'gsplat'... remote: Enumerating objects: 5814, done. remote: Counting objects: 100% (1070/1070), done. remote: Compressing objects: 100% (301/301), done. remote: Total 5814 (delta 885), reused 865 (delta 763), pack-reused 4744 Receiving objects: 100% (5814/5814), 97.53 MiB | 23.67 MiB/s, done. Resolving deltas: 100% (3925/3925), done. (0) sebastiaan@almavm:~/src $ cd gsplat/ (0) sebastiaan@almavm:~/src/gsplat $ git fetch origin pull/208/head:pr-208 remote: Enumerating objects: 2144, done. remote: Counting objects: 100% (1290/1290), done. remote: Compressing objects: 100% (377/377), done. remote: Total 2144 (delta 1011), reused 954 (delta 913), pack-reused 854 Receiving objects: 100% (2144/2144), 4.49 MiB | 14.61 MiB/s, done. Resolving deltas: 100% (1412/1412), completed with 24 local objects. From https://github.com/nerfstudio-project/gsplat * [new ref] refs/pull/208/head -> pr-208 (0) sebastiaan@almavm:~/src/gsplat $ git checkout pr-208 Switched to branch 'pr-208' (0) sebastiaan@almavm:~/src/gsplat $ git submodule update --init --recursive Submodule 'gsplat/cuda/csrc/third_party/glm' (https://github.com/g-truc/glm.git) registered for path 'gsplat/cuda/csrc/third_party/glm' fatal: No url found for submodule path 'gsplat/diff-surfel-rasterization' in .gitmodulesThis also means that, as long as it is, gsplat cannot be installed via
pip install git+since it will first recursively checkout all submodules and run into this same error:(0) sebastiaan@almavm:~/src/nerfstudio $ pip install 'git+https://github.com/nerfstudio-project/gsplat.git@refs/pull/208/head' Collecting git+https://github.com/nerfstudio-project/gsplat.git@refs/pull/208/head Cloning https://github.com/nerfstudio-project/gsplat.git (to revision refs/pull/208/head) to /tmp/pip-req-build-xfy7s3eh Running command git clone --filter=blob:none --quiet https://github.com/nerfstudio-project/gsplat.git /tmp/pip-req-build-xfy7s3eh WARNING: Did not find branch or tag 'refs/pull/208/head', assuming revision or ref. Running command git fetch -q https://github.com/nerfstudio-project/gsplat.git refs/pull/208/head Running command git checkout -q 0a62fe84860462756dc697354e268a463371e185 Resolved https://github.com/nerfstudio-project/gsplat.git to commit 0a62fe84860462756dc697354e268a463371e185 Running command git submodule update --init --recursive -q fatal: No url found for submodule path 'gsplat/diff-surfel-rasterization' in .gitmodules error: subprocess-exited-with-error × git submodule update --init --recursive -q did not run successfully. │ exit code: 128 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × git submodule update --init --recursive -q did not run successfully. │ exit code: 128 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.If it is not the intention for this to be a submodule, the current approach probably needs to be revised.
Edit: Or did you mean it currently is, but you were going to change it anyway? In that case I didn't say anything, heh.
My bad, I did not mean to leave "diff-surfel-rasterization" in the repo, can you try install from source again?
Also if you want to test out diff-surfel-rasterization, you can clone it to directory gsplat and cd gsplat/diff-surfel-rasterization && pip install -e .
Thanks, that solved the submodule issue, but not yet the issue I ran into afterwards, seems like I can't get it to compile the cuda stuff. I tried with python 3.10 and 3.9 to no avail, I've tried cudatoolkit versions 11.8 and 12.4, is there any specific version of PyTorch you are targetting?
My commands are:
micromamba create -y -n gsplat 'python<3.11' 'numpy<2' 'setuptools<70' 'pytorch::torchvision' 'pytorch::pytorch-cuda=11.8' 'nvidia/label/cuda-11.8.0::cuda-toolkit' -c 'nvidia/label/cuda-11.8.0' -c pytorch -c conda-forge
micromamba activate gsplat
pip install 'git+https://github.com/nerfstudio-project/gsplat.git@refs/pull/208/head'
It fails with errors like:
gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_bwd.cu(89): error: no instance of function template "compute_ray_Ms_aabb_vjp" matches the argument list
argument types are: (const float *__restrict__, const float *__restrict__, glm::vec<3, float, glm::highp>, glm::mat<3, 3, glm::f32, glm::highp>, glm::mat<3, 3, glm::f32, glm::highp>, glm::vec<3, float, glm::highp>, glm::vec<3, float, glm::highp>, glm::v
ec<4, float, glm::highp>, glm::vec<3, float, glm::highp>, glm::mat<3, 3, glm::f32, glm::highp>, glm::vec<4, float, glm::highp>, glm::vec<3, float, glm::highp>, glm::vec<3, float, glm::highp>)
detected during instantiation of "void fully_fused_projection_packed_bwd_2dgs_kernel(uint32_t, uint32_t, uint32_t, const T *, const T *, const T *, const T *, const T *, int32_t, int32_t, const int64_t *, const int64_t *, const T *, const T *, const T *,
const T *, __nv_bool, T *, T *, T *, T *, T *) [with T=float]"
(233): here
1 error detected in the compilation of "gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_bwd.cu".
error: command '/home/sebastiaan/micromamba/envs/gsplat/bin/nvcc' failed with exit code 1
Commit 6c1dee0, before the cleanup/refactor, worked fine with this method.
Thanks, that solved the submodule issue, but not yet the issue I ran into afterwards, seems like I can't get it to compile the cuda stuff. I tried with python 3.10 and 3.9 to no avail, I've tried cudatoolkit versions 11.8 and 12.4, is there any specific version of PyTorch you are targetting?
My commands are:
micromamba create -y -n gsplat 'python<3.11' 'numpy<2' 'setuptools<70' 'pytorch::torchvision' 'pytorch::pytorch-cuda=11.8' 'nvidia/label/cuda-11.8.0::cuda-toolkit' -c 'nvidia/label/cuda-11.8.0' -c pytorch -c conda-forge micromamba activate gsplat pip install 'git+https://github.com/nerfstudio-project/gsplat.git@refs/pull/208/head'It fails with errors like:
gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_bwd.cu(89): error: no instance of function template "compute_ray_Ms_aabb_vjp" matches the argument list argument types are: (const float *__restrict__, const float *__restrict__, glm::vec<3, float, glm::highp>, glm::mat<3, 3, glm::f32, glm::highp>, glm::mat<3, 3, glm::f32, glm::highp>, glm::vec<3, float, glm::highp>, glm::vec<3, float, glm::highp>, glm::v ec<4, float, glm::highp>, glm::vec<3, float, glm::highp>, glm::mat<3, 3, glm::f32, glm::highp>, glm::vec<4, float, glm::highp>, glm::vec<3, float, glm::highp>, glm::vec<3, float, glm::highp>) detected during instantiation of "void fully_fused_projection_packed_bwd_2dgs_kernel(uint32_t, uint32_t, uint32_t, const T *, const T *, const T *, const T *, const T *, int32_t, int32_t, const int64_t *, const int64_t *, const T *, const T *, const T *, const T *, __nv_bool, T *, T *, T *, T *, T *) [with T=float]" (233): here 1 error detected in the compilation of "gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_bwd.cu". error: command '/home/sebastiaan/micromamba/envs/gsplat/bin/nvcc' failed with exit code 1Commit
6c1dee0, before the cleanup/refactor, worked fine with this method.
Actually it's a very trivial bug; can you try it one more time?
Seems to be a cuda error; I'm still finishing the packed version; it should be done within a day
Sounds good, don't rush on my account, I'm not sure how far along the PR is, I just figured it'd be better to report the issues I ran into while testing it in case they weren't known.
Keep up the great work, there's a lot of people excited about it in the Nerfstudio discord.
Edit:
Actually it's a very trivial bug; can you try it one more time?
Testing now
That did it, thanks! In hindsight that was such a trivial bug I probably could have fixed it myself, heh.
For the record/future reference, I got it running with the following steps now (micromamba can be swapped out for conda):
# Create and activate micromamba (or conda) env with pytorch, python 3.10, ffmpeg, etc:
micromamba create -y -n gsplat 'python<3.11' 'numpy<2' 'setuptools<70' ffmpeg 'pytorch::torchvision' 'pytorch::pytorch-cuda=12.4' 'nvidia/label/cuda-12.4.0::cuda-toolkit' -c 'nvidia/label/cuda-12.4.0' -c pytorch -c conda-forge
micromamba activate gsplat
# Grab gsplat source:
git clone https://github.com/nerfstudio-project/gsplat
cd gsplat
# Check out this PR:
git fetch origin pull/208/head:pr-208
git checkout pr-208
# To update the PR later: git pull origin pull/208/head
# Install submodules:
git submodule update --init --recursive
# Install the example dependencies as well as gsplat itself (matplotlib is missing from requirements.txt):
pip install matplotlib -r examples/requirements.txt -e .
# Run the 2dgs trainer (--help for more info):
python examples/simple_trainer_2dgs.py --data-dir some-dataset
Edit 3: Since people are now testing out PRs by following my steps, I've cleaned up my instructions a bit.
@FantasticOven2 thanks for this PR. I am not able to install from source. The system slows down and then crashed.
Hey, can you share the commands you used for installation and the error messages? I was able to build from source on my server.
#208 (comment) Does this apply to your case?
@FantasticOven2 Not really. I am trying to install with python3.10 and cuda-11.8 in ubuntu-22.04.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2105, in _run_ninja_build
subprocess.run(
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '10']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/hd/Desktop/workspace/2DGS/gsplat/setup.py", line 122, in <module>
setup(
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/__init__.py", line 104, in setup
return distutils.core.setup(**attrs)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/dist.py", line 967, in run_command
super().run_command(command)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/command/develop.py", line 34, in run
self.install_for_development()
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/command/develop.py", line 111, in install_for_development
self.run_command('build_ext')
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/dist.py", line 967, in run_command
super().run_command(command)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 91, in run
_build_ext.run(self)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
self.build_extensions()
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 866, in build_extensions
build_ext.build_extensions(self)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
self._build_extensions_serial()
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
self.build_extension(ext)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 252, in build_extension
_build_ext.build_extension(self, ext)
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 560, in build_extension
objects = self.compiler.compile(
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 679, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1785, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/hd/Desktop/workspace/2DGS/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2121, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
I merged the main branch into it and did format cleaning with black . gsplat/ tests/ examples/ profiling/.
But some of the tests about 2dgs are failing:
if sparse_grad:
v_quats = v_quats.to_dense()
> v_scales = v_scales.to_dense()
E AssertionError: Tensor-likes are not close!
E
E Mismatched elements: 6 / 16 (37.5%)
E Greatest absolute difference: 5.7848358154296875 at index (3, 2) (up to 0.01 allowed)
E Greatest relative difference: 0.6168138980865479 at index (3, 1) (up to 0.01 allowed)
=================================================================================== short test summary info ===================================================================================
FAILED tests/test_2dgs.py::test_fully_fused_projection_packed_2dgs[False] - AssertionError: Tensor-likes are not close!
FAILED tests/test_2dgs.py::test_fully_fused_projection_packed_2dgs[True] - AssertionError: Tensor-likes are not close!
@FantasticOven2 Came across with these errors while installation.
gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_fwd.cu(82): error: identifier "scale_to_mat" is undefined
gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_fwd.cu(82): error: type name is not allowed
gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_fwd.cu(82): warning #2809-D: ignoring return value from routine declared with "nodiscard" attribute
detected during instantiation of "void fully_fused_projection_packed_fwd_2dgs_kernel(uint32_t, uint32_t, const T *, const T *, const T *, const T *, const T *, int32_t, int32_t, T, T, T, const int32_t *, int32_t *, int32_t *, int64_t *, int64_t *, int32_t *, T *, T *, T *, T *) [with T=float]"
(230): here
2 errors detected in the compilation of "gsplat/cuda/csrc/fully_fused_projection_packed_2dgs_fwd.cu".
error: command '/usr/local/cuda-11.8/bin/nvcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for gsplat
Running setup.py clean for gsplat
Failed to build gsplat