ubc-vision / 3dgs-mcmc

Implementation of the paper "3D Gaussian Splatting as Markov Chain Monte Carlo"
https://ubc-vision.github.io/3dgs-mcmc/
Other
239 stars 10 forks source link

utils.cu build error fix in submodules/diff-gaussian-rasterization #4

Open KotaYonezawa opened 1 week ago

KotaYonezawa commented 1 week ago

Thanks a lot for great code release! I could run on Windows 11 PC, and I needed build error fix in utils.cu in submodules/diff-gaussian-rasterization. I think code should be fixed for convenience.

The error message I faced was as follows.

C:\Work\3dgs-mcmc\submodules\diff-gaussian-rasterization\cuda_rasterizer\utils.cu(29): error: calling a host function("double ::sqrt<int, (int)0> (T1)") from a global function("compute_relocation") is not allowed C:\Work\3dgs-mcmc\submodules\diff-gaussian-rasterization\cuda_rasterizer\utils.cu(29): error: identifier "sqrt<int, (int)0> " is undefined in device code

I modified following part.

Before modification: float term = (pow(-1, k) / sqrt(k + 1)) * pow(opacity_new[idx], k + 1);

After modification: (float cast was added in sqrt()) float term = (pow(-1, k) / sqrt((float)(k + 1))) * pow(opacity_new[idx], k + 1);

Then I could build diff-gaussian-rasterization successfully.

faster-developer commented 1 week ago

I had to replace sqrt with sqrtf.

shakibakh commented 4 days ago

The code is only tested on Ubuntu, the specifics are now updated in README.

amballa commented 2 days ago

Had the same error building the rasterization submodule. Thanks @KotaYonezawa