You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I managed to get the codebase running with ROCM. It's slow (partially due to the lack of tcnn) and a little buggy but if anyone has an interest I've pasted the docker file below, I don't think it should be part of the repo as I presume it won't be officially supported.
ENV HSA_OVERRIDE_GFX_VERSION and ENV HCC_AMDGPU_TARGET should be set based on your GPU architecture. My testing was done on a 6700s.
ARG ROCM_VERSION=5.6
ARG OS_VERSION=20.04
ARG PYTHON_VERSION=3.8
ARG PYTORCH_VERSION=2.0.1
# Define base image.
FROM rocm/pytorch:rocm${ROCM_VERSION}_ubuntu${OS_VERSION}_py${PYTHON_VERSION}_pytorch_${PYTORCH_VERSION}
# Variables used at build time.
ARG USER_ID=1000
ARG ROCM_VERSION=5.6
ARG OS_VERSION=20.04
ARG PYTHON_VERSION=3.8
ARG PYTORCH_VERSION=2.0.1
# metainformation
LABEL org.opencontainers.image.version = "0.1.18"
LABEL org.opencontainers.image.source = "https://github.com/nerfstudio-project/nerfstudio"
LABEL org.opencontainers.image.licenses = "Apache License 2.0"
LABEL org.opencontainers.image.base.name="docker.io/library/rocm/pytorch:rocm${ROCM_VERSION}ubuntu${OS_VERSION}_py${PYTHON_VERSION}_pytorch_2.0.1${PYTORCH_VERSION}"
# Set environment variables.
## Set non-interactive to prevent asking for user inputs blocking image creation.
ENV DEBIAN_FRONTEND=noninteractive
## Set timezone as it is required by some packages.
ENV TZ=Europe/Berlin
## Set gpu version variables
ENV HSA_OVERRIDE_GFX_VERSION=10.3.0
ENV HCC_AMDGPU_TARGET=gfx1030
## This is used if you rebuild pytorch
ENV PYTORCH_ROCM_ARCH=gfx900;gfx906;gfx908;gfx90a;gfx1101;gfx1030
# Install required apt packages and clear cache afterwards.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
curl \
ffmpeg \
git \
libatlas-base-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libhdf5-dev \
libcgal-dev \
libeigen3-dev \
libflann-dev \
libfreeimage-dev \
libgflags-dev \
libglew-dev \
libgoogle-glog-dev \
libmetis-dev \
libprotobuf-dev \
libqt5opengl5-dev \
libsqlite3-dev \
libsuitesparse-dev \
nano \
protobuf-compiler \
python-is-python3 \
python3-pip \
qtbase5-dev \
sudo \
vim-tiny \
wget && \
rm -rf /var/lib/apt/lists/*
# Install GLOG (required by ceres).
RUN git clone --branch v0.6.0 https://github.com/google/glog.git --single-branch && \
cd glog && \
mkdir build && \
cd build && \
cmake .. && \
make -j `nproc` && \
make install && \
cd ../.. && \
rm -rf glog
# Add glog path to LD_LIBRARY_PATH.
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
# Install Ceres-solver (required by colmap).
RUN git clone --branch 2.1.0 https://ceres-solver.googlesource.com/ceres-solver.git --single-branch && \
cd ceres-solver && \
git checkout $(git describe --tags) && \
mkdir build && \
cd build && \
cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF && \
make -j `nproc` && \
make install && \
cd ../.. && \
rm -rf ceres-solver
# Install colmap.
RUN git clone --branch 3.8 https://github.com/colmap/colmap.git --single-branch && \
cd colmap && \
mkdir build && \
cd build && \
cmake .. -DCUDA_ENABLED=OFF && \
make -j `nproc` && \
make install && \
cd ../.. && \
rm -rf colmap
# Create non root user and setup environment.
RUN deluser jenkins
RUN useradd -m -d /home/user -g root -G sudo,video,render -u ${USER_ID} user
RUN usermod -aG sudo user
# Set user password
RUN echo "user:user" | chpasswd
# Ensure sudo group users are not asked for a password when using sudo command by ammending sudoers file
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Switch to new user and workdir.
USER ${USER_ID}
WORKDIR /home/user
# Add local user binary folder to PATH variable.
ENV PATH="${PATH}:/home/user/.local/bin"
SHELL ["/bin/bash", "-c"]
# Upgrade pip and install packages.
RUN python -m pip install --user --upgrade pip setuptools pathtools promise pybind11
# Install pycolmap, required by hloc.
RUN git clone --branch v0.4.0 --recursive https://github.com/colmap/pycolmap.git && \
cd pycolmap && \
python -m pip install --user . && \
cd ..
# Install hloc master (last release (1.3) is too old) as alternative feature detector and matcher option for nerfstudio.
RUN git clone --branch master --recursive https://github.com/cvg/Hierarchical-Localization.git && \
cd Hierarchical-Localization && \
python -m pip install --user -e . && \
cd ..
# Install pyceres from source
RUN git clone --branch v1.0 --recursive https://github.com/cvg/pyceres.git && \
cd pyceres && \
python -m pip install --user -e . && \
cd ..
# Install pixel perfect sfm.
RUN git clone --branch v1.0 --recursive https://github.com/cvg/pixel-perfect-sfm.git && \
cd pixel-perfect-sfm && \
python -m pip install --user -e . && \
cd ..
RUN python -m pip install --user omegaconf
# Copy nerfstudio folder and give ownership to user.
ADD . /home/user/nerfstudio
USER root
RUN chown -R user /home/user/nerfstudio
USER ${USER_ID}
# Install nerfstudio dependencies.
RUN cd nerfstudio && \
python -m pip install --user -e . && \
cd ..
RUN git clone https://github.com/Volinga/volinga-model.git && \
cd volinga-model && \
python -m pip install --user -e . && \
cd ..
# Change working directory
WORKDIR /workspace
# Install nerfstudio cli auto completion and enter shell if no command was provided.
CMD ns-install-cli --mode install && /bin/bash
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I managed to get the codebase running with ROCM. It's slow (partially due to the lack of tcnn) and a little buggy but if anyone has an interest I've pasted the docker file below, I don't think it should be part of the repo as I presume it won't be officially supported.
ENV HSA_OVERRIDE_GFX_VERSION and ENV HCC_AMDGPU_TARGET should be set based on your GPU architecture. My testing was done on a 6700s.
Beta Was this translation helpful? Give feedback.
All reactions