Practical overview
When it fits
Use Tiny Cuda Nn when you need a C++/CUDA framework for neural-network training or inference and can provide the data handling and application logic. Its JIT fusion path is relevant when integrating a model into a larger CUDA kernel.
Who it is for
- C++ developers building GPU-based neural-network applications
- Researchers and engineers working with neural representations or rendering workloads
- PyTorch users who want to use the framework's fast MLPs
Documented uses
- Configure a neural network with a selected encoding, loss, and optimizer.
- Train a model using application-generated input and target batches.
- Run inference on application-provided inputs.
- Integrate a model into a larger CUDA kernel using runtime compilation.
Requirements & limits
- The build requires an NVIDIA GPU, a C++17 compiler, CUDA, and CMake 3.21 or newer.
- The default fully fused MLP configuration has high shared-memory requirements; CutlassMLP offers better compatibility but is slower.
- JIT fusion is optional and may slow training for very large hash grids, MLPs wider than 128 neurons, or RTX 3000-series and earlier GPUs.
- The training example requires a batch size that is a multiple of
tcnn::BATCH_SIZE_GRANULARITY.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Build Tiny Cuda Nn on Windows or Linux
Compile the repository with CMake after preparing the documented GPU and toolchain prerequisites.
Before you start
- An NVIDIA GPU
- A C++17-capable compiler; Visual Studio 2019 or 2022 on Windows, or GCC/G++ 8 or higher on Linux
- CUDA 11.5 or higher on Windows, or CUDA 10.2 or higher on Linux
- CMake 3.21 or higher
- Git and the repository submodules
Steps
Clone the repository and its submodules with the command below.
git clone --recursive https://github.com/nvlabs/tiny-cuda-nnChange into the
tiny-cuda-nndirectory.Configure with
cmake . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo.Build with
cmake --build build --config RelWithDebInfo -j; on Windows, use a developer command prompt.
Expected outcome
A CMake build of the Tiny Cuda Nn project.
Guide limitations
- The default fully fused MLP configuration uses substantial shared memory and may require a high-end GPU; reducing
n_neuronsor using CutlassMLP are documented alternatives. - If the build runs out of memory or takes longer than an hour, the README suggests building without
-j. - The documented compilation steps cover Windows and Linux.
Configure, train, and query a model through the C++ API
Use the documented C++ API pattern to configure a model, pass training batches, and run inference.
Before you start
- A built Tiny Cuda Nn project and its NVIDIA GPU/CUDA development prerequisites
- Input and output dimensions for the model
- Application-provided code to generate training batches and inference inputs
- A training batch size that is a multiple of
tcnn::BATCH_SIZE_GRANULARITY
Steps
Create a JSON model configuration specifying a loss, optimizer, encoding, and network.
Create the model with
create_from_configusing the input and output dimensions.For each training iteration, provide input and target batches and call
model.trainer->training_step.Provide inference inputs, allocate an output matrix, and call
model.network->inference.
Expected outcome
A configured model receives application-supplied training batches and produces outputs for application-supplied inference inputs.
Guide limitations
- The application must supply the batch-generation logic and training data.
- The README does not specify a particular dataset or application-level result.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- NVlabs/tiny-cuda-nn · Official homepage title · retained in its source language

