commit 4092e6e85e45c56abdb9ba31e77fdbf05bd0c6dc Author: yubbit Date: Mon Nov 17 14:26:51 2025 +0800 Add Lichtfeld-Studio files diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e897357 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "lichtfeld-studio/LichtFeld-Studio"] + path = lichtfeld-studio/LichtFeld-Studio + url = https://github.com/MrNeRF/LichtFeld-Studio + branch = master diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..9a3eb3a --- /dev/null +++ b/config.yml @@ -0,0 +1,34 @@ +services: + + base-app: + restart: no + stdin_open: true + tty: true + shm_size: '12gb' + volumes: + - type: bind + source: ../data + target: /workspace/data + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [ gpu ] + + win-gui-app: + extends: + service: base-app + volumes: + - type: bind + source: /run/desktop/mnt/host/wslg/.X11-unix + target: /tmp/.X11-unix + - type: bind + source: /run/desktop/mnt/host/wslg + target: /mnt/wslg + environment: + DISPLAY: :0 + WAYLAND_DISPLAY: wayland-0 + XDG_RUNTIME_DIR: /mnt/wslg/runtime-dir + PULSE_SERVER: /mnt/wslg/PulseServer diff --git a/lichtfeld-studio/Dockerfile b/lichtfeld-studio/Dockerfile new file mode 100644 index 0000000..d0e2995 --- /dev/null +++ b/lichtfeld-studio/Dockerfile @@ -0,0 +1,104 @@ +# Builder stage +ARG CUDA_VERSION=12.8.0 +FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu24.04 AS builder + +ENV DEBIAN_FRONTEND=noninteractive +ENV HOME=/workspace +WORKDIR ${HOME} + +# Install build tools, compilers, CMake, vcpkg, and project dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + curl \ + git \ + gnupg2 \ + libglu1-mesa-dev \ + libxcursor-dev \ + libxinerama-dev \ + locales \ + lsb-release \ + ninja-build \ + pkg-config \ + python3 \ + python3-dev \ + python3-pip \ + software-properties-common \ + sudo \ + unzip \ + wget \ + xorg-dev \ + zip && \ + add-apt-repository ppa:ubuntu-toolchain-r/test && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + gcc-14 \ + g++-14 \ + gfortran-14 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 60 && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 60 && \ + update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 60 && \ + update-alternatives --set g++ /usr/bin/g++-14 && \ + update-alternatives --set gcc /usr/bin/gcc-14 && \ + update-alternatives --set gfortran /usr/bin/gfortran-14 && \ + rm -rf /var/lib/apt/lists/* + +# Bootstrap vcpkg +RUN git clone https://github.com/microsoft/vcpkg.git ${HOME}/vcpkg && \ + cd ${HOME}/vcpkg && ./bootstrap-vcpkg.sh -disableMetrics + +ENV VCPKG_ROOT=${HOME}/vcpkg +ENV PATH=${VCPKG_ROOT}:$PATH + +# Install specific CMake version +RUN wget https://github.com/Kitware/CMake/releases/download/v4.0.3/cmake-4.0.3-linux-x86_64.sh && \ + chmod +x cmake-4.0.3-linux-x86_64.sh && \ + ./cmake-4.0.3-linux-x86_64.sh --skip-license --prefix=/usr/local && \ + rm cmake-4.0.3-linux-x86_64.sh + +# Fetch Libtorch +WORKDIR ${HOME}/LichtFeld-Studio +RUN wget https://download.pytorch.org/libtorch/cu128/libtorch-cxx11-abi-shared-with-deps-2.7.1%2Bcu128.zip && \ + unzip libtorch-cxx11-abi-shared-with-deps-2.7.1+cu128.zip -d external/ && \ + rm libtorch-cxx11-abi-shared-with-deps-2.7.1+cu128.zip + +# Build the project. Disable OpenGL-CUDA Interop since this isn't supported by +# WSL yet https://docs.nvidia.com/cuda/wsl-user-guide/index.html +COPY LichtFeld-Studio ${HOME}/LichtFeld-Studio +RUN cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_CUDA_GL_INTEROP=OFF \ + -G Ninja && \ + cmake --build build -- -j8 + +# Runtime stage +FROM nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu24.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV HOME=/workspace +WORKDIR ${HOME} + +# Install only the runtime dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + libgl1 \ + libglu1-mesa \ + libgomp1 \ + openssh-client \ + unzip \ + wget \ + x11-apps \ + zenity && \ + rm -rf /var/lib/apt/lists/* + +# Copy built artifacts from the builder stage +COPY --from=builder ${HOME}/LichtFeld-Studio/build ${HOME}/LichtFeld-Studio/build +COPY --from=builder ${HOME}/LichtFeld-Studio/external ${HOME}/LichtFeld-Studio/external +COPY --from=builder ${HOME}/LichtFeld-Studio/parameter ${HOME}/LichtFeld-Studio/parameter +COPY --from=builder ${HOME}/LichtFeld-Studio/resources ${HOME}/LichtFeld-Studio/resources +COPY --from=builder ${HOME}/LichtFeld-Studio/weights ${HOME}/LichtFeld-Studio/weights + +ENV PATH="${HOME}/LichtFeld-Studio/build:$PATH" + +ENTRYPOINT ["/bin/bash"] diff --git a/lichtfeld-studio/LichtFeld-Studio b/lichtfeld-studio/LichtFeld-Studio new file mode 160000 index 0000000..48a4a85 --- /dev/null +++ b/lichtfeld-studio/LichtFeld-Studio @@ -0,0 +1 @@ +Subproject commit 48a4a8557324840f7f1a238b773c73598b3c3128 diff --git a/lichtfeld-studio/docker-compose.yml b/lichtfeld-studio/docker-compose.yml new file mode 100644 index 0000000..e90f28d --- /dev/null +++ b/lichtfeld-studio/docker-compose.yml @@ -0,0 +1,9 @@ +services: + + lichtfeld-studio: + build: + context: . + image: lichtfeld-studio:dev + extends: + file: ../config.yml + service: win-gui-app diff --git a/lichtfeld-studio/run.bat b/lichtfeld-studio/run.bat new file mode 100644 index 0000000..e5032fc --- /dev/null +++ b/lichtfeld-studio/run.bat @@ -0,0 +1 @@ +docker compose run --rm -it --name lichtfeld-studio lichtfeld-studio \ No newline at end of file