gaussian-splatting-cuda icon indicating copy to clipboard operation
gaussian-splatting-cuda copied to clipboard

Request to Ensure Compatibility with Windows

Open MrNeRF opened this issue 1 year ago • 12 comments

As a potential user of this project, I am interested in running it on a Windows environment. At this point, the necessary steps or requirements to get the project running on Windows are not clear. I kindly request that the following updates be made to the project:

  1. Update Documentation: Please add clear and comprehensive instructions to the README or a separate installation guide that outlines the steps to set up and run the project on Windows. This should include any dependencies that need to be installed.
  2. Ensure Compatibility: Please update the codebase, if necessary, to ensure that the project compiles and runs smoothly on Windows.

My main goal as a user is to have a seamless experience when compiling and running this project on a Windows system. I would greatly appreciate it if these changes could be made to satisfy this need.

MrNeRF avatar Aug 18 '23 11:08 MrNeRF

image

DiHubKi avatar Aug 30 '23 03:08 DiHubKi

Cool! How did you do this?

MrNeRF avatar Aug 30 '23 06:08 MrNeRF

instructions 13 sep 2023

  • libtorch-cxx11-abi-shared-with-deps-2.0.1+cu118.zip I replaced it with the Windows version libtorch-win-shared-with-deps-2.0.1+cu118.zip https://download.pytorch.org/libtorch/cu118/libtorch-win-shared-with-deps-2.0.1%2Bcu118.zip

  • In includes/render_utils.cuh change this part of the code

   // Set up rasterization configuration
   GaussianRasterizationSettings raster_settings = {
       .image_height = static_cast<int>(viewpoint_camera.Get_image_height()),
       .image_width = static_cast<int>(viewpoint_camera.Get_image_width()),
       .tanfovx = std::tan(viewpoint_camera.Get_FoVx() * 0.5f),
       .tanfovy = std::tan(viewpoint_camera.Get_FoVy() * 0.5f),
       .bg = bg_color,
       .scale_modifier = scaling_modifier,
       .viewmatrix = viewpoint_camera.Get_world_view_transform(),
       .projmatrix = viewpoint_camera.Get_full_proj_transform(),
       .sh_degree = gaussianModel.Get_active_sh_degree(),
       .camera_center = viewpoint_camera.Get_camera_center(),
       .prefiltered = false};

to this

   // Set up rasterization configuration
   GaussianRasterizationSettings raster_settings = {
       static_cast<int>(viewpoint_camera.Get_image_height()),
       static_cast<int>(viewpoint_camera.Get_image_width()),
       std::tan(viewpoint_camera.Get_FoVx() * 0.5f),
       std::tan(viewpoint_camera.Get_FoVy() * 0.5f),
       bg_color,
       scaling_modifier,
       viewpoint_camera.Get_world_view_transform(),
       viewpoint_camera.Get_full_proj_transform(),
       gaussianModel.Get_active_sh_degree(),
       viewpoint_camera.Get_camera_center(),
       false};
  • In src/parameters.cu add #include <filesystem> and change this part of the code
namespace gs {
    namespace param {
        OptimizationParameters read_optim_params_from_json() {

            // automatically get the root path. Works only on linux, I guess.
            std::filesystem::path executablePath = std::filesystem::canonical("/proc/self/exe");
            std::filesystem::path parentDir = executablePath.parent_path().parent_path();
            std::filesystem::path json_path = parentDir / "parameter/optimization_params.json";
            // Check if the file exists before trying to open it

to this

namespace gs {
    namespace param {
        OptimizationParameters read_optim_params_from_json() {

            std::filesystem::path json_path =  "parameter/optimization_params.json"; 
            // Check if the file exists before trying to open it
  • In CMakeLists.txt i added set(CAFFE2_USE_CUDNN 1) to enable cuDNN just in case

  • After using build command cmake -B build -DCMAKE_BUILD_TYPE=Release you need to open generated project (in build folder) in Visual Studio 2022 and select Release version

  • Then you need to add python311.lib manually to dependencies: (C:\Program Files\Python311\libs\python311.lib)

https://github.com/MrNeRF/gaussian-splatting-cuda/assets/53359732/8d2ef489-12fc-4a9d-aa38-2c9cc8bf6679

And it compiled successfully

  • Now for the program to work, you need to copy all .dll files from the folder

gaussian-splatting-cuda\external\libtorch\lib

to the folder

gaussian-splatting-cuda\build\Release

image

And you need to copy folder

gaussian-splatting-cuda\parameter

to the folder

gaussian-splatting-cuda\build\Release

image

DiHubKi avatar Aug 30 '23 08:08 DiHubKi

Ok, thank you very much. It appears to me as almost everything you are doing relates to libtorch. This will be very soon fully replaced by CUDA and then we can completely ditch it. This should hopefully make the setup a lot easier.

MrNeRF avatar Aug 30 '23 08:08 MrNeRF

windows Compiled successfully, but failed to train during training。 image

ydi-mua avatar Oct 13 '23 08:10 ydi-mua

Seems not to train at all as at appears from your terminal output. Just loads the data. Not sure, what the issue is.

MrNeRF avatar Oct 13 '23 12:10 MrNeRF

Hi, may I ask whether the libtorch is replaced yet? Thanks for any comment.

ZiXuanVickyLu avatar Mar 02 '24 21:03 ZiXuanVickyLu

No, it is not. I had no time to implement this fully. :(

MrNeRF avatar Mar 02 '24 22:03 MrNeRF

windows Compiled successfully, but failed to train during training。 image

I'm having the same issue, have you solved this issue please?

LfWhat avatar Apr 22 '24 00:04 LfWhat

  • https://download.pytorch.org/libtorch/cu118/libtorch-win-shared-with-deps-2.0.1%2Bcu118.zip

Excuse me, what model of graphics card are you using and what is the CUDA version, I tried the exe file you posted, but it still doesn't work, I guess it is related to the graphics card model or CUDA version

LfWhat avatar Apr 22 '24 00:04 LfWhat

I'm using cuda 11.8 and 1050 ti

DiHubKi avatar Apr 22 '24 01:04 DiHubKi

I'm using cuda 11.8 and 1050 ti

ohmy god i finally find my problem. you ve mentioned image the key is Release,not debug,i have to admit that im not so familar with visualstudio,thanks a lot!!!!

LfWhat avatar Apr 22 '24 01:04 LfWhat