4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00

More robust install instructions (#2277)

Add cuda-toolkit install to readme/docs
This commit is contained in:
Brent Yi 2023-08-01 13:35:22 -07:00 committed by GitHub
parent 98d36ed7d9
commit dab39c25b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 21 deletions

View File

@ -92,17 +92,20 @@ Nerfstudio requires `python >= 3.8`. We recommend using conda to manage dependen
```bash
conda create --name nerfstudio -y python=3.8
conda activate nerfstudio
python -m pip install --upgrade pip
pip install --upgrade pip
```
### Dependencies
Install pytorch with CUDA (this repo has been tested with CUDA 11.7 and CUDA 11.8) and [tiny-cuda-nn](https://github.com/NVlabs/tiny-cuda-nn)
Install PyTorch with CUDA (this repo has been tested with CUDA 11.7 and CUDA 11.8) and [tiny-cuda-nn](https://github.com/NVlabs/tiny-cuda-nn).
`cuda-toolkit` is required for building `tiny-cuda-nn`.
For CUDA 11.7:
```bash
pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
conda install -c "nvidia/label/cuda-11.7.1" cuda-toolkit
pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
```
@ -110,6 +113,8 @@ For CUDA 11.8:
```bash
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
```

View File

@ -33,44 +33,47 @@ python -m pip install --upgrade pip
(pytorch)=
### pytorch
### PyTorch
::::{tab-set}
:::{tab-item} Torch 2.0.1 with CUDA 11.8
- To install 2.0.1 with CUDA 11.8:
Note that if a pytorch version prior to 2.0.1 is installed,
Note that if a PyTorch version prior to 2.0.1 is installed,
the previous version of pytorch, functorch, and tiny-cuda-nn should be uninstalled.
```bash
pip uninstall torch torchvision functorch tinycudann
```
Install pytorch 2.0.1 with CUDA and [tiny-cuda-nn](https://github.com/NVlabs/tiny-cuda-nn)
::::{tab-set}
:::{tab-item} Torch 2.0.1 with CUDA 11.8
Install PyTorch 2.0.1 with CUDA 11.8:
```bash
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
```
To build the necessary CUDA extensions, `cuda-toolkit` is also required. We
recommend installing with conda:
```bash
conda install -c "nvidia/label/cuda-11.7.1" cuda-toolkit
```
:::
:::{tab-item} Torch 2.0.1 with CUDA 11.7
- To install 2.0.1 with CUDA 11.7:
Note that if a pytorch version prior to 2.0.1 is installed,
the previous version of pytorch, functorch, and tiny-cuda-nn should be uninstalled.
```bash
pip uninstall torch torchvision functorch tinycudann
```
Install pytorch 2.0.1 with CUDA and [tiny-cuda-nn](https://github.com/NVlabs/tiny-cuda-nn)
Install PyTorch 2.0.1 with CUDA 11.7:
```bash
pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
```
To build the necessary CUDA extensions, `cuda-toolkit` is also required. We
recommend installing with conda:
```bash
conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
```
:::
::::
@ -258,7 +261,7 @@ While installing tiny-cuda, you run into: `The detected CUDA version mismatches
**Solution**:
Reinstall pytorch with the correct CUDA version.
Reinstall PyTorch with the correct CUDA version.
See [pytorch](pytorch) under Dependencies, above.
<br />