We provide some tips for XRNeRF installation in this file.
- Linux
- Python 3.7
- PyTorch 1.10 (necessary)
- CUDA 11.0 (necessary)
- 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
- lpips: Install by
pip install lpips
- trimesh: Install by
pip install trimesh
- smplx: Install by
pip install smplx
- 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"
About hardware requirements: Instant-NGP need GPU-ARCH>=75, which means that at least a RTX 20X0 is required to have a full support.
RTX 30X0 | A100 | RTX 20X0 | TITAN V / V100 | GTX 10X0 / TITAN Xp | GTX 9X0 | K80 |
---|---|---|---|---|---|---|
86 | 80 | 75 | 70 | 61 | 52 | 37 |
If you don't need instant-ngp, spconv depends the minimum cuda version. So at least cuda 10.2 is needed.
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+cu111-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
- you can use
pip install requirements.txt
to install most of the needed pkgs. If this step succeeds, you should jump tokilo-cuda
andspconv
step to install them manually. Or you can skip this step and follow the installation steps below pip install 'opencv-python>=3' yapf imageio scikit-image lpips trimesh smplx
- 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
kilo-cuda
following their Installation(optional, only needed for kilo-nerf) - install
tcnn
usingpip install git https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
, or following their Installation(optional, only needed for instant-ngp)
- build cuda-extension
raymarch
for instant-ngp supported, following ngp_raymarch - build cuda-extension
mesh_grid
for gnr supported, following mesh_grid
- In order to support the
GNR
algorithm, you need to download thesmpl_t_pose
folder from GNR, and modifybasedata_cfg.t_pose_path
inconfigs/gnr/gnr_genebody.py
to the corresponding storage location
You need to set docker daemon, to enable docker-build's gpu support (for cuda extension install).
sudo apt-get install nvidia-container-runtime -f -y
sudo cp -f docker/daemon.json /etc/docker
sudo systemctl restart docker
See here for detail.
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 /bin/bash
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
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