-
Notifications
You must be signed in to change notification settings - Fork 314
Build Instructions ‐ Windows
Note: If you only want to run Lichtfeld Studio, you don't need to do any of this. Donate to support the project then you can just grab a pre-built zip from here instead, extract it, and just run the .exe in the bin folder.
- Install Visual Studio 2022
- Install CUDA Toolkit 12.8 after installing Visual Studio
- Install GIT
- Install PERL
- Follow the instructions for Windows
- Download the community edition installer from https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#release-dates-and-build-numbers
-
NOT Visual Studio Code
- this does not contain the required files for building LichtFeld Studio
-
NOT Visual Studio 2019
- This contains old cmake version
-
NOT Visual Studio 2026
- This version is not yet detected by CUDA installations
-
NOT Visual Studio Code
- Run the downloaded setup program vs_Community.exe
- Install the following packages:
- Desktop Development with C++
- After installation is complete, exit Visual Studio if it was started automatically
-
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
- After download, execute the file and unpack the installation files in the proposed directory
- Use "express" installation during installation
- After installation is complete, verify if "nsight for Visual Studio 2022" was installed
- Press "next" and close the installation
- Download Windows installer from https://git-scm.com/downloads
- Follow instructions, use default settings for all options (there are many)
- Close installation after completion
- Install Strawberry Perl from https://strawberryperl.com/, or via your favorite package manager (e.g. scoop, chocolatey, ...)
- Press start and find "x64 native tools command prompt for VS 2022"
- Type the following commands to verify your installation:
cmake --version nvcc --version git --version perl --version
- Cmake: Must be 3.30 or higher
- nvcc: Verify that 12.8 is being used
- git: Verify that git shows version information
- perl: Must be 5.42 or higher
-
Press start and find "x64 native tools command prompt for VS 2022" Execute the commands below:
-
go to your user directory
cd %userprofile%
-
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 --recurse-submodules https://github.com/MrNeRF/LichtFeld-Studio
-
Checkout stable version
cd LichtFeld-Studio git checkout v0.4.0
-
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.
If you have an earlier version of LichtFeld Studio and want to upgrade to the latest release, you can use these instructions:
-
Press start and find "x64 native tools command prompt for VS 2022"
-
go to the directory where you installed LichtFeld Studio and execute the commands:
cd vcpkg git pull cd .. cd LichtFeld-Studio git pull git checkout v0.5.1 git pull cmake --build build -j
This will update vcpkg if required, and after that, we grab the latest version of LichtFeld-Studio and build it from source again.
If you would like to test and build the latest source release:
powershell cd vcpkg git pull cd .. cd LichtFeld-Studio git pull git checkout master git pull cmake --build build -j
Before anything else:
- Make sure you run all commands from the "x64 native tools command prompt for VS 2022" (not standard command or cmd or powershell or "developer command prompt for VS 2022")
- Verify if you have the proper requirements installed -see Step 2
- Uninstall all CUDA Toolkit versions and re-install 12.8
- Delete the build directory, and restart the instructions from Step 3
- 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
An example may look like this:
error: rename_or_delete("###/vcpkg/buildtrees/versioning_/versions/args/eca261df4af60a96e04f46c28f27e5aeee0290a1_46724.tmp", "###\vcpkg\buildtrees\versioning_\versions\args\eca261df4af60a96e04f46c28f27e5aeee0290a1"): unknown errornote: while checking out port args with git tree eca261df4af60a96e04f46c28f27e5aeee0290a1
note: See https://learn.microsoft.com/vcpkg/users/versioning-troubleshooting?WT.mc_id=vcpkg_inproduct_cli for more information.
note: while loading args@6.4.7
Deleting buildtrees and regenerating won't fix the issue.
The solution is to find the source of the problem: what blocks delete/rename. Try these first:
- Temporarily add the
reposfolder containing LichtFeld-Studio and vcpkg to the antivirus exclude list (e.g. Windows Security > Virus & threat protection > Exclusions for Windows defender or the equivalent of the AV software you use) - Temporarily pause any file search/indexing services (e.g. run
services.mscand stop Windows Search (or similar custom search services)) - Temporarily pause file sync services (e.g. DropBox, OneDrive, GoogleDrive, etc.), especially if they access parent folders.
This should resolve the issue and dependencies should intall via vcpkg.
If the problem persists, you may need to investigate deeper and procmon can help filter changes to the repos subfolders and find access denied / shared violation type of events and their sources.
- Run the visual studio installation and modify the installation. Verify you have the C++ package installed (see step 1)
- 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
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 1: 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.
- Possible cause 2: There is a problem with your current vcpkg installation
Solution: Delete repos/vcpkg and redo the vcpkg setup step
- If you find this in your build output
catastrophic error: out of memory
- Reduce used threads:
cmake --build build -j4 # 4 threads
If your Windows installation is not using English as the default language, Visual Studio may install a non English language pack.
This can cause vcpkg to fail when building certain dependencies, such as expat, due to localization related issues in the Visual Studio toolchain.
To avoid this, or to fix build failures already encountered:
- Open the Visual Studio Installer
- Select "Modify"
- Remove all non English language packs
- Install the "English" language pack
- Apply changes and restart the x64 Native Tools Command Prompt
After applying these changes, retry the build process.
- 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)
- set CUDA_ROOT environment variable manually
- copy the files from
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\extras\visual_studio_integration\MSBuildExtensionstoC:\Program Files\Microsoft Visual Studio\ 2022 \Community\MSBuild\Microsoft\VC\v170\BuildCustomizations