Giter Site home page Giter Site logo

nvlabs / instant-ngp Goto Github PK

View Code? Open in Web Editor NEW
15.4K 200.0 1.9K 187.07 MB

Instant neural graphics primitives: lightning fast NeRF and more

Home Page: https://nvlabs.github.io/instant-ngp

License: Other

CMake 1.56% C++ 13.51% Cuda 74.67% Python 9.90% Dockerfile 0.21% Batchfile 0.16%
neural-network machine-learning cuda nerf computer-graphics computer-vision 3d-reconstruction signed-distance-functions function-approximation real-time

instant-ngp's Introduction

Instant Neural Graphics Primitives

Ever wanted to train a NeRF model of a fox in under 5 seconds? Or fly around a scene captured from photos of a factory robot? Of course you have!

Here you will find an implementation of four neural graphics primitives, being neural radiance fields (NeRF), signed distance functions (SDFs), neural images, and neural volumes. In each case, we train and render a MLP with multiresolution hash input encoding using the tiny-cuda-nn framework.

Instant Neural Graphics Primitives with a Multiresolution Hash Encoding
Thomas Müller, Alex Evans, Christoph Schied, Alexander Keller
ACM Transactions on Graphics (SIGGRAPH), July 2022
Project page / Paper / Video / Presentation / Real-Time Live / BibTeX

For business inquiries, please submit the NVIDIA research licensing form.

Installation

If you have Windows, download one of the following releases corresponding to your graphics card and extract it. Then, start instant-ngp.exe.

Keep reading for a guided tour of the application or, if you are interested in creating your own NeRF, watch the video tutorial or read the written instructions.

If you use Linux, or want the developer Python bindings, or if your GPU is not listed above (e.g. Hopper, Volta, or Maxwell generations), you need to build instant-ngp yourself.

Usage

instant-ngp comes with an interactive GUI that includes many features:

  • comprehensive controls for interactively exploring neural graphics primitives,
  • VR mode for viewing neural graphics primitives through a virtual-reality headset,
  • saving and loading "snapshots" so you can share your graphics primitives on the internet,
  • a camera path editor to create videos,
  • NeRF->Mesh and SDF->Mesh conversion,
  • camera pose and lens optimization,
  • and many more.

NeRF fox

Simply start instant-ngp and drag the data/nerf/fox folder into the window. Or, alternatively, use the command line:

instant-ngp$ ./instant-ngp data/nerf/fox

You can use any NeRF-compatible dataset, e.g. from original NeRF, the SILVR dataset, or the DroneDeploy dataset. To create your own NeRF, watch the video tutorial or read the written instructions.

SDF armadillo

Drag data/sdf/armadillo.obj into the window or use the command:

instant-ngp$ ./instant-ngp data/sdf/armadillo.obj

Image of Einstein

Drag data/image/albert.exr into the window or use the command:

instant-ngp$ ./instant-ngp data/image/albert.exr

To reproduce the gigapixel results, download, for example, the Tokyo image and convert it to .bin using the scripts/convert_image.py script. This custom format improves compatibility and loading speed when resolution is high. Now you can run:

instant-ngp$ ./instant-ngp data/image/tokyo.bin

Volume renderer

Download the nanovdb volume for the Disney cloud, which is derived from here (CC BY-SA 3.0). Then drag wdas_cloud_quarter.nvdb into the window or use the command:

instant-ngp$ ./instant-ngp wdas_cloud_quarter.nvdb

Keyboard shortcuts and recommended controls

Here are the main keyboard controls for the instant-ngp application.

Key Meaning
WASD Forward / pan left / backward / pan right.
Spacebar / C Move up / down.
= or + / - or _ Increase / decrease camera velocity (first person mode) or zoom in / out (third person mode).
E / Shift+E Increase / decrease exposure.
Tab Toggle menu visibility.
T Toggle training. After around two minutes training tends to settle down, so can be toggled off.
{ } Go to the first/last training image camera view.
[ ] Go to the previous/next training image camera view.
R Reload network from file.
Shift+R Reset camera.
O Toggle visualization or accumulated error map.
G Toggle visualization of the ground truth.
M Toggle multi-view visualization of layers of the neural model. See the paper's video for a little more explanation.
, / . Shows the previous / next visualized layer; hit M to escape.
1-8 Switches among various render modes, with 2 being the standard one. You can see the list of render mode names in the control interface.

There are many controls in the instant-ngp GUI. First, note that this GUI can be moved and resized, as can the "Camera path" GUI (which first must be expanded to be used).

Recommended user controls in instant-ngp are:

  • Snapshot: use "Save" to save the trained NeRF, "Load" to reload.
  • Rendering -> DLSS: toggling this on and setting "DLSS sharpening" to 1.0 can often improve rendering quality.
  • Rendering -> Crop size: trim back the surrounding environment to focus on the model. "Crop aabb" lets you move the center of the volume of interest and fine tune. See more about this feature in our NeRF training & dataset tips.

The "Camera path" GUI lets you create a camera path for rendering a video. The button "Add from cam" inserts keyframes from the current perspective. Then, you can render a video .mp4 of your camera path or export the keyframes to a .json file. There is a bit more information about the GUI in this post and in this video guide to creating your own video.

VR controls

To view the neural graphics primitive in VR, first start your VR runtime. This will most likely be either

  • OculusVR if you have an Oculus Rift or Meta Quest (with link cable) headset, and
  • SteamVR if you have another headset.
  • Any OpenXR-compatible runtime will work.

Then, press the Connect to VR/AR headset button in the instant-ngp GUI and put on your headset. Before entering VR, we strongly recommend that you first finish training (press "Stop training") or load a pre-trained snapshot for maximum performance.

In VR, you have the following controls.

Control Meaning
Left stick / trackpad Move
Right stick / trackpad Turn camera
Press stick / trackpad Erase NeRF around the hand
Grab (one-handed) Drag neural graphics primitive
Grab (two-handed) Rotate and zoom (like pinch-to-zoom on a smartphone)

Building instant-ngp (Windows & Linux)

Requirements

  • An NVIDIA GPU; tensor cores increase performance when available. All shown results come from an RTX 3090.
  • A C++14 capable compiler. The following choices are recommended and have been tested:
    • Windows: Visual Studio 2019 or 2022
    • Linux: GCC/G++ 8 or higher
  • A recent version of CUDA. The following choices are recommended and have been tested:
    • Windows: CUDA 11.5 or higher
    • Linux: CUDA 10.2 or higher
  • CMake v3.21 or higher.
  • (optional) Python 3.7 or higher for interactive bindings. Also, run pip install -r requirements.txt.
  • (optional) OptiX 7.6 or higher for faster mesh SDF training.
  • (optional) Vulkan SDK for DLSS support.

If you are using Debian based Linux distribution, install the following packages

sudo apt-get install build-essential git python3-dev python3-pip libopenexr-dev libxi-dev \
                     libglfw3-dev libglew-dev libomp-dev libxinerama-dev libxcursor-dev

Alternatively, if you are using Arch or Arch derivatives, install the following packages

sudo pacman -S cuda base-devel cmake openexr libxi glfw openmp libxinerama libxcursor

We also recommend installing CUDA and OptiX in /usr/local/ and adding the CUDA installation to your PATH.

For example, if you have CUDA 11.4, add the following to your ~/.bashrc

export PATH="/usr/local/cuda-11.4/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH"

Compilation

Begin by cloning this repository and all its submodules using the following command:

$ git clone --recursive https://github.com/nvlabs/instant-ngp
$ cd instant-ngp

Then, use CMake to build the project: (on Windows, this must be in a developer command prompt)

instant-ngp$ cmake . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
instant-ngp$ cmake --build build --config RelWithDebInfo -j

If compilation fails inexplicably or takes longer than an hour, you might be running out of memory. Try running the above command without -j in that case. If this does not help, please consult this list of possible fixes before opening an issue.

If the build succeeds, you can now run the code via the ./instant-ngp executable or the scripts/run.py script described below.

If automatic GPU architecture detection fails, (as can happen if you have multiple GPUs installed), set the TCNN_CUDA_ARCHITECTURES environment variable for the GPU you would like to use. The following table lists the values for common GPUs. If your GPU is not listed, consult this exhaustive list.

H100 40X0 30X0 A100 20X0 TITAN V / V100 10X0 / TITAN Xp 9X0 K80
90 89 86 80 75 70 61 52 37

Python bindings

After you have built instant-ngp, you can use its Python bindings to conduct controlled experiments in an automated fashion. All features from the interactive GUI (and more!) have Python bindings that can be easily instrumented. For an example of how the ./instant-ngp application can be implemented and extended from within Python, see ./scripts/run.py, which supports a superset of the command line arguments that ./instant-ngp does.

If you would rather build new models from the hash encoding and fast neural networks, consider tiny-cuda-nn's PyTorch extension.

Happy hacking!

Additional resources

Frequently asked questions (FAQ)

Q: The NeRF reconstruction of my custom dataset looks bad; what can I do?

A: There could be multiple issues:

  • COLMAP might have been unable to reconstruct camera poses.
  • There might have been movement or blur during capture. Don't treat capture as an artistic task; treat it as photogrammetry. You want *as little blur as possible* in your dataset (motion, defocus, or otherwise) and all objects must be *static* during the entire capture. Bonus points if you are using a wide-angle lens (iPhone wide angle works well), because it covers more space than narrow lenses.
  • The dataset parameters (in particular aabb_scale) might have been tuned suboptimally. We recommend starting with aabb_scale=128 and then increasing or decreasing it by factors of two until you get optimal quality.
  • Carefully read our NeRF training & dataset tips.

Q: How can I save the trained model and load it again later?

A: Two options:

  1. Use the GUI's "Snapshot" section.
  2. Use the Python bindings load_snapshot / save_snapshot (see scripts/run.py for example usage).

Q: Can this codebase use multiple GPUs at the same time?

A: Only for VR rendering, in which case one GPU is used per eye. Otherwise, no. To select a specific GPU to run on, use the CUDA_VISIBLE_DEVICES environment variable. To optimize the compilation for that specific GPU use the TCNN_CUDA_ARCHITECTURES environment variable.

Q: How can I run instant-ngp in headless mode?

A: Use ./instant-ngp --no-gui or python scripts/run.py. You can also compile without GUI via cmake -DNGP_BUILD_WITH_GUI=off ...

Q: Does this codebase run on Google Colab?

A: Yes. See this example inspired on the notebook created by user @myagues. Caveat: this codebase requires large amounts of GPU RAM and might not fit on your assigned GPU. It will also run slower on older GPUs.

Q: Is there a Docker container?

A: Yes. We bundle a Visual Studio Code development container, the .devcontainer/Dockerfile of which you can also use stand-alone.

If you want to run the container without using VSCode:

docker-compose -f .devcontainer/docker-compose.yml build instant-ngp
xhost local:root
docker-compose -f .devcontainer/docker-compose.yml run instant-ngp /bin/bash

Then run the build commands above as normal.

Q: How can I edit and train the underlying hash encoding or neural network on a new task?

A: Use tiny-cuda-nn's PyTorch extension.

Q: What is the coordinate system convention?

A: See this helpful diagram by user @jc211.

Q: Why are background colors randomized during NeRF training?

A: Transparency in the training data indicates a desire for transparency in the learned model. Using a solid background color, the model can minimize its loss by simply predicting that background color, rather than transparency (zero density). By randomizing the background colors, the model is forced to learn zero density to let the randomized colors "shine through".

Q: How to mask away NeRF training pixels (e.g. for dynamic object removal)?

A: For any training image xyz.* with dynamic objects, you can provide a dynamic_mask_xyz.png in the same folder. This file must be in PNG format, where non-zero pixel values indicate masked-away regions.

Troubleshooting compile errors

Before investigating further, make sure all submodules are up-to-date and try compiling again.

instant-ngp$ git submodule sync --recursive
instant-ngp$ git submodule update --init --recursive

If instant-ngp still fails to compile, update CUDA as well as your compiler to the latest versions you can install on your system. It is crucial that you update both, as newer CUDA versions are not always compatible with earlier compilers and vice versa. If your problem persists, consult the following table of known issues.

*After each step, delete the build folder and let CMake regenerate it before trying again.*

Problem Resolution
CMake error: No CUDA toolset found / CUDA_ARCHITECTURES is empty for target "cmTC_0c70f" Windows: the Visual Studio CUDA integration was not installed correctly. Follow these instructions to fix the problem without re-installing CUDA. (#18)
Linux: Environment variables for your CUDA installation are probably incorrectly set. You may work around the issue using cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-<your cuda version>/bin/nvcc (#28)
CMake error: No known features for CXX compiler "MSVC" Reinstall Visual Studio & make sure you run CMake from a developer shell. Make sure you delete the build folder before building again. (#21)
Compile error: A single input file is required for a non-link phase when an outputfile is specified Ensure there no spaces in the path to instant-ngp. Some build systems seem to have trouble with those. (#39 #198)
Compile error: undefined references to "cudaGraphExecUpdate" / identifier "cublasSetWorkspace" is undefined Update your CUDA installation (which is likely 11.0) to 11.3 or higher. (#34 #41 #42)
Compile error: too few arguments in function call Update submodules with the above two git commands. (#37 #52)
Python error: No module named 'pyngp' It is likely that CMake did not detect your Python installation and therefore did not build pyngp. Check CMake logs to verify this. If pyngp was built in a different folder than build, Python will be unable to detect it and you have to supply the full path to the import statement. (#43)

If you cannot find your problem in the table, try searching the discussions board and the issues area for help. If you are still stuck, please open an issue and ask for help.

Thanks

Many thanks to Jonathan Tremblay and Andrew Tao for testing early versions of this codebase and to Arman Toorians and Saurabh Jain for the factory robot dataset. We also thank Andrew Webb for noticing that one of the prime numbers in the spatial hash was not actually prime; this has been fixed since.

This project makes use of a number of awesome open source libraries, including:

  • tiny-cuda-nn for fast CUDA networks and input encodings
  • tinyexr for EXR format support
  • tinyobjloader for OBJ format support
  • stb_image for PNG and JPEG support
  • Dear ImGui an excellent immediate mode GUI library
  • Eigen a C++ template library for linear algebra
  • pybind11 for seamless C++ / Python interop
  • and others! See the dependencies folder.

Many thanks to the authors of these brilliant projects!

License and Citation

@article{mueller2022instant,
    author = {Thomas M\"uller and Alex Evans and Christoph Schied and Alexander Keller},
    title = {Instant Neural Graphics Primitives with a Multiresolution Hash Encoding},
    journal = {ACM Trans. Graph.},
    issue_date = {July 2022},
    volume = {41},
    number = {4},
    month = jul,
    year = {2022},
    pages = {102:1--102:15},
    articleno = {102},
    numpages = {15},
    url = {https://doi.org/10.1145/3528223.3530127},
    doi = {10.1145/3528223.3530127},
    publisher = {ACM},
    address = {New York, NY, USA},
}

Copyright © 2022, NVIDIA Corporation. All rights reserved.

This work is made available under the Nvidia Source Code License-NC. Click here to view a copy of this license.

instant-ngp's People

Contributors

andreykramer avatar bionicbug avatar chanket avatar florise avatar gyudori avatar ily83 avatar jamesperlman avatar javierganan99 avatar jc211 avatar juliusjacobsohn avatar karbo123 avatar koktavy avatar mmalex avatar mrbreadwater avatar nolan1324 avatar pwais avatar rgov avatar rhuts avatar roangel avatar samdm avatar samuhell avatar sangminkim-99 avatar sazoji avatar simesgreen73 avatar slash-under avatar smartin015 avatar tkarabela avatar tom94 avatar wjl88 avatar yenchenlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

instant-ngp's Issues

I run it successfully but the GUI is blank

Thank you for your great work !
I run " ./build/testbed --scene data/nerf/fox" and it looks like it worked. But the GUI is blank.
cmd output:

16:39:19 INFO     Loading NeRF dataset from
16:39:19 INFO       data\nerf\fox\transforms.json
16:39:19 SUCCESS  Loaded 50 images of size 1080x1920 after 0s
16:39:19 INFO       cam_aabb=[min=[1.0229,-1.33309,-0.378748], max=[2.46175,1.00721,1.41295]]
16:39:19 INFO     Loading network config from: configs\nerf\base.json
16:39:19 INFO     GridEncoding:  Nmin=16 b=1.51572 F=2 T=2^19 L=16
16:39:19 INFO     Density model: 3--[HashGrid]-->32--[FullyFusedMLP(neurons=64,layers=3)]-->1
16:39:19 INFO     Color model:   3--[SphericalHarmonics]-->16+16--[FullyFusedMLP(neurons=64,layers=4)]-->3
16:39:19 INFO       total_encoding_params=13074912 total_network_params=10240

I can run ./scripts/run.py, but with --gui, the GUI is also blank.

I don't know why and seek help.

Build problem: No CUDA toolset found

I have the following error when trying to build on windows:
image

My environment:
window 10
cmake 3.22
Visual Studio 2019
CUDA 11.3

Does anyone know what's going on?

Bugs: batch_cam.json related

Bug 1) When a batch_cam.json was saved out from Testbed and is present in the dataset root dir, attempting to initialize testbed with the --scene data/nerf/etc argument will lead to:
ERROR Uncaught exception: [json.exception.type_error.302] type must be number, but is null

because the batch_cam.json is incorrectly parsed in place of the transforms.json file.

Workaround: Move that camera path file into another location outside of the main dataset directory.

Bug 2) When Testbed is instructed to load a batch_cam.json file when none exists, it crashes:
ERROR Uncaught exception: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal

Workaround: Ensure the file exists in the specified path before attempting to load it.

`cmake --build build --config RelWithDebInfo -j 16` throws 100s of errors on Windows

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\xmemory(961): error :
operand of "*" must be a pointer but has type "char" [D:\NeRF\instant-ngp\build\dependencies\tiny-cuda-nn\src\tiny-cuda
-nn.vcxproj]
detected during:
instantiation of "void std::_Destroy_range(_NoThrowFwdIt, _NoThrowSentinel) [with _NoThrowFwdIt=char, _No
ThrowSentinel=unsigned long long]"
(309): here
instantiation of "void std::_Destroy_in_place(_Ty &) [with _Ty=char]"
(961): here
instantiation of "void std::_Destroy_range(_NoThrowFwdIt, _NoThrowSentinel) [with _NoThrowFwdIt=char *, _
NoThrowSentinel=char *]"
(309): here
instantiation of "void std::_Destroy_in_place(_Ty &) [with _Ty=char *]"
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\xstring(4621): here
instantiation of "void std::basic_string<_Elem, _Traits, _Alloc>::_Tidy_deallocate() [with _Elem=char, _T
raits=std::char_traits, _Alloc=std::allocator]"
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\xstring(3003): here
instantiation of "std::basic_string<_Elem, _Traits, _Alloc>::~basic_string() [with _Elem=char, _Traits=st
d::char_traits, _Alloc=std::allocator]"
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\system_error(447): h
ere

All errors are of this kind. Seems like something is not linked properly, but I don't know what

I tried to use both x86 and x64 Native Tools Command Prompt

Also, I'm using Build Tools only. Tried to install Visual Studio Community, that didn't help either

Build runs forever

I'm trying to build on windows, and when I run the command: cmake --build build --config RelWithDebInfo -j 16, it always get stuck at here
image
no error, just runs forever. I've been waiting for an output for half an hour and it still shows nothing new. Is the building process really that slow or something went wrong?

build error: more undefined references to `cudaGraphExecUpdate' follow

gcc 8.4.0
cuda 11.1
RTX 3070TI
ubuntu 20.04
cmake 3.22.1
If you run "cmake --build build --config RelWithDebInfo -j 16" to run the build in the following environment, the following error occurs.

(MAD) root@qwopqwop-B560M-AORUS-PRO-AX:/home/qwopqwop/project/instant-ngp# cmake --build build --config RelWithDebInfo -j 16
[ 29%] Built target glfw_objects
[ 50%] Built target tiny-cuda-nn
[ 92%] Built target ngp
Consolidate compiler generated dependencies of target pyngp
[ 94%] Linking CXX executable testbed
[ 98%] Built target pyngp
/usr/bin/ld: libngp.a(testbed_image.cu.o): in function `void tcnn::CudaGraph::capture_and_execute<tcnn::Trainer<float, __half, __half>::training_step(CUstream_st*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, float*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const*)::{lambda()#1}>(CUstream_st*, bool, tcnn::Trainer<float, __half, __half>::training_step(CUstream_st*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, float*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const*)::{lambda()#1})':
tmpxft_00080a9b_00000000-6_testbed_image.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_7TrainerIf6__halfS3_E13training_stepEP11CUstream_stRKNS_9GPUMatrixIfLNS_12MatrixLayoutE1EEESB_PfPSA_EUlvE_EEvS6_bT_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_7TrainerIf6__halfS3_E13training_stepEP11CUstream_stRKNS_9GPUMatrixIfLNS_12MatrixLayoutE1EEESB_PfPSA_EUlvE_EEvS6_bT_]+0x406): undefined reference to `cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function `tcnn::ShampooOptimizer<float>::step(CUstream_st*, float, float*, float*, float const*)::{lambda()#1}::operator()() const':
tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv]+0xacf): undefined reference to `cublasSetWorkspace_v2'
/usr/bin/ld: tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv]+0xebb): undefined reference to `cublasSetWorkspace_v2'
/usr/bin/ld: tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv]+0x12c1): undefined reference to `cublasSetWorkspace_v2'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function `tcnn::ShampooOptimizer<__half>::step(CUstream_st*, float, float*, __half*, __half const*)::{lambda()#1}::operator()() const':
tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv]+0xaec): undefined reference to `cublasSetWorkspace_v2'
/usr/bin/ld: tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv]+0xed8): undefined reference to `cublasSetWorkspace_v2'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o):tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv]+0x12de): more undefined references to `cublasSetWorkspace_v2' follow
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function `void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<float>::step(CUstream_st*, float, float*, float*, float const*)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<float>::step(CUstream_st*, float, float*, float*, float const*)::{lambda()#1})':
tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE4stepEP11CUstream_stfPfS6_PKfEUlvE_EEvS5_bT_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE4stepEP11CUstream_stfPfS6_PKfEUlvE_EEvS5_bT_]+0x406): undefined reference to `cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function `void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1})':
tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS6_bS9_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS6_bS9_]+0x406): undefined reference to `cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function `void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#2}>(CUstream_st*, bool, tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#2})':
tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS6_bS9_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS6_bS9_]+0x406): undefined reference to `cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function `void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<__half>::step(CUstream_st*, float, float*, __half*, __half const*)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<__half>::step(CUstream_st*, float, float*, __half*, __half const*)::{lambda()#1})':
tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS3_PKS3_EUlvE_EEvS6_bT_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS3_PKS3_EUlvE_EEvS6_bT_]+0x406): undefined reference to `cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function `void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<__half>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<__half>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1})':
tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS7_bSA_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS7_bSA_]+0x406): undefined reference to `cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o):tmpxft_00080728_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS7_bSA_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS7_bSA_]+0x406): more undefined references to `cudaGraphExecUpdate' follow
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/testbed.dir/build.make:116: testbed] Error 1
make[1]: *** [CMakeFiles/Makefile2:200: CMakeFiles/testbed.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

A quick question about the fox dataset

Hello, thanks for your great paper. I would like to know how you generate the fox dataset. I take some photos of real world objects, and use the colmap2nerf.py script to process them. However. I didn't get a good training result using the new dataset. One of the original photos and the training result are shown bellow.

How to use underlying representation for a new task with different input/output dimensions?

This code and project are awesome! Thanks a lot.

In terms of building upon this, I wonder how to access, edit and train the underlying hash+NN representation for a new task.

For example, let's say I have a task with different number of input or output coordinates, e.g. some special video++ like representation which should be directly fitted like the image is done in the demo (e.g. 3 input coordinates (x,y,t) and 5 output coordinates (r,g,b,a,b)).

Do I have access through this code (ideally python bindings, but if not then some c code), to edit the number of input and output coordinates, to provide my own training data which fits with these input/output coordinates, and train your hash+NN representation on a new task?

If this is possible with the code, then pointers on how to do this would be very much appreciated. I'm currently very lost with how to expose this ability in your code base.

Making this easier to do (e.g. easy python bindings), I'm sure would be greatly appreciated by the research community, in order to be able to build upon this awesome work as easily as possible.

Cheers,
Jonathon

Build error

Hello,
Thanks for the code ! I have been trying to build your code but I receive this error. Can u help me how to fix this build error ?

cmake --build build --config RelWithDebInfo -j 16
[  1%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/context.c.o
[  3%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/common_device.cu.o
[  5%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/common.cu.o
[  9%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/cutlass_resnet.cu.o
[ 10%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/cutlass_mlp.cu.o
[ 10%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/monitor.c.o
[ 14%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/input.c.o
[ 14%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/vulkan.c.o
[ 16%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/init.c.o
[ 18%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/encoding.cu.o
[ 20%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/fully_fused_mlp.cu.o
[ 21%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/object.cu.o
[ 23%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/x11_init.c.o
[ 25%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/window.c.o
[ 27%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/loss.cu.o
[ 29%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/network.cu.o
[ 30%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/x11_monitor.c.o
[ 32%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/optimizer.cu.o
[ 34%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/x11_window.c.o
[ 36%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/reduce_sum.cu.o
[ 38%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/xkb_unicode.c.o
[ 40%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/posix_time.c.o
[ 41%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/posix_thread.c.o
[ 43%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/glx_context.c.o
[ 45%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/egl_context.c.o
[ 47%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/osmesa_context.c.o
[ 49%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/linux_joystick.c.o
[ 49%] Built target glfw_objects
/home/phong/data/Work/Paper_journal/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/encodings/spherical_harmonics.h(72): warning: variable "xyz" was declared but never referenced
          detected during:
            instantiation of "void tcnn::SphericalHarmonicsEncoding<T>::encode(cudaStream_t, uint32_t, tcnn::PitchedPtr<const float>, tcnn::PitchedPtr<T>, float *, __nv_bool) const [with T=float]" 
(436): here
            implicit generation of "tcnn::SphericalHarmonicsEncoding<T>::~SphericalHarmonicsEncoding() [with T=float]" 
(436): here
            instantiation of class "tcnn::SphericalHarmonicsEncoding<T> [with T=float]" 
(436): here
            instantiation of "tcnn::SphericalHarmonicsEncoding<T>::SphericalHarmonicsEncoding(uint32_t, uint32_t) [with T=float]" 
/home/phong/data/Work/Paper_journal/instant-ngp/dependencies/tiny-cuda-nn/src/encoding.cu(87): here
            instantiation of "tcnn::Encoding<T> *tcnn::create_encoding<T>(uint32_t, const tcnn::json &, uint32_t) [with T=float]" 
/home/phong/data/Work/Paper_journal/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/encodings/composite.h(84): here

[ 50%] Linking CUDA static library libtiny-cuda-nn.a
[ 50%] Built target tiny-cuda-nn
[ 54%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_impl_glfw.cpp.o
[ 58%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/ImGuizmo.cpp.o
[ 58%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_impl_opengl3.cpp.o
[ 60%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_tables.cpp.o
[ 61%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_widgets.cpp.o
[ 63%] Building CUDA object CMakeFiles/ngp.dir/src/common_device.cu.o
[ 65%] Building CUDA object CMakeFiles/ngp.dir/src/camera_path.cu.o
[ 54%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui.cpp.o
[ 67%] Building CUDA object CMakeFiles/ngp.dir/src/marching_cubes.cu.o
[ 69%] Building CUDA object CMakeFiles/ngp.dir/src/nerf_loader.cu.o
[ 70%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_draw.cpp.o
[ 72%] Building CUDA object CMakeFiles/ngp.dir/src/testbed.cu.o
[ 74%] Building CUDA object CMakeFiles/ngp.dir/src/render_buffer.cu.o
[ 76%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_image.cu.o
[ 78%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_sdf.cu.o
[ 80%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_nerf.cu.o
[ 81%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_volume.cu.o
[ 83%] Building CXX object CMakeFiles/ngp.dir/src/thread_pool.cpp.o
[ 85%] Building CUDA object CMakeFiles/ngp.dir/src/tinyexr_wrapper.cu.o
/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

[ 87%] Building CXX object CMakeFiles/ngp.dir/src/tinyobj_loader_wrapper.cpp.o
/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

[ 89%] Building CUDA object CMakeFiles/ngp.dir/src/triangle_bvh.cu.o
/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/nerf.h(25): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/nerf.h(25): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/nerf_loader.cu(64): error: A __device__ variable cannot be marked constexpr

1 error detected in the compilation of "/tmp/tmpxft_0006c161_00000000-6_marching_cubes.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:202: CMakeFiles/ngp.dir/src/marching_cubes.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/random_val.cuh(31): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/nerf.h(25): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/nerf.h(25): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_sdf.cu(40): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_sdf.cu(41): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(48): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(49): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(50): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(52): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(53): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(54): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(56): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(60): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(63): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(65): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(67): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(68): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/include/neural-graphics-primitives/nerf.h(25): error: A __device__ variable cannot be marked constexpr

1 error detected in the compilation of "/tmp/tmpxft_0006c172_00000000-6_render_buffer.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:230: CMakeFiles/ngp.dir/src/render_buffer.cu.o] Error 1
1 error detected in the compilation of "/tmp/tmpxft_0006c573_00000000-6_tinyexr_wrapper.cpp1.ii".
/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(800): error: A __device__ variable cannot be marked constexpr

make[2]: *** [CMakeFiles/ngp.dir/build.make:328: CMakeFiles/ngp.dir/src/tinyexr_wrapper.cu.o] Error 1
/home/phong/data/Work/Paper_journal/instant-ngp/src/triangle_bvh.cu(49): error: A __device__ variable cannot be marked constexpr

/home/phong/data/Work/Paper_journal/instant-ngp/src/triangle_bvh.cu(50): error: A __device__ variable cannot be marked constexpr

2 errors detected in the compilation of "/tmp/tmpxft_0006c164_00000000-6_nerf_loader.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:216: CMakeFiles/ngp.dir/src/nerf_loader.cu.o] Error 1
/home/phong/data/Work/Paper_journal/instant-ngp/src/testbed_nerf.cu(1652): error: A __device__ variable cannot be marked constexpr

3 errors detected in the compilation of "/tmp/tmpxft_0006c588_00000000-6_triangle_bvh.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:356: CMakeFiles/ngp.dir/src/triangle_bvh.cu.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_0006c1a3_00000000-6_testbed_volume.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:300: CMakeFiles/ngp.dir/src/testbed_volume.cu.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_0006c17a_00000000-6_testbed_image.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:258: CMakeFiles/ngp.dir/src/testbed_image.cu.o] Error 1
4 errors detected in the compilation of "/tmp/tmpxft_0006c180_00000000-6_testbed_sdf.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:286: CMakeFiles/ngp.dir/src/testbed_sdf.cu.o] Error 1
1 error detected in the compilation of "/tmp/tmpxft_0006c15d_00000000-6_common_device.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:188: CMakeFiles/ngp.dir/src/common_device.cu.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_0006c168_00000000-6_testbed.cpp1.ii".
16 errors detected in the compilation of "/tmp/tmpxft_0006c192_00000000-6_testbed_nerf.cpp1.ii".
make[2]: *** [CMakeFiles/ngp.dir/build.make:244: CMakeFiles/ngp.dir/src/testbed.cu.o] Error 1
make[2]: *** [CMakeFiles/ngp.dir/build.make:272: CMakeFiles/ngp.dir/src/testbed_nerf.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:228: CMakeFiles/ngp.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

fox example does not work?

Thanks for posting this amazing work!

I tried to run the fox example and it gives an error with a string ("total must not be zero") that I can't find in the repo so very hard to debug:

$ python3 scripts/run.py --scene=data/nerf/fox --mode=nerf
05:31:06 INFO     Loading NeRF dataset from
05:31:06 INFO       data/nerf/fox/transforms.json
Traceback (most recent call last):
  File "scripts/run.py", line 109, in <module>
    testbed.load_training_data(scene)
ValueError: Progress: total must not be zero.

The build seems ok tho, this raises a pybind-translated runtime error as expected:

$ python3 scripts/run.py --scene=data/nerf/foxx --mode=nerf
Traceback (most recent call last):
  File "scripts/run.py", line 109, in <module>
    testbed.load_training_data(scene)
RuntimeError: Data path 'data/nerf/foxx' does not exist.

I tried getting the standard nerf_synthetic lego scene and that seems to work:

$ python3 scripts/run.py --scene=data/nerf_synthetic/lego/ --mode=nerf
05:35:03 INFO     Loading NeRF dataset from
05:35:03 INFO       data/nerf_synthetic/lego/transforms_val.json
05:35:03 INFO       data/nerf_synthetic/lego/transforms_test.json
05:35:03 INFO       data/nerf_synthetic/lego/transforms_train.json
05:35:03 SUCCESS  Loaded 400 images of size 800x800 after 0s
05:35:03 INFO       cam_aabb=[min=[0.5,0.5,0.5], max=[0.5,0.5,0.5]]
05:35:03 INFO     Loading network config from: /opt/instant-ngp/configs/nerf/base.json
05:35:03 INFO     GridEncoding:  Nmin=16 b=1.38191 F=2 T=2^19 L=16
05:35:03 INFO     Density model: 3--[HashGrid]-->32--[FullyFusedMLP(neurons=64,layers=3)]-->1
05:35:03 INFO     Color model:   3--[SphericalHarmonics]-->16+16--[FullyFusedMLP(neurons=64,layers=4)]-->3
05:35:03 INFO       total_encoding_params=12196240 total_network_params=10240
...

Compilation error, underfined reference to cublasSetWorkspace_v2 and cudaGraphExecUpdate

Awesome work, I'm really looking forward to demoing this.

However I am currently running into build errors that I have not been able to troubleshoot myself, I have followed the instructions on your README.md. I am running Ubuntu 20 on a laptop with an NVIDIA GeForce RTX 2070 card and cuda 11.3.

Here are the logs of the build commands

`user@computer:~/software/instant-ngp$ cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.3/bin/nvcc
-- The CUDA compiler identification is NVIDIA 11.3.109
-- Check for working CUDA compiler: /usr/local/cuda-11.3/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda-11.3/bin/nvcc - works
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- No release type specified. Setting to 'Release'.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Using X11 for window creation
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found GLEW: /usr/include (found version "2.1.0")
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- !!! Warning OptiX_INSTALL_DIR not set in environment. using default
-- OptiX_INSTALL_DIR value: /usr/local/NVIDIA-OptiX-SDK-7.3.0-linux64-x86_64
-- OptiX headers (optix.h and friends) not found.
CMake Warning at CMakeLists.txt:169 (message):
OptiX was not found. Neural graphics primitives will still compile and run
correctly. However, SDF training in 'raystab' and 'pathescape' modes will
be significantly slower.

-- Found Python: /usr/bin/python3.8 (found suitable version "3.8.10", minimum required is "3.7") found components: Interpreter Development Development.Module Development.Embed
-- pybind11 v2.7.1
CMake Warning (dev) at /home/user/software/cmake-3.22.1-linux-x86_64/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
Syntax. Run "cmake --help-policy CMP0127" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
dependencies/pybind11/CMakeLists.txt:98 (cmake_dependent_option)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Targeting GPU architectures: 75
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/software/instant-ngp/build
user@computer:~/software/instant-ngp$ cmake --build build --config RelWithDebInfo -j 16
[ 1%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/common.cu.o
[ 3%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/common_device.cu.o
[ 5%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/context.c.o
[ 9%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/cutlass_resnet.cu.o
[ 9%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/init.c.o
[ 12%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/monitor.c.o
[ 12%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/input.c.o
[ 14%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/cutlass_mlp.cu.o
[ 16%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/vulkan.c.o
[ 18%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/window.c.o
[ 20%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/encoding.cu.o
[ 21%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/x11_init.c.o
[ 23%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/loss.cu.o
[ 25%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/network.cu.o
[ 27%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/object.cu.o
[ 29%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/optimizer.cu.o
[ 30%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/x11_monitor.c.o
[ 32%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/reduce_sum.cu.o
[ 34%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/x11_window.c.o
[ 36%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/xkb_unicode.c.o
[ 38%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/posix_time.c.o
[ 40%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/posix_thread.c.o
[ 41%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/glx_context.c.o
[ 43%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/egl_context.c.o
[ 45%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/osmesa_context.c.o
[ 47%] Building C object dependencies/glfw/src/CMakeFiles/glfw_objects.dir/linux_joystick.c.o
[ 49%] Building CUDA object dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/fully_fused_mlp.cu.o
[ 49%] Built target glfw_objects
[ 50%] Linking CUDA static library libtiny-cuda-nn.a
[ 50%] Built target tiny-cuda-nn
[ 52%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/ImGuizmo.cpp.o
[ 54%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui.cpp.o
[ 56%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_impl_glfw.cpp.o
[ 58%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_impl_opengl3.cpp.o
[ 60%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_draw.cpp.o
[ 61%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_tables.cpp.o
[ 63%] Building CXX object CMakeFiles/ngp.dir/dependencies/imgui/imgui_widgets.cpp.o
[ 65%] Building CUDA object CMakeFiles/ngp.dir/src/camera_path.cu.o
[ 67%] Building CUDA object CMakeFiles/ngp.dir/src/common_device.cu.o
[ 69%] Building CUDA object CMakeFiles/ngp.dir/src/marching_cubes.cu.o
[ 70%] Building CUDA object CMakeFiles/ngp.dir/src/nerf_loader.cu.o
[ 72%] Building CUDA object CMakeFiles/ngp.dir/src/render_buffer.cu.o
[ 74%] Building CUDA object CMakeFiles/ngp.dir/src/testbed.cu.o
[ 76%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_image.cu.o
[ 78%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_nerf.cu.o
[ 80%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_sdf.cu.o
[ 81%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_volume.cu.o
[ 83%] Building CXX object CMakeFiles/ngp.dir/src/thread_pool.cpp.o
[ 85%] Building CUDA object CMakeFiles/ngp.dir/src/tinyexr_wrapper.cu.o
[ 87%] Building CXX object CMakeFiles/ngp.dir/src/tinyobj_loader_wrapper.cpp.o
[ 89%] Building CUDA object CMakeFiles/ngp.dir/src/triangle_bvh.cu.o
[ 90%] Linking CUDA device code CMakeFiles/ngp.dir/cmake_device_link.o
[ 92%] Linking CXX static library libngp.a
[ 92%] Built target ngp
[ 96%] Building CUDA object CMakeFiles/pyngp.dir/src/python_api.cu.o
[ 96%] Building CUDA object CMakeFiles/testbed.dir/src/main.cu.o
[ 98%] Linking CXX executable testbed
/usr/bin/ld: libngp.a(testbed_image.cu.o): in function void tcnn::CudaGraph::capture_and_execute<tcnn::Trainer<float, __half, __half>::training_step(CUstream_st*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, float*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const*)::{lambda()#1}>(CUstream_st*, bool, tcnn::Trainer<float, __half, __half>::training_step(CUstream_st*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const&, float*, tcnn::GPUMatrix<float, (tcnn::MatrixLayout)1> const*)::{lambda()#1})': tmpxft_00005ad8_00000000-6_testbed_image.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_7TrainerIf6__halfS3_E13training_stepEP11CUstream_stRKNS_9GPUMatrixIfLNS_12MatrixLayoutE1EEESB_PfPSA_EUlvE_EEvS6_bT_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_7TrainerIf6__halfS3_E13training_stepEP11CUstream_stRKNS_9GPUMatrixIfLNS_12MatrixLayoutE1EEESB_PfPSA_EUlvE_EEvS6_bT_]+0x406): undefined reference to cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function tcnn::ShampooOptimizer<float>::step(CUstream_st*, float, float*, float*, float const*)::{lambda()#1}::operator()() const': tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv]+0xacf): undefined reference to cublasSetWorkspace_v2'
/usr/bin/ld: tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv]+0xebb): undefined reference to cublasSetWorkspace_v2' /usr/bin/ld: tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerIfE4stepEP11CUstream_stfPfS4_PKfENKUlvE_clEv]+0x12c1): undefined reference to cublasSetWorkspace_v2'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function tcnn::ShampooOptimizer<__half>::step(CUstream_st*, float, float*, __half*, __half const*)::{lambda()#1}::operator()() const': tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv]+0xaec): undefined reference to cublasSetWorkspace_v2'
/usr/bin/ld: tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv]+0xed8): undefined reference to cublasSetWorkspace_v2' /usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o):tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv[_ZZN4tcnn16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS1_PKS1_ENKUlvE_clEv]+0x12de): more undefined references to cublasSetWorkspace_v2' follow
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<float>::step(CUstream_st*, float, float*, float*, float const*)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<float>::step(CUstream_st*, float, float*, float*, float const*)::{lambda()#1})': tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE4stepEP11CUstream_stfPfS6_PKfEUlvE_EEvS5_bT_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE4stepEP11CUstream_stfPfS6_PKfEUlvE_EEvS5_bT_]+0x406): undefined reference to cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1})': tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS6_bS9_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS6_bS9_]+0x406): undefined reference to cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#2}>(CUstream_st*, bool, tcnn::ShampooOptimizer<float>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#2})': tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS6_bS9_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerIfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS6_bS9_]+0x406): undefined reference to cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<__half>::step(CUstream_st*, float, float*, __half*, __half const*)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<__half>::step(CUstream_st*, float, float*, __half*, __half const*)::{lambda()#1})': tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS3_PKS3_EUlvE_EEvS6_bT_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE4stepEP11CUstream_stfPfPS3_PKS3_EUlvE_EEvS6_bT_]+0x406): undefined reference to cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o): in function void tcnn::CudaGraph::capture_and_execute<tcnn::ShampooOptimizer<__half>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1}>(CUstream_st*, bool, tcnn::ShampooOptimizer<__half>::inverse_pth_root_batched<float>(CUstream_st*, unsigned int, float*, tcnn::GPUMemory<float>&, unsigned int, unsigned int)::{lambda()#1})': tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text._ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS7_bSA_[_ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE_EEvS7_bSA_]+0x406): undefined reference to cudaGraphExecUpdate'
/usr/bin/ld: dependencies/tiny-cuda-nn/src/libtiny-cuda-nn.a(optimizer.cu.o):tmpxft_00005870_00000000-6_optimizer.cudafe1.cpp:(.text.ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS7_bSA[ZN4tcnn9CudaGraph19capture_and_executeIZNS_16ShampooOptimizerI6__halfE24inverse_pth_root_batchedIfEEvP11CUstream_stjPfRNS_9GPUMemoryIT_EEjjEUlvE0_EEvS7_bSA]+0x406): more undefined references to cudaGraphExecUpdate' follow collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/testbed.dir/build.make:116: testbed] Error 1 make[1]: *** [CMakeFiles/Makefile2:200: CMakeFiles/testbed.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [100%] Linking CXX shared library pyngp.cpython-38-x86_64-linux-gnu.so [100%] Built target pyngp make: *** [Makefile:91: all] Error 2

Explanation of parameters in transforms.json

Hi there! Could you please provide an explanation of what each of the parameters in data/nerf/fox/transforms.json represent, as well as how to obtain them? I believe I read another issue that said that the fox video was taken by a phone camera, so I'm wondering if I can also get those parameters from my phone without needing to run something like COLMAP.

Thanks!

Optix call 'optixInit()' failed

It appears that I am able to build the source successfully, but upon running ./build/testbed --scene data/nerf/fox I receive: Uncaught exception: Optix call 'optixInit()' failed.

Do you know of any manners by which I can test/debug the working condition of Optix itself? I am having some difficulty finding this information online. Much appreciated, thank you!

( Running Tesla V100, export OptiX_INSTALL_DIR=/usr/local/NVIDIA-OptiX-SDK-7.4.0-linux64-x86_64 )

Build on Windows CUDA 11.6.t argets(790,9): error MSB3721

Windows10
CUDA 11.6
RTX 3080TI
cmake 3.21.2
VS2019 14.29

\src\testbed.cu(1023): error : too few arguments in function cal
l [C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\build\ngp.vcxproj]

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.6.t
argets(790,9): error MSB3721: “"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe" -gencode=arch=
compute_86,code="compute_86,compute_86" -gencode=arch=compute_86,code="sm_86,compute_86" --use-local-env -ccbin "C:
\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" -x cu -rdc=true
-I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\dependencies" -I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gite
e\instant-ngp\dependencies\eigen" -I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\dependencies\filesystem" -
I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\dependencies\glfw\include" -I"C:\Users\Admin\PyOut\CGAI\insta
nt-ngp\Gitee\instant-ngp\dependencies\imgui\gl3w" -I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\dependenci
es\nanovdb" -I"C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.4.0\include" -I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gite
e\instant-ngp\dependencies\tiny-cuda-nn\include" -I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\dependencie
s\tiny-cuda-nn\dependencies" -I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\dependencies\tinylogger" -I"C:
Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\include" -I"C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ng
p\build" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" --keep-dir x64\RelWithDebInfo -maxrr
egcount=0 --machine 64 --compile -cudart static --extended-lambda --expt-relaxed-constexpr -std=c++14 -Xcompiler="/EHs
c -Zi -Ob1 -bigobj" -D_WINDOWS -DNDEBUG -DNGP_GUI -DNGP_OPTIX -DTCNN_MIN_GPU_ARCH=86 -DTCNN_SHAMPOO -D"NGP_VERSION="
1.0dev"" -D"CMAKE_INTDIR="RelWithDebInfo"" -D_MBCS -DWIN32 -D_WINDOWS -D_CRT_SECURE_NO_WARNINGS -DNDEBUG -DNGP_GUI -
DNGP_OPTIX -DTCNN_MIN_GPU_ARCH=86 -DTCNN_SHAMPOO -D"NGP_VERSION="1.0dev"" -D"CMAKE_INTDIR="RelWithDebInfo"" -Xcompi
ler "/EHsc /W1 /nologo /O2 /FdC:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\build\RelWithDebInfo\ngp.pdb /FS
/Zi /MD /GR" -o ngp.dir\RelWithDebInfo\testbed.obj "C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\src\testbe
d.cu"” quit reture 1。 [C:\Users\Admin\PyOut\CGAI\instant-ngp\Gitee\instant-ngp\build\ngp.vcxproj]

[OptiX not found problem] `CMakeLists.txt` is not compatible with `FindOptiX.cmake` within OptiX package.

Question: Was my way correct? Or do there exist other solutions you suppose?

Environment: Ubuntu 20.04
Objective package: OptiX™ SDK 7.4.0 downloaded from here.

In this part, you use find_package but path/to/NVIDIA-OptiX-SDK-7.4.0-linux64-x86_64/SDK/CMake/FindOptiX.cmake does not set OptiX_FOUND even if optix.h exists in OptiX_INSTALL_DIR or OptiX_INSTALL_DIR/include.

instant-ngp/CMakeLists.txt

Lines 162 to 174 in 06ee0a2

find_package(OptiX)
# set OptiX_INSTALL_DIR via your environment if it's not found automatically
if (OptiX_FOUND)
include_directories("${OptiX_INCLUDE}")
add_definitions(-DNGP_OPTIX)
else()
message(WARNING
"OptiX was not found. Neural graphics primitives will still compile "
"and run correctly. However, SDF training in 'raystab' and 'pathescape' "
"modes will be significantly slower."
)
endif()

I've solved this problem by adding the following code at the end of path/to/NVIDIA-OptiX-SDK-7.4.0-linux64-x86_64/SDK/CMake/FindOptiX.cmake so that find_package correctly set OptiX_FOUND.

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OptiX
  REQUIRED_VARS
    OptiX_INCLUDE
  )

if(OptiX_FOUND AND NOT TARGET OptiX::OptiX)
  add_library(OptiX::OptiX UNKNOWN IMPORTED)
  set_target_properties(OptiX::OptiX PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${OptiX_INCLUDE}"
    )
endif()

Windows Build: nvcc fatal : Don't know what to do with '.../OpenGL32.Lib'

I'm very excited to try out this code, but I got a compile error when executing the command cmake --build build --config RelWithDebInfo -j 16 as described in the README.

I'm guessing that a path to the OpenGL32 library is being interpreted as a command line argument to nvcc.

OS: Windows 10

CMake output tail:

...

C:\Users\marki\instant-ngp\dependencies\eigen\Eigen\src/Core/MathFunctions.h(738): warning : calling a __host__ functio
n("std::operator -<float> ") from a __host__ __device__ function("Eigen::internal::std_fallback::log1p<    ::std::compl
ex<float> > ") is not allowed [C:\Users\marki\instant-ngp\build\ngp.vcxproj]

  testbed_image.cu
  testbed_volume.cu
  testbed_sdf.cu
  common_device.cu
  testbed.cu
  testbed_nerf.cu
  gl3w.c
  ImGuizmo.cpp
  imgui.cpp
  imgui_impl_glfw.cpp
  imgui_impl_opengl3.cpp
  imgui_draw.cpp
  imgui_tables.cpp
  imgui_widgets.cpp
  thread_pool.cpp
  tinyobj_loader_wrapper.cpp

  C:\Users\marki\instant-ngp\build>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nvcc.exe" -dlink -o ng
  p.dir\RelWithDebInfo\ngp.device-link.obj -Xcompiler "/EHsc /W1 /nologo /O2 /Fdngp.dir\RelWithDebInfo\ngp.pdb /Zi  /MD
   /GR" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin/crt" -L"C:\Program Files\NVIDIA GPU Computing T
  oolkit\CUDA\v11.2\lib\x64" -L"C:\Users\marki\vcpkg\installed\x64-windows\lib" -L"C:\Users\marki\vcpkg\installed\x64-w
  indows\lib\manual-link" dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\context.obj dependencies\glfw\src\glfw_
  objects.dir\RelWithDebInfo\init.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\input.obj dependencies\glfw
  \src\glfw_objects.dir\RelWithDebInfo\monitor.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\vulkan.obj dep
  endencies\glfw\src\glfw_objects.dir\RelWithDebInfo\window.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\w
  in32_init.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\win32_joystick.obj dependencies\glfw\src\glfw_obj
  ects.dir\RelWithDebInfo\win32_monitor.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\win32_time.obj depend
  encies\glfw\src\glfw_objects.dir\RelWithDebInfo\win32_thread.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInf
  o\win32_window.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\wgl_context.obj dependencies\glfw\src\glfw_o
  bjects.dir\RelWithDebInfo\egl_context.obj dependencies\glfw\src\glfw_objects.dir\RelWithDebInfo\osmesa_context.obj de
  pendencies\glfw\src\glfw_objects.dir\RelWithDebInfo\glfw.res "dependencies\tiny-cuda-nn\src\RelWithDebInfo\tiny-cuda-
  nn.lib" cuda.lib cublas.lib cudadevrt.lib cudart_static.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.l
  ib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib cudart.lib "C:\Users\marki\vcpkg\
  installed\x64-windows\lib\gif.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\GlU32.Lib" "C:\Users\marki\vcpkg\i
  nstalled\x64-windows\lib\imgui.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\jpeg.lib" "C:\Users\marki\vcpkg\i
  nstalled\x64-windows\lib\leptonica-1.78.0.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\libpng16.lib" "C:\User
  s\marki\vcpkg\installed\x64-windows\lib\libprotobuf-lite.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\libprot
  obuf.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\libprotoc.lib" "C:\Users\marki\vcpkg\installed\x64-windows\
  lib\lzma.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\OpenGL32.Lib" "C:\Users\marki\vcpkg\installed\x64-windo
  ws\lib\SDL2.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\tesseract41.lib" "C:\Users\marki\vcpkg\installed\x64
  -windows\lib\tiff.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\tiffxx.lib" "C:\Users\marki\vcpkg\installed\x6
  4-windows\lib\turbojpeg.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\webp.lib" "C:\Users\marki\vcpkg\installe
  d\x64-windows\lib\webpdecoder.lib" "C:\Users\marki\vcpkg\installed\x64-windows\lib\webpdemux.lib" "C:\Users\marki\vcp
  kg\installed\x64-windows\lib\zlib.lib" -forward-unknown-to-host-compiler -Wno-deprecated-gpu-targets  -gencode=arch=c
  ompute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86  --machine 64 ngp.dir\RelWithDebInfo\camera_path.obj ng
  p.dir\RelWithDebInfo\common_device.obj ngp.dir\RelWithDebInfo\marching_cubes.obj ngp.dir\RelWithDebInfo\nerf_loader.o
  bj ngp.dir\RelWithDebInfo\render_buffer.obj ngp.dir\RelWithDebInfo\testbed.obj ngp.dir\RelWithDebInfo\testbed_image.o
  bj ngp.dir\RelWithDebInfo\testbed_nerf.obj ngp.dir\RelWithDebInfo\testbed_sdf.obj ngp.dir\RelWithDebInfo\testbed_volu
  me.obj ngp.dir\RelWithDebInfo\tinyexr_wrapper.obj ngp.dir\RelWithDebInfo\triangle_bvh.obj
  nvcc fatal   : Don't know what to do with 'C:/Users/marki/vcpkg/installed/x64-windows/lib/OpenGL32.Lib'

build error tcnn::GPUMatrix

Error:
D:\GitHub\instant-ngp\dependencies\tiny-cuda-nn\include\tiny-cuda-nn/object.h(175): error C2976: 'tcnn::GPUMatrix': too few template arg
uments [D:\GitHub\instant-ngp\build\dependencies\tiny-cuda-nn\src\tiny-cuda-nn.vcxproj]

Environment:
Window 10, RTX3080
CUDA 11.6, cudnn 8.3.2
cmake 3.22.1

error: identifier "cublasSetWorkspace" is undefined

Hi, really nice and inspiring work! But I was stuck in the compiling process on a V100 machine, with an error of identifier "cublasSetWorkspace" is undefined. Please see the following details.

[ 50%] Built target glfw_objects
/home/projects/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/optimizers/shampoo.h(756): error: identifier "cublasSetWorkspace" is undefined
          detected during:
            instantiation of "tcnn::ShampooOptimizer<T>::ShampooOptimizer(const tcnn::json &) [with T=float]"
/home/projects/instant-ngp/dependencies/tiny-cuda-nn/src/optimizer.cu(72): here
            instantiation of "tcnn::Optimizer<T> *tcnn::create_optimizer<T>(const tcnn::json &) [with T=float]"
/home/projects/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/optimizers/average.h(66): here

/home/projects/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/optimizers/shampoo.h(774): error: identifier "cublasSetWorkspace" is undefined
          detected during:
            instantiation of "tcnn::ShampooOptimizer<T>::ShampooOptimizer(const tcnn::json &) [with T=float]"
/home/projects/instant-ngp/dependencies/tiny-cuda-nn/src/optimizer.cu(72): here
            instantiation of "tcnn::Optimizer<T> *tcnn::create_optimizer<T>(const tcnn::json &) [with T=float]"
/home/projects/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/optimizers/average.h(66): here

/home/projects/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/optimizers/shampoo.h(797): error: identifier "cublasSetWorkspace" is undefined
          detected during:
            instantiation of "tcnn::ShampooOptimizer<T>::ShampooOptimizer(const tcnn::json &) [with T=float]"
/home/projects/instant-ngp/dependencies/tiny-cuda-nn/src/optimizer.cu(72): here
            instantiation of "tcnn::Optimizer<T> *tcnn::create_optimizer<T>(const tcnn::json &) [with T=float]"
/home/projects/instant-ngp/dependencies/tiny-cuda-nn/include/tiny-cuda-nn/optimizers/average.h(66): here

3 errors detected in the compilation of "/home/projects/instant-ngp/dependencies/tiny-cuda-nn/src/optimizer.cu".
make[2]: *** [dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/build.make:188: dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/optimizer.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 50%] Built target optix_program
make[1]: *** [CMakeFiles/Makefile2:335: dependencies/tiny-cuda-nn/src/CMakeFiles/tiny-cuda-nn.dir/all] Error 2

Any suggestion?

HI, I have some questions about the input coordinate x

Congrats on this great work!
In the section of "3 MULTIRESOLUTION HASH ENCODING", the paper mentions that "The input coordinate x ∈ Rd is scaled by that level’s grid resolution". What is the coordinate reference system? And what is the numerical range of coordinates?Does the value range of coordinate affect the subsequent hash?
Thanks a lot in advance.

Windows build: No CMakeLists.txt file

When running cmake . -B I get error messages like these and no project file is generated:

CMake Error at CMakeLists.txt:96 (add_subdirectory):
The source directory C:/Users/Max/Documents/GIT/github/instant-ngp/dependencies/glfw does not contain a CMakeLists.txt file.

identifier "TCNN _MIN_GPU_ARCH" is undefined on Windows

Hi, I tried to build the project on my Win10 PC. However, the second command "cmake --build build --config RelWithDebInfo -j 16" raised errors.

Windows10
CUDA 11.1
RTX 3080
vs2019
cmake 3.22.1
MSVC 19.28.29921.0

【error info】
E:\GitHub_Space\instant-ngp\dependencies\tiny-cuda-nn\include\tiny-cuda-nn/common.h(50): error : identifier "TCNN
_MIN_GPU_ARCH" is undefined [E:\chenxi\GitHub_Space\instant_01\build\optix_program.vcxproj]

E:\GitHub_Space\instant-ngp\dependencies\tiny-cuda-nn\include\tiny-cuda-nn/common.h(50): error : identifier "TCNN
_MIN_GPU_ARCH" is undefined [E:\chenxi\GitHub_Space\instant_01\build\optix_program.vcxproj]

E:\GitHub_Space\instant-ngp\dependencies\tiny-cuda-nn\include\tiny-cuda-nn/common.h(50): error : identifier "TCNN
_MIN_GPU_ARCH" is undefined [E:\chenxi\GitHub_Space\instant_01\build\optix_program.vcxproj]

1 error detected in the compilation of "E:/GitHub_Space/instant_ngp/src/optix/raystab.cu".
raystab.cu

Dockerfile request

I can't get it to build properly, it would be nice to have a docker image and or dev container to run it.
Saves everyone a lot of time trying to build the project.

State HW requirements more clearly

After building the binaries, I get an error

Uncaught exception: Turing Tensor Core operations must be run on a machine with compute capability at least 75.

Upon further inspection, my GPU only supports compute version 6.1. Perhaps it's my naivete that I could run this on a GTX 1080, but I think the readme could state HW requirements more clearly, by saying that compute capability 7.5 is required.

GUI and Memory Constraints

Hi all, thanks so much for the hard work, this repo is really impressive.

I just have two quick questions regarding scaling the models

  1. In the demo video I noticed that training and rendering the NeRF Lego model used about 10.8 GB of VRAM, and I see everywhere that the software was developed with a 3090. Is there a relatively easy way to scale down the resolution of the NeRF and SDF models so that less VRAM is required?

  2. I've got the repo installed and running on a remote Ubuntu 20.04 server with a RTX 3070 8GB graphics card. When forwarding the output to my local machine, frame rates are incredibly low (less than 1 per second). I'm not sure if this is tied to my local machine's hardware, or the network we are connecting over.

Testbed runs successfully, but GUI is blank

Hi,

Thank you for the great work!
I followed the instruction and built the code without any errors occurring.

But when I ran the fox demo using ./build/testbed --scene data/nerf/fox, the window didn't show the fox image. After I run the marching cube, the meshes can be displayed.

My system info is as follows:

  • Ubuntu 18.04
  • GCC 7.5
  • CMake 3.22.1
  • CUDA 11.3
  • OptiX 7.3

When I built OptiX, it always failed to find the "IMathBox.h" file used by OpenEXR. So I ignored the OpenEXR when I installed OptiX. Is this the reason?

I am looking for your reply.

Thanks!

Room demo?

Could you possibly include the data folder for the large room demo you have shown next to the fox GIF and maybe how you were able to create it to look so good? i.e. scanning path, video or pictures, render, training settings, etc. I'd be very curious to do something similar in a medium to large space.

Q: Batch render frames along the spline path?

The Testbed can make camera splines, but those splines are not a valid data type outside of it - the run.py script won't parse them. It expects a json of fixed transforms for the screenshot_transforms argument.

  • Is there a way to instruct testbed to parse the camera path and save out a desired number of nerf-style transforms that may be used for the screenshot function?
  • Is there a way to instruct testbed to save out a controllable number of screenshots along the path from within the GUI (but with the UI hidden), taking as much time as it needs to render a frame?

I'd love to generate lovely smooth high quality movies like you did for your presentation 😵

multi-resolution hashing in python / feature hashing ?

In the paper, it was mentioned that the authors attempted to implement the multi-resolution hashing in python (e.g. Tensorflow) but it was 10x slower ... might that code be nevertheless made available for expository purposes? It might make it easier to test this method on multiple GPUs / older GPUs despite the speed hit.

Also, the paper offers an initial explanation for why hash collisions don't hurt the results too much. It might be possible to provide more rigorous analysis through the lens of feature hashing ( https://alex.smola.org/papers/2009/Weinbergeretal09.pdf ).

Very quick question

Hello, thank you for your great paper. I have a super quick question. Do you use (static, spherical, learned) background images for any of your results on 360-degree scenes? If not, how do you deal with the problem of very distant objects? I did not see this in the paper.

Thank you very much for your work!

Shoud it need to set `CUDA_NVCC_EXECUTABLE` manually?

Environment: Ubuntu 20.04
GPU: RTX 3090
CUDA: v11.6

When I ran the commandcmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.6/bin/nvcc, my GPU was not detected and it returns;

-- Automatic GPU detection failed. Building for common architectures.
-- Targeting GPU architectures: 30;35;50;52+PTX
CMake Warning at dependencies/tiny-cuda-nn/CMakeLists.txt:105 (message):
  Fully fused MLPs do not support GPU architectures of 70 or less.  Falling
  back to CUTLASS MLPs.  Remove GPU architectures 70 and lower to allow
  maximum performance

I fixed this by setting CUDA_NVCC_EXECUTABLE mannually like cmake . -B build -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.6/bin/nvcc -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-11.6/bin/nvcc
because in path/to/NVIDIA-OptiX-SDK-7.4.0-linux64-x86_64/SDK/CMake/FindCUDA/select_compute_arch.cmake,

execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${cufile}"
                WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                RESULT_VARIABLE nvcc_res OUTPUT_VARIABLE nvcc_out
                ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

dont work due to CUDA_NVCC_EXECUTABLE is empty in my case. Unfortunately, there are few resources about CUDA_NVCC_EXECUTABLE on web and I'd like to know what you expected in ordinal case. Is it my own environmental problem around CUDA?

Thanks!

Build problem: the generated default constructor cannot be used in an initializer for its own data member

It succeeded until I did "cmake . -B build". But at "cmake --build build --config RelWithDebInfo -j 16" I get an error.

(MAD) root@qwopqwop-B560M-AORUS-PRO-AX:/home/qwopqwop/project/instant-ngp# cmake --build build --config RelWithDebInfo -j 16
Consolidate compiler generated dependencies of target tiny-cuda-nn
Consolidate compiler generated dependencies of target glfw_objects
[ 29%] Built target glfw_objects
[ 50%] Built target tiny-cuda-nn
Consolidate compiler generated dependencies of target ngp
[ 52%] Building CUDA object CMakeFiles/ngp.dir/src/testbed.cu.o
[ 54%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_image.cu.o
[ 56%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_nerf.cu.o
[ 58%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_sdf.cu.o
[ 60%] Building CUDA object CMakeFiles/ngp.dir/src/testbed_volume.cu.o
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(629): error: the generated default constructor for "ngp::Testbed::Volume" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(601): error: the generated default constructor for "ngp::Testbed::Image" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(575): error: the generated default constructor for "ngp::Testbed::Sdf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(525): error: the generated default constructor for "ngp::Testbed::Nerf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(629): error: the generated default constructor for "ngp::Testbed::Volume" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(601): error: the generated default constructor for "ngp::Testbed::Image" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(575): error: the generated default constructor for "ngp::Testbed::Sdf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(525): error: the generated default constructor for "ngp::Testbed::Nerf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(629): error: the generated default constructor for "ngp::Testbed::Volume" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(601): error: the generated default constructor for "ngp::Testbed::Image" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(575): error: the generated default constructor for "ngp::Testbed::Sdf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(525): error: the generated default constructor for "ngp::Testbed::Nerf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(629): error: the generated default constructor for "ngp::Testbed::Volume" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(601): error: the generated default constructor for "ngp::Testbed::Image" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(575): error: the generated default constructor for "ngp::Testbed::Sdf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(525): error: the generated default constructor for "ngp::Testbed::Nerf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(629): error: the generated default constructor for "ngp::Testbed::Volume" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(601): error: the generated default constructor for "ngp::Testbed::Image" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(575): error: the generated default constructor for "ngp::Testbed::Sdf" cannot be used in an initializer for its own data member
/home/qwopqwop/project/instant-ngp/include/neural-graphics-primitives/testbed.h(525): error: the generated default constructor for "ngp::Testbed::Nerf" cannot be used in an initializer for its own data member
4 errors detected in the compilation of "/home/qwopqwop/project/instant-ngp/src/testbed_volume.cu".
make[2]: *** [CMakeFiles/ngp.dir/build.make:300: CMakeFiles/ngp.dir/src/testbed_volume.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
4 errors detected in the compilation of "/home/qwopqwop/project/instant-ngp/src/testbed_image.cu".
make[2]: *** [CMakeFiles/ngp.dir/build.make:258: CMakeFiles/ngp.dir/src/testbed_image.cu.o] Error 1
4 errors detected in the compilation of "/home/qwopqwop/project/instant-ngp/src/testbed_sdf.cu".
make[2]: *** [CMakeFiles/ngp.dir/build.make:286: CMakeFiles/ngp.dir/src/testbed_sdf.cu.o] Error 1
4 errors detected in the compilation of "/home/qwopqwop/project/instant-ngp/src/testbed.cu".
make[2]: *** [CMakeFiles/ngp.dir/build.make:244: CMakeFiles/ngp.dir/src/testbed.cu.o] Error 1
4 errors detected in the compilation of "/home/qwopqwop/project/instant-ngp/src/testbed_nerf.cu".
make[2]: *** [CMakeFiles/ngp.dir/build.make:272: CMakeFiles/ngp.dir/src/testbed_nerf.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:172: CMakeFiles/ngp.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

could not find optix

Thanks for sharing this brilliant work! I have trouble in finding the optix module. It seems that the OptiX_INSTALL_DIR is used in FindOptiX.cmake, but this file is not in the CMAKE_MODULE_PATH. So I copy the optix/SDK/CMake/FindOptiX.cmake to instant-ngp/cmake and set OptiX_INSTALL_DIR. Now find_package can find the OptiX and OptiX_INCLUDE is set correctly, but Optix_FOUND is not set. If I manually set the Optix_FOUND, an error occurred in build optix_pth.h. How can I set optix correctly?

Headless server version?

Hello, instant-ngp is a really brilliant work. I really appreciate it. I wonder whether this program can be run on a headless server? Thank you very much!

Is 16GB memory not enough?

Tried testing the fox scene but as soon as the window would open it would close with a resulting error shown below:

C:\Users\usr\src\repos\instant-ngp> ./build/testbed --scene data/nerf/fox
14:24:29 INFO     Loading NeRF dataset from
14:24:29 INFO       data\nerf\fox\transforms.json
14:24:29 SUCCESS  Loaded 67 images of size 1080x1920 after 0s
14:24:29 INFO       cam_aabb=[min=[0.983595,-1.33309,-0.378748], max=[2.46175,1.00721,1.43941]]
14:24:29 INFO     Loading network config from: configs\nerf\base.json
14:24:29 INFO     GridEncoding:  Nmin=16 b=1.51572 F=2 T=2^19 L=16
14:24:29 INFO     Density model: 3--[HashGrid]-->32--[FullyFusedMLP(neurons=64,layers=3)]-->1
14:24:29 INFO     Color model:   3--[SphericalHarmonics]-->16+16--[FullyFusedMLP(neurons=64,layers=4)]-->3
14:24:29 INFO       total_encoding_params=13074912 total_network_params=10240
14:24:30 ERROR    Uncaught exception: Could not allocate memory: CUDA Error: cudaMalloc(&rawptr, n_bytes+DEBUG_GUARD_SIZE*2) failed with error out of memory

The documentation doesn't specify the minimum amount so I assume the Could not allocate memory error would be because of that? If not, what else could it be?

Cuda compile errors

I'm getting errors when compiling by running cmake --build build --config RelWithDebInfo -j 16

The build error log is long, so I put it here: https://pastebin.com/6tRsjYfM

Is this due to some incorrect cuda version incompatibility? I'm on cuda 11.2

(tensorflow2_p38) ubuntu@ip-172-31-40-250:~/instant-ngp$ python -V
Python 3.8.12

(tensorflow2_p38) ubuntu@ip-172-31-40-250:~/instant-ngp$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0

(tensorflow2_p38) ubuntu@ip-172-31-40-250:~/instant-ngp$ cmake --version
cmake version 3.22.1
(tensorflow2_p38) ubuntu@ip-172-31-40-250:~/instant-ngp$ echo $PATH 
/usr/local/cuda-11.2/bin:/home/ubuntu/anaconda3/envs/tensorflow2_p38/bin:/home/ubuntu/anaconda3/condabin:/opt/amazon/openmpi/bin:/opt/amazon/efa/bin:/home/ubuntu/anaconda3/condabin:/home/ubuntu/.dl_binaries/bin:/usr/local/cuda/bin:/opt/aws/neuron/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
(tensorflow2_p38) ubuntu@ip-172-31-40-250:~/instant-ngp$ echo $LD_LIBRARY_PATH 
/usr/local/cuda-11.2/lib64:/usr/local/cuda-11.2/extras/CUPTI/lib64:/usr/local/cuda-11.2/lib:/usr/local/cuda-11.2/efa/lib:/opt/amazon/efa/lib:/opt/amazon/efa/lib64:/usr/local/cuda/lib:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/targets/x86_64-linux/lib:/opt/amazon/efa/lib:/opt/amazon/openmpi/lib:/usr/local/lib:/usr/lib::/home/ubuntu/anaconda3/envs/tensorflow2_p38/lib/python3.8/site-packages/tensorflow

Got 'cutlass error' when running script or testbed

Hi everyone,

I ran python -u scripts/run.py --mode nerf --scene data/nerf/fox on a TITAN X with CUDA=11.2 and got an 'curlass error' as follow:

Warning: FullyFusedMLP is not supported for the selected architecture 61. Falling back to CutlassMLP. For maximum performance, raise the target GPU architecture to 75+.
Warning: FullyFusedMLP is not supported for the selected architecture 61. Falling back to CutlassMLP. For maximum performance, raise the target GPU architecture to 75+.
15:28:12 INFO     Density model: 3--[HashGrid]-->32--[FullyFusedMLP(neurons=64,layers=3)]-->1
15:28:12 INFO     Color model:   3--[SphericalHarmonics]-->16+16--[FullyFusedMLP(neurons=64,layers=4)]-->3
15:28:12 INFO       total_encoding_params=13074912 total_network_params=9728
Training:   0%|                                                                                                                                                  | 0/100000 [00:00<?, ?step/s]
Got cutlass error: Error Internal at: 394

The error occurs at line 394 in /dependencies/tiny-cuda-nn/include/tiny-cuda-nn/cutlass_matmul.h when launching initialized CUTLASS kernel. Using the testbed also produces the same problem.

I would like to know whether this has something to do with the CUTLASS MLP and have you met the same problem on the GPU architecture under 70. Many thanks in advance.

cmake error on Ubuntu

hi, I really admire your work.
I met the problem when compiling C++ library with cmake , I have installed cmake==3.22.1.
ubuntu@ubuntu:~/Documents/instant-ngp-master/build$ cmake -version cmake version 3.22.1

I tried 'cmake . -B build', but got error as below:
ubuntu@ubuntu:~/Documents/instant-ngp-master$ cmake . -B build
CMake Error: The source directory "/home/ubuntu/Documents/instant-ngp-master/build" does not exist.
after 'mkdir build', it got a new error as below:
ubuntu@ubuntu:~/Documents/instant-ngp-master$ mkdir build
ubuntu@ubuntu:~/Documents/instant-ngp-master$ cmake . -B build
CMake Error: The source directory "/home/ubuntu/Documents/instant-ngp-master/build" does not appear to contain CMakeLists.txt.

I have never met such error but copied CMakeLists.txt to build/CMakeLists.txt, a new error as below:
ubuntu@ubuntu:~/Documents/instant-ngp-master$ cmake . -B build
`-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- The CUDA compiler identification is NVIDIA 11.1.105
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-11.1/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- No release type specified. Setting to 'Release'.
CMake Error at CMakeLists.txt:96 (add_subdirectory):
add_subdirectory given source "dependencies/glfw" which is not an existing
directory.

CMake Error at CMakeLists.txt:98 (set_target_properties):
set_target_properties Can not find target to add properties to: glfw
...`

I also tried the compile method I used before:
mkdir build cd build cmake .., got same error.

I am not familiar with CMAKE, and just learned ‘cmake . -B build‘ could create the build directory automatically . My Ubuntu is 18.04, Now I have no idea what to do next , and would appreciate your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.