graphdeco-inria/gaussian-splatting 高斯喷射 windows CUDA 12.8环境编译

217 阅读2分钟

graphdeco-inria/gaussian-splatting windows CUDA 12.8 environment

Note from github.com/graphdeco-i…

CUDA Toolkit 12.8 Install

Check in terminal if you already have a previous version of CUDA Toolkit installed, nvcc --version

  • In any case, install CUDA Toolkit 12.8 on your system here
    • If you had a previous version, you need to update your environment variables to make 12.8 the current version
    • As explained here:
      • Open env. variables
      • In System vars, change/create the env var CUDA_PATH with value pointing to the CUDA Toolkit 12.8 install folder, e.g. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8
      • In System vars, create a new var called CUDA_PATH_V12_8 with the same value said above (CUDA 12.8 folder)
      • In System vars, move the two entries referring to CUDA 12.8 to the top of the list. In my case, they are C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\libnvvp and C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin.
      • In my case the above entries did not exist, so I had to create them
    • Close all terminals, reopen one and check your nvcc version again: nvcc --version
    • If successfull, the version now should be 12.8

GS repository

  • Clone repo: git clone github.com/graphdeco-i… --recursive
  • From Ubuntu 24.04 & CUDA 12 Support #923 , I edited submodules/simple-knn/simple-knn.cu to include float.h: #include <float.h>. I did not have to make the other changes listed
  • There are some part of the process that needs to be done manually, so I skipped installation using a .env file.
  • Using Anaconda for the rest of the process:
    • conda create -n "gaussian-splatting" python=3.9 ipython (python 3.9 is the minimum required version for torch here)
    • conda activate gaussian-splatting
  • Below, the list and version of packages (some of them inspired by Ubuntu 24.04 & CUDA 12 Support #923), and the commands to manually install them
    • cuda-toolkit=12.4 install: conda install -c nvidia cuda-toolkit=12.4
    • plyfile install: conda install -c conda-forge plyfile
    • tqdm install: conda install tqdm
    • torch, torchvision, torchaudio from pre-release channel, install: pip3 install --pre torch torchvision torchaudio --index-url download.pytorch.org/whl/nightly…
    • opencv-python, install: pip install opencv-python
    • joblib, install: pip install joblib
  • Before installing submodules, follow this guide I wrote here in issue Latest Visual Studio 2022 (17.10) not compatiable with CUDA #833, otherwise wheel will fail because it can't find VS19 Build Tools
  • Finally, install submodules:
    • cd to cloned folder
    • submodules/diff-gaussian-rasterization, install: pip install submodules/diff-gaussian-rasterization
    • submodules/simple-knn, install: pip install submodules/simple-knn
    • submodules/fused-ssim, install: pip install submodules/fused-ssim

Install submoudules

Here are my steps:

  • Download and run just the Visual Studio 2019 Build Tools from your link (last version is fine). You don't actually need to download the Professional version, build tools are enough.
  • In the VS19 installer, install the "Desktop development with C++" package and make sure that MSVC v142 is checked in the right panel
  • Not sure if this step is necessary, but add the following path to your Windows system env PATH:
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64 (or a similar version/path in case of a different version)
  • Close all your Anaconda prompts, and open a fresh one.
  • cd to your gaussian splatting repository
    (cd /gaussian-splatting)
  • Activate the environment
    (conda activate gaussian_splatting)
  • As this comment suggested, I had to add this package to the env:
    conda install -c anaconda vs2019_win-64.
    conda install -c anaconda vs2022_win-64.
    It probably sets up all the correct env paths.
  • Similarly to this comment, make sure to exec
    git submodule update --init --recursive
  • Install submodules: pip install submodules\diff-gaussian-rasterization
    pip install submodules\simple-knn
    pip install submodules\fused-ssim