Windows

TLDR

  • Install Visual Studio 2022
  • Install CUDA Toolkit 12.8 after installing Visual Studio
  • Install Python 3.13.X
  • Install GIT
  • Follow the instructions for "Windows"

Step 1: Installation Dependencies

Visual Studio 2022

  • Download installer from https://visualstudio.microsoft.com/vs/community/
    • NOT Visual Studio Code
      • this does not contain the required files for building LichtFeld Studio
    • NOT Visual Studio 2019
      • This contains old cmake version
  • Run setup.exe
  • Install the following packages:
    • Desktop Development with C++
image
  • After installation is complete, exit Visual Studio if it was started automatically

CUDA Toolkit 12.8

  • Important:
    • Dont start installation until Visual Studio has completed installation
    • if you have another version of CUDA Toolkit, uninstall it and re-install CUDA Toolkit 12.
  • Download from https://developer.nvidia.com/cuda-12-8-0-download-archive
  • Select windows as your operating system, select x86_64 as architecture and select your Windows version and select "exe (local)".
  • Download the 3.2GB file
image
  • After download, execute the file and unpack the installation files in the proposed directory
  • Use "express" installation during installation
image
  • After installation is complete, verify if "nsight for Visual Studio 2022" was installed
image
  • Press "next" and close the installation

Python 3

  • Download the Windows installer for the latest stable release from https://www.python.org/downloads/windows/
  • Run the installer
  • Choose "Customize the installation"
  • In the first options screen, select all options
image
  • In "Advanced options", make sure the following are selected:
    • Add Python to environment variables
    • Download debug binaries
image
  • Press "install" to start the installation
  • Close the installer when completed

Git

  • Download Windows installer from https://git-scm.com/downloads
  • Follow instructions, use default settings for all options (there are many)
  • Close installation after completion

Step 2: Verifying your prerequisites

  • Press start and find "developer command prompt for VS 2022"
  • Type the following commands to verify your installation:
    cmake --version
    
    nvcc --version
    
    git --version
    
    Python --version
    
  • Cmake: Must be 3.30 or higher
  • nvcc: Verify that 12.8 is being used
  • git: Verify that git shows version information
  • python: Verify that 3.10 or above is used
image

Step 3: Downloading and building LichtFeld Studio

  • Press start and find "x64 native tools command prompt for VS 2022"

  • Create a directory "repos".

    note: create this folder in a directory that does not contain spaces or the build process will fail later

    mkdir repos
    
  • Go to the directory "repos"

    cd repos
    
  • Set up vcpkg (one-time setup)

    git clone https://github.com/microsoft/vcpkg.git
    cd vcpkg && .\bootstrap-vcpkg.bat -disableMetrics && cd ..
    
  • Clone repository

    git clone https://github.com/MrNeRF/LichtFeld-Studio
    
  • Create directories

    cd LichtFeld-Studio
    if not exist external mkdir external
    if not exist external\debug mkdir external\debug
    if not exist external\release mkdir external\release
    
  • Download LibTorch (Debug)

    curl -L -o libtorch-debug.zip https://download.pytorch.org/libtorch/cu128/libtorch-win-shared-with-deps-debug-2.7.0%2Bcu128.zip
    tar -xf libtorch-debug.zip -C external\debug
    del libtorch-debug.zip
    
  • Download LibTorch (Release)

    curl -L -o libtorch-release.zip https://download.pytorch.org/libtorch/cu128/libtorch-win-shared-with-deps-2.7.0%2Bcu128.zip
    tar -xf libtorch-release.zip -C external\release
    del libtorch-release.zip
    
  • Build configuration files and download dependencies

    cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake"
    
  • Build LichtFeld Studio

    cmake --build build -j
    

    After the last step is complete, you should have a new directory "\build" where you can find "LichtFeld-Studio.exe" and you can execute that file to run LichtFeld Studio.

image image

Troubleshooting

Before anything else:

  • Make sure you run all commands from the "developer command prompt for VS 2022" (not standard command or cmd or powershell)
  • Verify if you have the proper requirements installed -see Step 2
  • Uninstall all CUDA Toolkit versions and re-install 12.
  • Delete the gaussian splatting directory, and restart the instructions from Step 3

Common issues

Release build works, but debug build fails with error "cannot open file 'python313_d.lib'"

  • This could be missing python debug libraries
  • Run the python setup again, choose "modify" and select "download debug binaries"
  • Copy the files python313_d.lib from your python installation directory to the build\debug directory

Cannot open include file

image
  • Run the visual studio installation and modify the installation. Verify you have the C++ package installed (see step 1)

Building does not generate the .exe, but only the lib file

image
  • Possible cause: build files not up-to date with latest changes
  • Solution: Re-generate the configuration files using in the command prompt and rebuild LichtFeld Studio
    cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake"
    cmake --build build -j
    

Unable to find Ninja

CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CUDA_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
  • Possible cause: your build directory is containing a SPACE in the path. The log file will show something like:
-- Warning: Paths with embedded space may be handled incorrectly by configure:
   D:/repo space/repos/vcpkg/packages/hwloc_x64-windows
   D:/repo space/repos/LichtFeld-Studio/build/vcpkg_installed/x64-windows
   Please move the path to one without whitespaces!

Solution: move your directory structure (LichtFeld-Studio and vcpkg) to a directory without a space.

Other things to check

  • Type "set" in the console
  • Verify the following environment variables
    • CUDA_ROOT -> must point to your cuda toolkit installation
      • INCLUDE -> must point to your Visual Studio installation
      • PATH -> must contain path to all binaries of the installed tools (Python, Visual Studio, CUDA Toolkit, Git)

Manual installation of CUDA in Visual Studio

  • set CUDA_ROOT environment variable manually
  • copy the files from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\extras\visual_studio_integration\MSBuildExtensions to C:\Program Files\Microsoft Visual Studio\ 2022 \Community\MSBuild\Microsoft\VC\v170\BuildCustomizations