SplatFields icon indicating copy to clipboard operation
SplatFields copied to clipboard

problem in environment

Open hermann74 opened this issue 11 months ago • 0 comments

You tested on Ubuntu 18.04 with CUDA 11.6 and GCC 9.4.0, but it doesn’t work on Fedora 40 with CUDA 11.7 and GCC 14.2.

After multiple changes to the version requirements and testing in different Conda environments, we decided to build a Dockerfile as shown below:

1. Clone the repository:

git clone https://github.com/markomih/SplatFields.git cd ./SplatFields

2. Copy the Dockerfile and the new environment.yml file below:

Here you can provide the actual Dockerfile and environment.yml contents as necessary.

3. Build the Docker image:

sudo docker build --progress=plain -t splatfields-cuda .

4. Run the Docker container with gpu support:

docker run --gpus all -it -v $(pwd):/workspace splatfields-cuda:latest

5. test from doccker image

chmod +x run_blender.sh Download data and adjust path in file ./run_blender.sh

environment.yaml

name: SplatFields
channels:
  - pytorch
  - pyg
  - conda-forge
  - defaults
dependencies:
  - mkl
#  - cudatoolkit=11.6
  - plyfile=0.8.1
  - python 3.8
  - pip=22.3.1

  - tqdm
  - pip:
    - einops
    - lpips
    - laspy
    - opencv-python
    - trimesh
    - imageio
    - packaging
    - scikit-learn
    - imageio==2.31.2
    - imageio-ffmpeg==0.4.9
    - imagesize==1.4.1
    - scikit-image==0.19.3

Dockerfile

FROM nvidia/cuda:11.6.2-cudnn8-devel-ubuntu18.04

# Mettre à jour les paquets et installer GCC 9
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    software-properties-common \
    libopenblas-dev \
    libomp-dev \
    cuda-toolkit-11-6 \
    wget \
    curl \
    git \
    nano \
    ninja-build \
    build-essential \
    autoconf \
    libtool \
    libgl1-mesa-glx && \
    add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
    apt-get install -y gcc-9 g++-9 && \
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 && \
    update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Installer Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /miniconda.sh && \
    bash /miniconda.sh -b -p /opt/conda && \
    rm /miniconda.sh
# Définir PATH pour inclure Miniconda
ENV PATH="/opt/conda/bin:$PATH"
# Copier environment.yml
COPY environment.yml /tmp/environment.yml
# Créer l'environnement Conda
RUN conda env create -f /tmp/environment.yml  && \
    conda clean -a -y -f
# Activer l'environnement Conda
ENV PATH="/opt/conda/envs/SplatFields/bin:$PATH"
RUN /opt/conda/bin/conda init bash && \
     echo "source /opt/conda/bin/activate SplatFields" >> ~/.bashrc

# Mettre à jour pip, setuptools, wheel
RUN /opt/conda/envs/SplatFields/bin/pip install --upgrade setuptools wheel

# install pytorch ...
RUN /opt/conda/envs/SplatFields/bin/pip install --no-cache-dir \
        --timeout 120 \
        torch==1.12.1+cu116 \
        torchvision==0.13.1+cu116 \
        torchaudio==0.12.1 \
        --extra-index-url https://download.pytorch.org/whl/cu116 \
        diffusers==0.21.4 \
        mmcv==1.6.0 \
        mmcv-full==1.6.0 && \
    rm -rf ~/.cache/pip

ENV CUDA_HOME=/usr/local/cuda
ENV PATH=$CUDA_HOME/bin:$PATH
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libiomp5.so
ENV OMP_NUM_THREADS=1
ENV MKL_THREADING_LAYER=GNU
ENV TORCH_CUDA_ARCH_LIST="7.5 8.0+PTX"

RUN nvcc --version

# Installer mmgeneration
RUN /opt/conda/envs/SplatFields/bin/pip install --no-cache-dir \
    -e git+https://github.com/open-mmlab/mmgeneration@f6551e1d6ca24121d1f0a954c3b3ac15de6d302e#egg=mmgen && \
    rm -rf ~/.cache/pip

RUN /opt/conda/envs/SplatFields/bin/pip install --no-cache-dir \
    git+https://gitlab.inria.fr/bkerbl/simple-knn.git@44f764299fa305faf6ec5ebd99939e0508331503#egg=simple_knn && \
    rm -rf ~/.cache/pip

RUN /opt/conda/envs/SplatFields/bin/pip install --no-cache-dir \
    git+https://github.com/ingra14m/depth-diff-gaussian-rasterization@f2d8fa9921ea9a6cb9ac1c33a34ebd1b11510657#egg=diff_gaussian_rasterization && \
    rm -rf ~/.cache/pip

WORKDIR /workspace
CMD ["bash", "-l"]
# docker run --gpus all -it -v $(pwd):/workspace splatfields-cuda:latest
# POST Installer
# pip3 install git+https://github.com/ingra14m/depth-diff-gaussian-rasterization@f2d8fa9921ea9a6cb9ac1c33a34ebd1b11510657#egg=diff_gaussian_rasterization
# pip3 install git+https://gitlab.inria.fr/bkerbl/simple-knn.git@44f764299fa305faf6ec5ebd99939e0508331503#egg=simple_knn
# pip3 install -e  git+https://github.com/open-mmlab/mmgeneration@f6551e1d6ca24121d1f0a954c3b3ac15de6d302e#egg=mmgen
# nano -l /opt/conda/envs/SplatFields/lib/python3.8/site-packages/diffusers/utils/dynamic_modules_utils.py
# data/nerf_data/nerf_example_data/nerf_synthetic/

hermann74 avatar Feb 27 '25 10:02 hermann74