Installation
NeCT has been tested on Windows and Linux with the following dependencies:
| Package | Version | Notes |
|---|---|---|
| python | 3.11 | 3.12 | |
| pytorch | 2.4 - 2.7 | |
| CUDA | 12.X | |
| CMake (Linux) | 3.24 | For tiny-cuda-nn |
| C++17 (Windows) | For tiny-cuda-nn |
Recommended: Use conda or uv to manage your Python environment.
- For video export, the
avc1codec forffmpegis only available with conda. With uv, video export uses themp4vcodec. If video export usingavc1is vital, use conda.- Tested with
python=3.11, 3.12andpytorch>=2.4,<2.8.- To install for multiple compute capabilities, see below.
Note: Ensure PATH and LD_LIBRARY_PATH include the CUDA binaries as described in tiny-cuda-nn. If you encounter installation errors related to tiny-cuda-nn, check their issues page. Building binaries for both tiny-cuda-nn and NeCT may take several minutes.
Uv Installation¶
If you don't have uv installed, follow the uv installation guide. This will install pytorch with CUDA 12.4.
uv venv --python=3.12
source venv/bin/activate
uv pip install git+https://github.com/haakonnese/nect[torch]
uv pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch --no-build-isolation
Custom PyTorch Version¶
To use a specific PyTorch version (2.4-2.7) visit the PyTorch Installation Page and install the desired PyTorch version into your uv environment. Then install NeCT with:
uv pip install git+https://github.com/haakonnese/nect --no-build-isolation-package torch
uv pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch --no-build-isolation
Conda Installation¶
conda create -n nect python=3.12 -y
conda activate nect
conda install pytorch==2.5.1 torchvision==0.20.1 pytorch-cuda=12.4 lightning==2.1 conda-forge::opencv -c pytorch -c nvidia -c conda-forge -y
pip install -v git+https://github.com/haakonnese/nect
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
Install Multiple Compute Capabilities¶
To build for multiple compute capabilities (e.g., 60=P100, 70=V100, 80=A100, 90=H100), set these environment variables before installing NeCT:
export CUDA_ARCHITECTURES="60;70;80;90"
export CMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES}
export TCNN_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES}
export TORCH_CUDA_ARCH_LIST="6.0 7.0 8.0 9.0"
export FORCE_CUDA="1"