We provide some tips for XRNerf installation in this file.
- Linux
- Python 3.7+
- PyTorch 1.10+
- CUDA 11.0+
- GCC 7.5+
- build-essential: Install by
apt-get install -y build-essential git ninja-build ffmpeg libsm6 libxext6 libgl1
- mmcv-full
- Numpy
- ffmpeg (4.2 is preferred)
- opencv-python 3+: Install by
pip install opencv-python>=3
- imageio: Install by
pip install imageio
- scikit-image: Install by
pip install scikit-image
- spconv: Install proper vision that matches your cuda-vision, for example
pip install spconv-cu113
- pytorch3d: Install by
pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
sudo apt install libgl-dev freeglut3-dev build-essential git ninja-build ffmpeg libsm6 libxext6 libgl1
conda create -n xrnerf python=3.7 -y
conda activate xrnerf
- check pytorch-cuda vision match table from here or here
- find a proper torch vision (>=1.10.0 and match your cuda vision) from here, like
cu111/torch-1.10.0%2Bcu111-cp37-cp37m-linux_x86_64.whl
, download the whl file - install your whl file, for example
pip install torch-1.10.0+cu111-cp37-cp37m-linux_x86_64.whl
- check here and install specified vision of torchvision, for example
pip install torchvision==0.12.0
pip install opencv-python>=3 yapf imageio scikit-image
- install
mmcv-full
following their Installation - install
spconv
using pip install, for examplepip install spconv-cu111
. notice that only specified cuda-vision are supported, following their Installation - install
pytorch3d
usingpip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
- install
tcnn
usingpip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
- install
kilo-cuda
following their Installation - install
tcnn
usingpip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
, or following their Installation
- build cuda-extension
raymarch
for instant-ngp supported, following ngp_raymarch - build cuda-extension
mesh_grid
for gnr supported, following mesh_grid
We provide a Dockerfile to build an image.
docker build -f ./docker/Dockerfile --rm -t xrnerf .
Important: Make sure you've installed the nvidia-container-toolkit.
Create a container with command:
docker run --gpus all -it xrnerf /workspace
Open a teiminal in your host computer, copy project into docker container
# d287273af72e is container id, using 'docker ps -a' to find id
docker cp ProjectPath/xrnerf d287273af72e:/workspace
- Install
tcnn
usingIf you have installedgit clone --recurse-submodules https://gitclone.com/github.com/NVlabs/tiny-cuda-nn.git cd tiny-cuda-nn/bindings/torch python setup.py install
tcnn
in dockerfile, skip this. - Build cuda-extension
raymarch
for instant-ngp supported, folling ngp_raymarch - Build cuda-extension
mesh_grid
for gnr supported, following mesh_grid
To verify whether XRNerf and the required environment are installed correctly, we can run unit-test python codes
coverage run --source xrnerf/models -m pytest -s test/models && coverage report -m
Notice that coverage
and pytest
need to be installed before that
pip install coverage pytest -i https://pypi.tuna.tsinghua.edu.cn/simple