* Fix for shared memory calculation to account for Gaussian2D alignment
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Mark Harris <mharris@nvidia.com>
* Improve launch_bounds coverage everywhere there's an easily inferred number of threads
* Add a global DEFAULT_NUM_THREADS_PER_BLOCK and made sure all kernels use GET_BLOCKS
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Adds image dims to the test data generation for forward gsplat rasterization. uses this in gtests. Adds a new script for inspecting generated datasets. Updates test data commit hash in cmake.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Remove NanoVDBFileGridIdentifier from Python API
* Format
* Remove NanoVDBFileGridIdentifier from C++ API
* Expose parseDeviceString
* Centralize device string overloads to Python bindings
We have been getting intermittent crashes of clangd, and since we have been using the clang-format that is built into the clangd server, when clangd crashes we lose the format-on-save capability of vscode for C++ and CUDA C++ files.
This PR adds settings and recommendation for the vscode extension Seaube.clangFormat which allows specifying a clang-format executable to be used for formatting C++ and CUDA C++ files. This is a fork of the more widely used xaver.clang-format vscode extension because the latter has not released an update in years, in spite of having merged NVIDIA pull requests to support the cuda-cpp language.
After merging, you will need to make sure to install the vscode extension Seaube.clangFormat. VSCode will prompt to install it.
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add AttributeMacros to .clang-format for CUDA attributes
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Reformat source for CUDA attributes, add launch bounds to some 3DGS kernels
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Update script for running clang-format
Signed-off-by: Mark Harris <mharris@nvidia.com>
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Refactor: move of fvdb library sources to src/fvdb, update includes and .clang-format rules.
---------
Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
* Add initial support for Unified Memory
* Add MGPU support for transform points
* Cleanup
* Add guard for CUDA version
* Add cudamanaged support for JOffsetsFromJIdx and PointsInGrid
* Fixes for signed/unsigned warnings
* Rename for consistency
* Remove hardcoded launch bounds
* Internalize numThreads to forEach kernels
* Rename macro to explicitly call out backends
* Clean up signed/unsigned indexing and reduce default block size
* Clean up macro
* Format code
* Remove unnecessary includes
* Address some review comments
* Fix helper function and formatting
* Encapsulate allocation logic
* small clangd fix
Signed-off-by: Francis Williams <francis@fwilliams.info>
* Don't use verbosity 1 in dilation and restore previously crashing dilation in test_ray_marching.py
Signed-off-by: Francis Williams <francis@fwilliams.info>
---------
Signed-off-by: Francis Williams <francis@fwilliams.info>
This PR fixes all current warnings in fVDB. The goal is that by default, the build should only print messages when there is something wrong. It is quiet by default and there are no warnings.
- Fixes existing warnings that occur without -Wall
- Fixes additional (many more) warnings that occur with -Wall. Mostly signed/unsigned comparisons and unused variables.
- Enables -Wall -Werror for CXX options
- Enables -Werror=all-warnings -XCompiler=-Wall,-Werror for CUDA options.
- Disables a bunch of #pragma message output by default
- Makes the build quiet by default rather than verbose.
Once this is merged, compilation will fail if there are any warnings.
To do a verbose build now, add -v for verbose pip output, and -C build.verbose=true for verbose CMake output (print every compilation command line).
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
This new feature provides a device-accelerated process for computing a morphological dilation of a NanoVDB IndexGrid.
3 modes of dilation are supported (see NearestNeighbors in util/MorphologyHelpers.h):
NN_FACE (6-connected); NN_FACE_EDGE (18-connected); NN_FACE_EDGE_VERTEX (26-connected).
Known limitation: As of right now (easily fixable when we have a real-world test case), the operation will proceed correctly only if the dilation operation does not create any new ROOT (4096^3) node.
An example of use can be found in examples/ex_dilate_nanovdb_cuda, which dilates an OpenVDB .vdb file, and compares the result against the NanoVDB/CUDA new implementation.
The file AccessorHelpers.h added in #432 is only included from .cu source files, and clangd reports problems because some of the types it uses are only defined when compiling CUDA code. So it's better to make this a CUDA header (.cuh). This PR renames it and updates all includes.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Separate countEnabledPerLeaf
* Separate forEachCUDA functions from Utils.cuh
* Separate out forEachCPU calls
* Separate out Accessor helper functions
* Remove PrivateUse1
* Rename
* Replace Torch type <-> string functions with PyTorch built-ins
* Revert "Replace Torch type <-> string functions with PyTorch built-ins"
This reverts commit 2e9e43515af924459cf48875ebd75698efecf0b9.
* Use PyTorch built-ins in later versions
* Merge latest master into develop (#394)
* Avoid unnecessary and expensive getLastWriteTime calls for memory mapped files on windows
Signed-off-by: jjtParadox <jturner@4nsi.com>
* Add [[nodiscard]] to confusing math functions.
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
* Fix missing OpenVDB dependency for NanoVDB-only build
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* improved change notes and updated version number
* improved change notes and updated version number
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* improved documentation
Signed-off-by: Ken Museth <ken.museth@gmail.com>
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Separate PointsToGrid kernel lambdas into functors
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing iomanip include for latest GTest
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* improved nanovdb_convert
* improved nanovdb_convert
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* fixed typo
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* added unit tests
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* review feedback
Signed-off-by: Ken Museth <ken.museth@gmail.com>
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix format strings and Windows conversion warning
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix ODR violation due to anonymous namespace in SignedFloodFill
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Minor fix to unit-test of NanoVDB
* Minor fix to unit-test of NanoVDB
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* minor change
Signed-off-by: Ken Museth <ken.museth@gmail.com>
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add DeviceMesh and (optional) NCCL CMake Support
* Add device mesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Restore current device in constructor and destructor
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Enable range-based for loops
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use structured bindings inside for loop
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove uneeded accessors and modularize functions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Statically initialize entry point
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Encapsulate
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to lightweight wrapper class for DeviceNodes vector
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Cleanup
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Minor changes needed for DistributedPointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add RAII DeviceGuard
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* More cleanup
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Clean up NCCL dependency
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove parallel_for to modularize
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Implement and test move constructor/assignment
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add docs
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Expand test and documentation
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Move non-reinit comment to function description
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Switch to using aliases and modern type names
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Use size_type instead of int for return
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Separate out DeviceGuard and clean up API
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to DeviceMesh for MGPU sparse convolution example
* Convert MGPU convolution example to use DeviceMesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix typos and clarify
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Check for errors and switch to for_each
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing const variant of deviceData(device)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing inline for DeviceMesh functions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing NCCL ifdef
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix invalid free in UnifiedBuffer move constructor
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Change UnifiedBuffer prefetch and advise to be const
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix missing relocatable device code flag
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix namespace for AbsDiff and RelDiff ostream overloads
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix out-of-bounds device id
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix TBB template deduction in C++20
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fixed issue in signedfloodfill
* Fixed issue in signedfloodfill
Signed-off-by: Ken <ken.museth@gmail.com>
* partially addressed review comments
Signed-off-by: Ken <ken.museth@gmail.com>
* added RootData::TileIterator
Signed-off-by: Ken <ken.museth@gmail.com>
* cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed assert bug
Signed-off-by: Ken <ken.museth@gmail.com>
* snapshot
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed bug and improved unit-test
Signed-off-by: Ken <ken.museth@gmail.com>
* improved unit test and documentation
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix DeviceMesh.h header to be self-contained
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing constructor for C++20 used in AddBlindData.cuh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* removed dead code and updated the minor version number
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix class-memaccess warning due to non-trivial copy-assignment in GridBlindMetaData
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* major improvements to GridBlindMetaData
* major improvements to GridBlindMetaData
Signed-off-by: Ken <ken.museth@gmail.com>
* minor changes to fix clang issue
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* minor simplification in CreateNanoGrid
* minor simplification in CreateNanoGrid
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed typo
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* introducing new magic numbers for grids and files
* introducing new magic numbers for grids and files
Signed-off-by: Ken <ken.museth@gmail.com>
* removed two redundant magic numbers
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* fixed typos and improved documentation in NanoVDB
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Consolidate DeviceGuard into DeviceMesh header
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add distributed implementation of PointsToGrid
* Add distributed implementation of PointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition in merge and single GPU case
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix kernel/cudaFree race conditions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add DistributedPointsToGrid unittest
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Clean up example
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use range-based for loops
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use structured bindings inside for loop
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix Windows build and some warnings
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update for refactored DeviceMesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix copyright/include
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add parallelForEach helper
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Templatize kernels to align with CUB better
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Shorten TemporaryDevicePool to TempDevicePool
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Refactor to use TempDevicePool
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to class
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Parallelize kernel dispatch in build
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition wrt to root node processing
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Speed up synchronization
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add comments and fix deprecated TransformInputIterator
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Address review comments
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Address more review comments
* Add more cudaCheck calls and restrict EqualityIndicator type
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix license identifiers and remove unused code
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing include
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* revert deprecation warning
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* minor cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Silence CMake warning about FindBoost module deprecation
* Silence CMake warning about FindBoost module deprecation
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix typo
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failures
* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failure
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Suppress stringop-overflow warning due to GCC 11 regression
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Generalize MGPU grid construction to any power-of-two number of GPUs
* Start support for more than two GPUs in key merge
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Flip flop storage
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Generalize concurrent leftIntervals/rightIntervals usage
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix median search
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix rebalancing
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix recursive MGPU merge
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update TODO
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add guards for zero-tile GPUs
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition across different merge levels (and memory leak in corresponding tests)
* Fix memory leaks in PointsToGrid tests
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix leapfrogging across recursion levels
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Parallelize kernel dispatch for different levels
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Feature/fix get set methods
* minor cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed issue in get/set random access methods
Signed-off-by: Ken <ken.museth@gmail.com>
* cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* deleted white space
Signed-off-by: Ken <ken.museth@gmail.com>
* cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* added unit tests
Signed-off-by: Ken <ken.museth@gmail.com>
* improved unit tests
Signed-off-by: Ken <ken.museth@gmail.com>
* improved unit tests
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add optimizations to MGPU PointsToGrid
* Add timer for MGPU PointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Avoid blocking kernel launches due to cudaFree
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix overlapping of copies
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Pipeline pointsPerVoxelPrefix sum
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Cleanup and optimization
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Further improve pipelining
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove unnecessary sync point
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Revert "Remove unnecessary sync point"
This reverts commit f01b36ad852f32ec65517b3baa08ea267d5edc2d.
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to GPU sync
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix event destruction race condition and reduce host thread latency
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Revert timer add
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* More fine-grained pipelining
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix event wait/destruction race condition
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Improve points to grid
* minor cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* minor improvements to nanovdb::tools::cuda::PointsToGrid
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix Windows warnings
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Force set _WIN32 flag
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Move away from deprecated 20.04 runners
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: jjtParadox <jturner@4nsi.com>
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: jjtParadox <jturner@4nsi.com>
Co-authored-by: Jeff Lait <jlait@andorra.sidefx.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
* Templatize buffer type for distributed points to grid (#403)
* Templatize buffer type for distributed points to grid
* Add missing template parameter
* Add pool
---------
Signed-off-by: jjtParadox <jturner@4nsi.com>
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: jjtParadox <jturner@4nsi.com>
Co-authored-by: Jeff Lait <jlait@andorra.sidefx.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
* Make get_torch.cmake robust to missing conda symlink
* Fix setting `nvtx3_dir` to help torch find nvtx3 installed in fvdb build
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
* split sh into two files
move spherical harmonics autograd into its own file
small refactor
factor out jagged spherical harmonics
split jagged spherical harmonics in autograd
cleanup
cleanup
even more cleanup
remove camera dim from sh coeffs
split out shN and sh0
* more cleanup
* no more separate jagged op
* rm old jagged kernel
* don't hardcode float32
* tests
* more tests
* typo fix
* whitespace
* permute SH axes in kernel
* n first
* fix naninfmask tests
* fix merge issues
Signed-off-by: Francis Williams <francis@fwilliams.info>
* clang format
Signed-off-by: Francis Williams <francis@fwilliams.info>
* fix gsplat tests
Signed-off-by: Francis Williams <francis@fwilliams.info>
* comments
Signed-off-by: Francis Williams <francis@fwilliams.info>
* fix PR comments
Signed-off-by: Francis Williams <francis@fwilliams.info>
---------
Signed-off-by: Francis Williams <francis@fwilliams.info>
* wip split script
* working split, but grows beyond target region
* first working split training
* working multi-gpu script
* refactor into sandbox
* adding dockerfile for 3dgs
* adding script to downsize colmap images
* updates after multi-gpu testing
* updates after testing
* refactor back to project and remove sandbox
* merge with upstream feature branch
* added docs more testing cleanups
* formatting / license updates
* updates to ortho script to address comments
* Avoid unnecessary and expensive getLastWriteTime calls for memory mapped files on windows
Signed-off-by: jjtParadox <jturner@4nsi.com>
* Add [[nodiscard]] to confusing math functions.
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
* Fix missing OpenVDB dependency for NanoVDB-only build
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* improved change notes and updated version number
* improved change notes and updated version number
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* improved documentation
Signed-off-by: Ken Museth <ken.museth@gmail.com>
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Separate PointsToGrid kernel lambdas into functors
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing iomanip include for latest GTest
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* improved nanovdb_convert
* improved nanovdb_convert
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* fixed typo
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* added unit tests
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* review feedback
Signed-off-by: Ken Museth <ken.museth@gmail.com>
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix format strings and Windows conversion warning
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix ODR violation due to anonymous namespace in SignedFloodFill
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Minor fix to unit-test of NanoVDB
* Minor fix to unit-test of NanoVDB
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* minor change
Signed-off-by: Ken Museth <ken.museth@gmail.com>
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add DeviceMesh and (optional) NCCL CMake Support
* Add device mesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Restore current device in constructor and destructor
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Enable range-based for loops
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use structured bindings inside for loop
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove uneeded accessors and modularize functions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Statically initialize entry point
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Encapsulate
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to lightweight wrapper class for DeviceNodes vector
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Cleanup
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Minor changes needed for DistributedPointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add RAII DeviceGuard
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* More cleanup
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Clean up NCCL dependency
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove parallel_for to modularize
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Implement and test move constructor/assignment
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add docs
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Expand test and documentation
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Move non-reinit comment to function description
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Switch to using aliases and modern type names
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Use size_type instead of int for return
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Separate out DeviceGuard and clean up API
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to DeviceMesh for MGPU sparse convolution example
* Convert MGPU convolution example to use DeviceMesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix typos and clarify
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Check for errors and switch to for_each
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing const variant of deviceData(device)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing inline for DeviceMesh functions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing NCCL ifdef
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix invalid free in UnifiedBuffer move constructor
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Change UnifiedBuffer prefetch and advise to be const
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix missing relocatable device code flag
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix namespace for AbsDiff and RelDiff ostream overloads
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix out-of-bounds device id
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix TBB template deduction in C++20
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fixed issue in signedfloodfill
* Fixed issue in signedfloodfill
Signed-off-by: Ken <ken.museth@gmail.com>
* partially addressed review comments
Signed-off-by: Ken <ken.museth@gmail.com>
* added RootData::TileIterator
Signed-off-by: Ken <ken.museth@gmail.com>
* cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed assert bug
Signed-off-by: Ken <ken.museth@gmail.com>
* snapshot
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed bug and improved unit-test
Signed-off-by: Ken <ken.museth@gmail.com>
* improved unit test and documentation
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix DeviceMesh.h header to be self-contained
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing constructor for C++20 used in AddBlindData.cuh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* removed dead code and updated the minor version number
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix class-memaccess warning due to non-trivial copy-assignment in GridBlindMetaData
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* major improvements to GridBlindMetaData
* major improvements to GridBlindMetaData
Signed-off-by: Ken <ken.museth@gmail.com>
* minor changes to fix clang issue
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* minor simplification in CreateNanoGrid
* minor simplification in CreateNanoGrid
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed typo
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* introducing new magic numbers for grids and files
* introducing new magic numbers for grids and files
Signed-off-by: Ken <ken.museth@gmail.com>
* removed two redundant magic numbers
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* fixed typos and improved documentation in NanoVDB
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Consolidate DeviceGuard into DeviceMesh header
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add distributed implementation of PointsToGrid
* Add distributed implementation of PointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition in merge and single GPU case
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix kernel/cudaFree race conditions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add DistributedPointsToGrid unittest
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Clean up example
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use range-based for loops
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use structured bindings inside for loop
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix Windows build and some warnings
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update for refactored DeviceMesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix copyright/include
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add parallelForEach helper
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Templatize kernels to align with CUB better
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Shorten TemporaryDevicePool to TempDevicePool
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Refactor to use TempDevicePool
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to class
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Parallelize kernel dispatch in build
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition wrt to root node processing
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Speed up synchronization
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add comments and fix deprecated TransformInputIterator
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Address review comments
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Address more review comments
* Add more cudaCheck calls and restrict EqualityIndicator type
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix license identifiers and remove unused code
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing include
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* revert deprecation warning
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* minor cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Silence CMake warning about FindBoost module deprecation
* Silence CMake warning about FindBoost module deprecation
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix typo
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failures
* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failure
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Suppress stringop-overflow warning due to GCC 11 regression
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Generalize MGPU grid construction to any power-of-two number of GPUs
* Start support for more than two GPUs in key merge
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Flip flop storage
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Generalize concurrent leftIntervals/rightIntervals usage
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix median search
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix rebalancing
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix recursive MGPU merge
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update TODO
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add guards for zero-tile GPUs
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition across different merge levels (and memory leak in corresponding tests)
* Fix memory leaks in PointsToGrid tests
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix leapfrogging across recursion levels
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Parallelize kernel dispatch for different levels
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Feature/fix get set methods
* minor cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* fixed issue in get/set random access methods
Signed-off-by: Ken <ken.museth@gmail.com>
* cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* deleted white space
Signed-off-by: Ken <ken.museth@gmail.com>
* cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* added unit tests
Signed-off-by: Ken <ken.museth@gmail.com>
* improved unit tests
Signed-off-by: Ken <ken.museth@gmail.com>
* improved unit tests
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add optimizations to MGPU PointsToGrid
* Add timer for MGPU PointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Avoid blocking kernel launches due to cudaFree
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix overlapping of copies
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Pipeline pointsPerVoxelPrefix sum
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Cleanup and optimization
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Further improve pipelining
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove unnecessary sync point
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Revert "Remove unnecessary sync point"
This reverts commit f01b36ad852f32ec65517b3baa08ea267d5edc2d.
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to GPU sync
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix event destruction race condition and reduce host thread latency
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Revert timer add
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* More fine-grained pipelining
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix event wait/destruction race condition
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Improve points to grid
* minor cleanup
Signed-off-by: Ken <ken.museth@gmail.com>
* minor improvements to nanovdb::tools::cuda::PointsToGrid
Signed-off-by: Ken <ken.museth@gmail.com>
---------
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix Windows warnings
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Force set _WIN32 flag
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Move away from deprecated 20.04 runners
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: jjtParadox <jturner@4nsi.com>
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: jjtParadox <jturner@4nsi.com>
Co-authored-by: Jeff Lait <jlait@andorra.sidefx.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
* Add new image saving test utility and create fvdb_test_utils static lib
* Add `gtests` and `benchmarks` args to build.sh
* Add multicamera rasterization test
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
This remove the last vestiges of glm usage from our code by refactoring any Gaussian Projection Backwards code to use nanovdb::math classes and to cleanup any style/naming conventions on code that is refactored. To that end, several themes of work in this PR include:
Removing GLM from our build infrastucture
Transitioning the code in GaussianProjectedBackward.cu & GaussianProjectedJaggedBackward.cu to using nanovdb::math in place of glm
Adding functionality to nanovdb::math to support a few needed missing operators
Removing GaussianTypes.cuh which was used to define glm types for Projection
Consolidated any remaining, needed warp-prefix functions from GaussianTypes.cuh and GaussianVectorTypes.cuh into GaussianWarpUtils.cuh
Refactored functions in GaussianUtils.cuh to return their calculated results instead of directly modifying output parameters where possible. The return values of these functions is then used by the calling code for modifying variables in the calling code. For instance, instead of add_blur_vjp adding blur to a parameter passed by reference, generateBlurVectorJacobianProduct now builds a nanovdb::Math::Mat2 which is used by the calling code.
Add docstrings to GaussianUtils.cuh
Moving snake_case variables/functions to camelCase and being more descriptive in their naming
Making variable types and names consistent between related functions (forward/backwards)
Fixing worldToCamMatrices being mistakenly called camToWorldMatrices
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Debugging
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Clarifying comments
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Fix logic in computeGradientState
Fixed appropriate sizing of the tensors it writes to
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Change the computeGradientState loops over C*N to save on some multiplications
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* backward test checkpoint
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Revert BackwardTest rework
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* update test data tag
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* cleanup
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Added a fvdb devcontainer so that VSCode and Github Codespaces can run inside the docker environment automatically
Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
* Improved the language in the comments
Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
* Made suggested configuration changes from VSCode copilot
Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
---------
Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
Similar to #231 this PR refactors the forward pass of gaussian rasterization.
Adds a new Gaussian structure for use in both passes
Adds a DeviceArgs class that simplifies configuring and passing arguments for the kernel, and contains the method volumeRenderTileForward which operates on the class data directly.
Updates code for our coding style standard (e.g. camel case names)
Renames "colors" to "features" everywhere to better match high-dimensional rendering capabilities.
Removes redundant "pixel" and "perPixel" prefix/suffixes from some variables.
Signed-off-by: Mark Harris mharris@nvidia.com
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
This adds a CMakeLists.txt that simply uses CPM to download / cache the FVDB test data if it is not already in the CPM_SOURCE_CACHE.
This is run by build.sh when running ctest (build.sh ctest).
Note that the CPM_SOURCE_CACHE needs to be set to the same value as set when building the gtests (or unset on both).
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add CPM_SOURCE_CACHE to env in fvdb-gtests GHA job
Signed-off-by: Mark Harris <mharris@nvidia.com>
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Refactors forward pass of projection to use tensor accessors and wrap kernel call in a class.
Also load cameras into shared memory which should be more efficient than having each thread load the same camera.
Signed-off-by: Francis Williams <francis@fwilliams.info>
* Switch mHostMetadata to raw pointer in preparation for unified memory
* Set GPU metadata via kernels
* Add missing device guard
* Insert newline
* Use kernels for setFineTransform and setCoarseTransform
* Fix GridBatchImpl for empty grid
* More cleanup
* Move indexInternal to .cu file
* Add missed file
This PR sets up running our gtest build targets as part of our automated fVDB CI actions.
First, all the gtests are built as part of the library & wheel building and the whole build directory is uploaded as an artifact separately of the wheel.
In a separate task on a CI machine with a GPU, the tar'd build directory is downloaded. The build directory is un-tar'd and the gtests are run normally with ./build.sh ctest
Fixes#172Fixes#173
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Mark Harris <mharris@nvidia.com>
Previously we pinned NumPy to versions prior to v2.0.0 (i.e. v1.x.x) due to the lack of NumPy 2 ABI support in point-cloud-utills. The latest version of point-cloud-utils now supports the NumPy 2 ABI so we can relax this pinning.
PyTorch v2.6.0 requires NumPy v2.x.x and it's likely that slightly earlier versions also built with NumPy v2.x.x as well.
* Remove TorchDeviceOrString in favor of stricter function overloads
* Small fixes to device index
* Fix formatting
* Remove trailing whitespace
* Add missing binding
* Small fixes
* Switch from torch::optional to std::optional
* Fix missing device ordinal
* Update stub file
* Format
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Promotes the SyncBatchNorm layer to a first-class citizen.
Addresses the issue with the original implementation where checkpoints created with SyncBatchNorm were incompatible with vanilla BatchNorm, which is a behavior PyTorch natively supports.
---------
Signed-off-by: Sérgio Agostinho <sagostinho@nvidia.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Adds Various level set constructors:
* tools::createLevelSetCapsule creates a grid containing a narrow-band level set representation of a capsule (tube with constant radius and sphere caps).
* tools::createLevelSetTaperedCapsule creates a grid containing a narrow-band level set representation of a tapered capsule (tube with sphere caps and different radii at both ends, or equivalently the convex hull of two spheres with possibly different centers and radii).
* tools::createLevelSetTubeComplex creates a grid containing a narrow-band level set representation of a tube complex (a collection of capsules or tapered capsules defined by endpoint coordinates and segment indices).
* tools::createLevelSetDilatedMesh creates a grid containing a narrow-band level set representation of a dilated surface mesh (dilated by a radius in all directions).
Base class that can be used to create other level sets:
* tools::ConvexVoxelizer, which can be inherited to implement a convex level set constructor.
Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
* Added fvdb CI build steps to merge feature/fvdb branch in PR to PR branch before testing
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Implemented overloaded fucntions in GsplatUtils, Projection, etc. to not break other pieces of pipeline that still use glm
Implemented various Matrix classes in nanovdb::math that were required.
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Mark Harris <mharris@nvidia.com>
Switched from using the PyTorch built-in setuptools-based cpp_extension module to a scikit-build-core + CMake build system. Additionally this includes the introduction of a new build script, updates to the Dockerfile, and updates to the documentation.
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Implements a new GaussianSplat3d class in C++ that also tracks appropriate gradient state for optimization.
Clean up the Gaussian splatting code in python. We now only depend on Pytorch!
Clean up the optimizer code a lot by moving gradient state tracking to C++ class.
Move refinement part of optimization code to training script since it's clearer. The whole algorithm can now be read in one file.
Add a bunch of new error checking.
Still outstanding:
Implement pruning/splitting/duplication in CUDA (Going to be a seperate PR)
-----
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
it doesn't do an in-place transpose.
Thus the line
mat.transpose(); // the 3x3 in nanovdb is transposed relative to openvdb's 3x3
is a no-op, and not actually transposing the matrix. Since we DO
transpose when we do an OpenToNano; it is important we transpose here
or we can't round-trip.
Unfortunately, it has been this way since the initial commit, so it is
quite likely tooling has already worked around this....
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
* Add transform metadata to non-index grids we're saving
fixes#32
* Fix data grid saving to be able to save non-uniform voxel scales
Add tests
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Fix memory leaks in PointsToGrid tests
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix leapfrogging across recursion levels
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Parallelize kernel dispatch for different levels
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* move atomic adds to helper
* add fixture and basic cat test
* move gradient contribution to its own function
* renaming
* remove color struct to allow different shared memory channels
* channel ranges for atomic add and shared memory color dim arg
* channel range for color fetching into shared memory and split color and gaussian shared memory fetching into two functions
* size_t
* add template parameter for shared channels
* stub for chunked
* checkpoint
* checkpoint
* rm prints
* some constexpr
* more loop unrolling
* more unrolling
* fix
* more tests
* rm old codepath
* start renaming
* more renames
* rename
* rename all members to use m prefix
* rename template args
* more renames
* cpu throws test
* error checking and bring back all dimensions
* small cleanup
* Start support for more than two GPUs in key merge
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Flip flop storage
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Generalize concurrent leftIntervals/rightIntervals usage
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix median search
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix rebalancing
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix recursive MGPU merge
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update TODO
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add guards for zero-tile GPUs
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* move gaussian accumulation into a function. Move delta and sigma into methods on Gaussians
* Added a simple test to compare GaussianRasterizeBackward against some saved data.
* Fixed a bug where packed was uninitialized.
* Fixed another latent bug where we were getting a pointer from a tensor accessor. This might fail if that accessor is strided in the last dimension.
* Populate compile time definition of path to test data in C++ unit tests.
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Mark Harris <harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <swahtz@users.noreply.github.com>
* Add CMakeLists and dependency getters for libfvdb
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add cudnn to dev conda environment
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Fix compilation errors uncovered when building with cmake
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add build dir to gitignore
* cudnn_fe --> cudnn_frontend, fix cutlass
* Revert adding cudnn to conda dev_environment
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Build gtests and gbenchmarks from main cmakelists
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Fix tensor dimension corruption by scoping IntArrayRef's vector lifetime
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add Cutlass patch
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add cpm source cache.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Fix CPM source cache and make it overrideable
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add blosc and missing compilation settings.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Since we require CUDA 12+, we can drop the cutlass patch.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Fix blosc build options
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Fix up compiler options and properly scope cmake options, and generate compile_commands.json
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Remove commented out lines.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add install rules
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Whitespace
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Make get_torch.cmake a bit more robust (more informative error on import failure)
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add missing typename keyword (pre-C++20)
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Update to C++20, which for some reason makes us need the cutlass patch again, so enable it.
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
* adding in scripts for ortho, mesh, mask training etc
* rm dep on colmapparser in gaussiansplatting
* move colmap dataset out of core fvdb into project
* update imports in gaussian splatting project
* revert dev env
* autoformat and rename T1 -> normalizat_transform
* clean up normalization argument
* print to warning
* rm print
* bring back sorting
---------
Co-authored-by: Francis Williams <francis@fwilliams.info>
* remove glm dep and use struct
* rename macros
* small cleanup and const some things
* move volume render backward to helper function
* checkpoint
* rename S -> ScalarType
* pass in warp as variable
* camel case and type cleanup
* S -> ScalarType
* clean up full file
* address PR comments
* rename thread -> blockDim, blocks -> gridDim
* fixed and moved to class
* checkpoint
* checkpoint
* checkpoint
* rename
* cleanup
* checkpoint
* cleanup
* more cleanup
* Fix comment
* handle empty inputs
* fix
* fix error checking
* Implementation and tests of dispatchGaussianTileIntersectionSparse (not yet passing)
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Some bug fixes, intermediate changes, still failing tests.
* fix
* Use custom kernel for sparse tile_offsets. Fixes current sparse test failures.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Make non-sparse tile_offsets look like it used to.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Refactor dispatchGaussianTileIntersection to reduce repetition between dense and sparse.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add a random sparsity test.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* docs and move sparse intersection into a different header
* grid stride loops
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Francis Williams <francis@fwilliams.info>
* Add distributed implementation of PointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition in merge and single GPU case
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix kernel/cudaFree race conditions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add DistributedPointsToGrid unittest
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Clean up example
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use range-based for loops
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use structured bindings inside for loop
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix Windows build and some warnings
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update for refactored DeviceMesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix copyright/include
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add parallelForEach helper
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Templatize kernels to align with CUB better
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Shorten TemporaryDevicePool to TempDevicePool
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Refactor to use TempDevicePool
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to class
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Parallelize kernel dispatch in build
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix race condition wrt to root node processing
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Speed up synchronization
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add comments and fix deprecated TransformInputIterator
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Address review comments
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Address more review comments
* Add more cudaCheck calls and restrict EqualityIndicator type
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix license identifiers and remove unused code
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add missing include
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
* Defer psutil import which is not specified as a Python requirement
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix formatting
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
* Rename computeSparseInfoTest and add new unit tests for GaussianTileIntersection.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Fix handling of all-zero-radius splats. Fixes failing unit test.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* spdx header
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Fix the failing BasicIntersectionTest
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add an explanatory comment about packed mode.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* refactoring
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Add failing test, commented out.
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Separate GaussianFullyFusedProjection*.cu into distinct files (#201)
* separate projection files
* rename some functions
* rename jagged
* fix empty gaussian test, add error checking, and add error checking test
* Rename NanInfMaskTest to match other test file naming
Signed-off-by: Mark Harris <mharris@nvidia.com>
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
Co-authored-by: Francis Williams <francis@fwilliams.info>
* Merge changes from latest NanoVDB
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Fix comments and trailing include
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* save ply for gaussian splats
* fixes
* filter operation in cuda
* checkpoint
* fixes and python bindings
* end to end test in python
* rm unused imports
* helper function for getting bytes from tensor
* rm thread divergent returns and inline on header only function
* use std generate
* use tensorOpts
* use config array
* const filename
* error message fix
* contiguous
* stylefix
* whitespace
* stylefix2
* grid stride loop and launch bounds
* use stream in sparse info computation (#190)
* Add a Vec2 type to nanovdb math (#166)
* orthographic projection in gaussian splatting
add orthographic flag to depth rendering function
derp
add ortho projection to jagged projection
* small refactor
* add vec2 class to nanovdb math
* fix
* Separate GaussianFullyFusedProjection*.cu into distinct files (#201)
* separate projection files
* rename some functions
* rename jagged
* orthographic projection in gaussian splatting
add orthographic flag to depth rendering function
derp
add ortho projection to jagged projection
* small refactor
* add vec2 class to nanovdb math
* fix
Extends computeSparseInfo() (from #137) to work with a JaggedTensor of pixels to render with outer dimension > 1. In other words, pixels from more than one image.
Adds unit tests to exercise this functionality. Also parameterizes the strided-pixel unit tests to further DRY up the test code.
Collaboration with @swahtz and @fwilliams
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Francis Williams <francis@fwilliams.info>
Closes#60
This pull request adds functionality to compute the configuration tensors for Sparse 3D Gaussian Splatting. These tensors will be used to mask the output of 3DGS when fed a list of sparse pixels to render, and to "regather" the sparse rendered pixels corresponding to the input pixel UV coordinates.
A fairly comprehensive C++ unit test suite is also added.
Build Configuration Updates:
fvdb/.vscode/c_cpp_properties.json: Updated include paths to reflect new dependencies and updated Python version from 3.10 to 3.11.
fvdb/setup.py: Added psutil import and set MAX_JOBS environment variable based on available RAM to control the number of parallel jobs for building. [1] [2]
fvdb/src/cmake/get_fvdb.cmake: Modified to dynamically find the Python version and update the FVDB_BUILD_DIR accordingly.
fvdb/src/tests/CMakeLists.txt: Added compile options for CUDA and C++ in debug mode and configured new unit tests for Gaussian splatting. [1] [2]
Functionality Enhancements:
fvdb/src/detail/ops/gsplat/GaussianSplatSparse.cu: Added new CUDA kernels and functions to implement sparse Gaussian splatting, including detailed comments explaining the algorithm and its components.
fvdb/src/detail/ops/gsplat/GaussianSplatSparse.h: Added header declarations for the new sparse Gaussian splatting functions.
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Francis Williams <francis@fwilliams.info>
* Moved examples/3dgs->projects/3d_gaussian_splatting/training
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Fix up READMEs
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Fix build- and dev- environments and cmake so unit tests will build with conda-forge packages
Signed-off-by: Mark Harris <mharris@nvidia.com>
* Remove no-longer-needed env
Signed-off-by: Mark Harris <mharris@nvidia.com>
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Moved the recommended build/test/dev environments to use the conda-forge channel as their package source. This has required moving to CUDA 12.0, PyTorch 2.4.1. Also removed the NKFW tests because they were breaking in the new environment but these tests’ functionality were covered by other unit tests.
closes#121closes#135
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
* Add device mesh
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Restore current device in constructor and destructor
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Enable range-based for loops
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Use structured bindings inside for loop
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove uneeded accessors and modularize functions
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Statically initialize entry point
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Encapsulate
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Switch to lightweight wrapper class for DeviceNodes vector
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Cleanup
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Minor changes needed for DistributedPointsToGrid
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add RAII DeviceGuard
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* More cleanup
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Clean up NCCL dependency
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Remove parallel_for to modularize
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Implement and test move constructor/assignment
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Add docs
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Expand test and documentation
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Move non-reinit comment to function description
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Switch to using aliases and modern type names
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Use size_type instead of int for return
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Separate out DeviceGuard and clean up API
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
* Add basic cmake and an example gbenchmark
* Modify setup.py to exclude benchmarks directory
* gitignore benchmarks build dir
* Make CMake work with conda-forge Torch, and make simple benchmark use Torch.
* Add working C++11 ABI Torch conda environment
* Modularize the cmake.
* Whitespace cleanup
* empty
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Add comment about excluding benchmarks directory
* Modularize python, torch and fvdb dependencies, and add better error checking
* Empty commit to test signing
* Empty commit to test signing
* Add cmake and example for gtest-based C++ unit tests
* remove whitespace change.
* set `files.insertFinalNewLine` to true in workspace settings, fix EOF newlines
* newline at EOF
* Rename ExampleTest
* Add CTest support.
* "benchmarks" --> "tests"
* Fix typo
* Ignore tests directory (oops)
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
* Create issue.md
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update and rename issue.md to task--or--work--item.md
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update task--or--work--item.md
rm trailing whitespace
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Update and rename task--or--work--item.md to blank--issue
Signed-off-by: Matthew Cong <mcong@nvidia.com>
* Rename blank--issue to blank--issue.md
Signed-off-by: Matthew Cong <mcong@nvidia.com>
---------
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
* Add basic cmake and an example gbenchmark
* Modify setup.py to exclude benchmarks directory
* gitignore benchmarks build dir
* Make CMake work with conda-forge Torch, and make simple benchmark use Torch.
* Add working C++11 ABI Torch conda environment
* Modularize the cmake.
* Whitespace cleanup
* empty
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Add comment about excluding benchmarks directory
* Modularize python, torch and fvdb dependencies, and add better error checking
* Empty commit to test signing
* Empty commit to test signing
* Use `find_library` to find libfvdb.so
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
* black formatting fix for garfield download_example_data
* Removing cv2 import that is only valid for pip opencv package
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Changes to .clang-format for better include sorting
Gsplat rasterization code cleanup and add unused arguments for pixel mask
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Added panoptic segmentation project with MaskPLS implementation
Fixed install issue not including `fvdb.optim`
Re-introduced support for Volta&Turing but added errors for use of certain conv backends
Added interpolation functions to VDBTensor
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Expose various 'ELU non-linearities
Integer JaggedReduce
Updated build TORCH_CUDA_ARCH_LIST for supported CUDA compute architectures, fixed Docker dev and CI images
Updated REAME's env and build instructions
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* added read/write support of OFF files to vdb_tool
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* added pendingchanges/vdb_tool.txt
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* added patch from Jonathan S
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* minor cleanup
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* addressed review comments
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* before major improvements to readPLY
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* cleanup
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* removed whitespace
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* added nanovdb::vdb_tool::swapBytes
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* added more documentation
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* patch by Jonathan S to fix CI
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* Fix gtest install for rpm. not deb
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Building gtest from source; newer version required than available on distro
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* permissions fix
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Attempting to fix doxygen node version issue
Missing iomanip include in TestNanoVDB
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* Bump container versions attempt to fix doxygen test
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* install_latex fix
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* added ascii option to Geometry::writePLY
Signed-off-by: Ken Museth <ken.museth@gmail.com>
* fixing issue introduced in the previous commit
Signed-off-by: Ken Museth <ken.museth@gmail.com>
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
• Significant refactor of gaussian splatting pipeline
• Refactor of examples/3dgs using the new 3dgs pipeline (see README for a starting point to the example)
• License identifiers changed to Apache 2.0 to be in line with OpenVDB
• A `dev_environment.yml` is now included to help construct a reccommended development environment
• A bug was fixed when using `GridBatch.ijk_to_inv_index(cumulative=False)` when the ijk argument has repeated elements
• GLM is being vendored in and is no longer a runtime dependency
• The utility functions needed in the examples and unit tests to download and read the relevant data files has been refactored into `fvdb.utils.tests` and `fvdb.utils.examples` respectively
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
* nonLeafCount and treeDepth return Index64 in TreeBase.
* All ABI breakages safeguarded for versions < 12.
* Deprecated implementations of nodeCount for vector<Index32> arguments.
Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
leafCount, unallocatedLeafCount, nodeCount now work with Index64 to accommodate trees with more than 2^32-1 leaf nodes.
Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Version v0.1.0 release
Added gaussian splatting support
Significant VDBTensor API rewrite as well as various GridBatch function name changes to make them more consistent
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Updated Github test actions to split apart build and test steps
Added negative operator to JaggedTensor; to operators to SparseConvPackInfo
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
JaggedTensor slicing and indexing moved to CUDA kernels
Small updates to basic_concepts docs and README
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
•Reintroduced missing src/build/* files that were accidentally ommitted
•JaggedTensor concatentation moved to a cuda kernel
•Non-cumulative indices for ijk mappings is now the default return style (makes indexing into JaggedTensors of data more natural)
•cuDNN disabled for CUDA versions <12
•Updated notebook files to new API and now included
•Removed deprecated usage of `python setup.py test` and running pytest directly
Signed-off-by: Jonathan Swartz <jonathan@swartzfx.com>
* Uses any available pdal plugin to read input file
* Writes RGB into Cd channel of points (also extended to PTS implementation)
* Adds a requirement on PDAL, so hidden behind a feature VDB_TOOL_USE_PDAL - off by default
Signed-off-by: Tom Matterson <tommatterson@gmail.com>
# Fix error: Cannot prepare internal mirrorlist: No URLs in mirrorlist. CentOS 8 reached EOL means need to replace the official mirror to vault.centos.org
# Comment out mirrorlist and replace #baseurl=...mirror.centos.org with baseurl=...vault.centos.org in files starting with CentOS- in /etc/yum.repos.d folder
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
# Fix error: Cannot prepare internal mirrorlist: No URLs in mirrorlist. CentOS 8 reached EOL means need to replace the official mirror to vault.centos.org
# Comment out mirrorlist and replace #baseurl=...mirror.centos.org with baseurl=...vault.centos.org in files starting with CentOS- in /etc/yum.repos.d folder
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- {name:'asan', build:'asan', components:'core,test,axcore,axtest', cmake:'-DNANOVDB_USE_OPENVDB=ON -DOPENVDB_AX_STATIC=OFF -DOPENVDB_CORE_STATIC=OFF -DUSE_BLOSC=OFF'}# We never called blosc_destroy(), so disable blosc to silence these errors
- {name:'asan', build:'asan', components:'core,test', cmake:'-DNANOVDB_USE_OPENVDB=ON -DOPENVDB_AX_STATIC=OFF -DOPENVDB_CORE_STATIC=OFF -DUSE_BLOSC=OFF'}# We never called blosc_destroy(), so disable blosc to silence these errors
@@ -22,7 +22,7 @@ open source software best practice policies of the Linux Foundation.
#### License
OpenVDB is licensed under the [Mozilla Public License, version 2.0](LICENSE.md)
OpenVDB is licensed under the [Apache License, version 2.0](LICENSE.md)
license. Contributions to OpenVDB should abide by that standard
license.
@@ -54,7 +54,7 @@ Every commit must be signed off. That is, every commit log message
must include a “`Signed-off-by`” line (generated, for example, with
“`git commit --signoff`”), indicating that the committer wrote the
code and has the right to release it under the
[Mozilla Public License, version 2.0](LICENSE.md)
[Apache License, version 2.0](LICENSE.md)
license. See the [TAC documentation on contribution sign off](https://github.com/AcademySoftwareFoundation/tac/blob/master/process/contributing.md#contribution-sign-off) for more information on this requirement.
OpenVDB is an open source C++ library comprising a novel hierarchical data
@@ -28,14 +28,14 @@ generally less stable than the [production releases](https://github.com/AcademyS
### License
OpenVDB is released under the [Mozilla Public License Version 2.0](https://www.mozilla.org/MPL/2.0/),
OpenVDB is released under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0),
which is a free, open source software license developed and maintained by the
Mozilla Foundation.
Apache Software Foundation.
The trademarks of any contributor to this project may not be used in
association with the project without the contributor's express permission.
NOTE: OpenVDB is in the process of changing its license from [Mozilla Public License Version 2.0](https://www.mozilla.org/MPL/2.0/) to [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)! Please see the file RE-LICENSE_NOTE.txt for more details.
NOTE: OpenVDB has completed re-licensing from [Mozilla Public License Version 2.0](https://www.mozilla.org/MPL/2.0/) to [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). Please see the file RE-LICENSE_NOTE.txt for more details.
This repository contains the code for *f*VDB, a data structure for encoding and operating on *sparse voxel hierarchies* of features in PyTorch. A sparse voxel hierarchy is a coarse-to-fine hierarchy of sparse voxel grids such that every fine voxel is contained within some coarse voxel. The image below illustrates an example. *f*VDB supports using PyTorch Tensors to represent features at the corners and centers of voxels in a hierarchy and enables a number of differentiable operations on these Tensors (*e.g.* trilinear interpolation, convolution, splatting, ray tracing).
<figcaption style="text-align: center; font-style: italic;">An example of a sparse voxel hierarchy with 3 levels. Each fine voxel is contained within exactly one coarse voxel.</figcaption>
</p>
## Learning to Use *f*VDB
After [installing *f*VDB](#installing-fvdb), we recommend starting with our walk-through [notebooks](notebooks) which provide a gentle, illustrated introduction to the main concepts and operations in *f*VDB.
Once familiar with the basics, [Usage Examples](#usage-examples) introduces a few of the practical python scripts that can be further explored in the [examples](examples) directory.
Lastly, our [documentation](docs) provides deeper details on the concepts as well as an exhaustive set of illustrations of all the operations available in *f*VDB and an API reference. The [documentation can be built locally](#building-documentation) or can be accessed online at https://www.openvdb.org/documentation/fvdb/.
## Installing *f*VDB
During the project's initial development stages, it is necessary to [run the build steps](#building-fvdb-from-source) to install ƒVDB. Eventually, ƒVDB will be provided as a pre-built, installable package from anaconda. We support building the latest ƒVDB version for the following dependent library configurations:
| PyTorch | Python | CUDA |
| -------------- | ----------- | ------------ |
| 2.4.0-2.4.1 | 3.10 - 3.12 | 12.1 - 12.4 |
** Notes:**
* Linux is the only platform currently supported (Ubuntu >= 20.04 recommended).
* A CUDA-capable GPU with Ampere architecture or newer (i.e. compute capability >=8.0) is recommended to run the CUDA-accelerated operations in ƒVDB. A GPU with compute capabililty >=7.0 (Volta architecture) is the minimum requirement but some operations and data types are not supported.
## Building *f*VDB from Source
### Environment Management
ƒVDB is a Python library implemented as a C++ Pytorch extension. Of course you can build ƒVDB in whatever environment suits you, but we provide three paths to constructing reliable environments for building and running ƒVDB: using [docker](#setting-up-a-docker-container), [conda](#setting-up-a-conda-environment), or a Python virtual environment.
`conda` tends to be more flexible since reconfiguring toolchains and modules to suit your larger project can be dynamic, but at the same time this can be a more brittle experience compared to using a virtualized `docker` container. Using `conda` is generally recommended for development and testing, while using `docker` is recommended for CI/CD and deployment.
#### Setting up a Docker Container
Running a docker container is a great way to ensure that you have a consistent environment for building and running ƒVDB.
Our provided [`Dockerfile`](Dockerfile) constructs a Docker image which is ready to build ƒVDB. The docker image is configured to install miniforge and the `fvdb` conda environment with all the dependencies needed to build and run ƒVDB.
Building and starting the docker image is done by running the following command from the fvdb directory:
```shell
docker compose run --rm fvdb-dev
```
When you are ready to build ƒVDB, run the following command within the docker container. `TORCH_CUDA_ARCH_LIST` specifies which CUDA architectures to build for.
```shell
conda activate fvdb;
cd /openvdb/fvdb;
TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6+PTX"\
./build.sh install
```
Additional information about the ƒVDB docker setup, with troubleshooting for common errors, can be found
*f*VDB can be used with any Conda distribution installed on your system. Below is an installation guide using
[miniforge](https://github.com/conda-forge/miniforge). You can skip steps 1-3 if you already have a Conda installation.
1. Download and Run Install Script. Copy the command below to download and run the [miniforge install script](https://github.com/conda-forge/miniforge?tab=readme-ov-file#unix-like-platforms-macos--linux):
2. Follow the prompts to customize Conda and run the install. Note, we recommend saying yes to enable `conda-init`.
3. Start Conda. Open a new terminal window, which should now show Conda initialized to the `(base)` environment.
4. Create the `fvdb` conda environment. Run the following command from the directory containing this README:
```shell
conda env create -f env/dev_environment.yml
```
5. Activate the *f*VDB environment:
```shell
conda activate fvdb
```
##### Other available environments
*`fvdb_build`: Use `env/build_environment.yml` for a minimum set of dependencies needed just to build/package *f*VDB (note this environment won't have all the runtime dependencies needed to `import fvdb`).
*`fvdb_test`: Use `env/test_environment.yml` for a runtime environment which has only the packages required to run the unit tests after building ƒVDB. This is the environment used by the CI pipeline to run the tests after building ƒVDB in the `fvdb_build` environment.
*`fvdb_learn`: Use `env/learn_environment.yml` for additional runtime requirements and packages needed to run the [notebooks](notebooks) or [examples](examples) and view their visualizations.
#### Setting up a Python virtual environment
After creating a Python virtual environment, proceed to install the exact version of PyTorch that corresponds to your CUDA version. Then, install the rest of the build requirements.
**:warning: Note:** Compilation can be very memory-consuming. As part of our build script, we set the `CMAKE_BUILD_PARALLEL_LEVEL` environment variable to control compilation job parallelism with a value that we find works well for most machines (allowing for one job every 2.5GB of memory) but this can be overridden by setting the `CMAKE_BUILD_PARALLEL_LEVEL` environment variable to a different value.
You can either perform an install:
```shell
./build.sh
```
or if you would like to build a packaged wheel for installing in other environments, you can run the following command:
```shell
./build.sh wheel
```
### Running Tests
To make sure that everything works by running tests:
```shell
cd tests
pytest unit
```
### Building Documentation
To build the documentation, simply run:
```shell
python setup.py build_ext --inplace
sphinx-build -E -a docs/ build/sphinx
# View the docs
open build/sphinx/index.html
```
### Setting up Intellisense with clangd in Visual Studio Code
Please see the guide [`Clangd for Intellisense in fVDB`](docs/markdown/clangd.md)
## Usage Examples
The [examples](examples) directory contains a number of useful illustrations using the `fvdb` Python package. The sections below show some notable examples and their outputs. Run all commands from the directory containing this README.
### Trilinear sampling of grids
```
python examples/sample_trilinear.py
```
This script generates a grid with scalars at the corners of each voxel and samples this grid at points. The visualization below shows the points colored according to their sampled values as well as the values at grid corners.
<figcaption style="text-align: center; font-style: italic;">Splat the normals at the blue points into the center of each grid cell. The green arrows are the splatted normals</figcaption>
</p>
### Tracing voxels along rays (hierarchical DDA)
```
python examples/ray_voxel_marching.py
```
This script demonstrates finding the first `N` voxels which lie along a ray (returning thier index as well as their entry and exit points).
<p align="center">
<img src="docs/imgs/readme/rayvox.png" style="width: 70%;"alt="fVDB ray voxel marching">
<figcaption style="text-align: center; font-style: italic;">Find the voxels (yellow) which intersect the pink rays eminating from the green dot.</figcaption>
</p>
### Tracing contiguous segments along rays
```
python examples/ray_segment_marching.py
```
This script demonstrates finding the first `N` continuous segments of voxels which lie along a ray (returning thier index as well as their entry and exit points).
<p align="center">
<img src="docs/imgs/readme/rayseg.png" style="width: 70%;"alt="fVDB ray voxel marching">
<figcaption style="text-align: center; font-style: italic;">Find the contiguous segments of voxels (red and blue lines) which intersect the cyan rays eminating from the pink dot.</figcaption>
</p>
### Backpropagating through sampling and splatting
```
python examples/overfit_sdf.py
```
This scripts fits SDF values at a grid corner to the SDF of a mesh using gradient descent.
<figcaption style="text-align: center; font-style: italic;">SDF values at grid corners (colored dots) fitted using gradient descent to the SDF of a mesh.</figcaption>
</p>
The following scripts also show how to bakcprop through splatting and sampling with fVDB:
```
python scripts/debug_grad_trilerp.py
```
```
python scripts/debug_grad_splat.py
```
## Code Structure
The main source code for fVDB lives in the [src](src) directory. There are several important files here:
*`src/python/Bindings.cpp` exposes functionality directly to Python. It is mainly a wrapper around the core classes such as `fvdb::GridBatch` and `fvdb::JaggedTensor`.
*`src/GridBatch.h` contains the implementation of `fvdb::GridBatch` which is the core data structure on which fVDB is built. A `GridBatch` acts as a map between `(i, j, k)` integer coordinates and offsets in linear memory. This mapping can be used to perform a host of operations. The methods in this class are mostly lightweight wrappers around a set of CPU and CUDA *kernels*. The function prototypes for these kernels are defined in `src/detail/ops/Ops.h`.
*`src/detail/ops/Ops.h` contains the function prototypes for the main kernels used by fVDB. Host and device kernel implementations are provided in the `src/detail/ops/*.cu` source files.
*`src/detail/autograd` contains C++ implementations of PyTorch autograd functions for differentiable operations. `#include <detail/autograd/Autograd.h>` includes all of the functions in this directory.
*`src/detail/utils/nanovdb` contains a number of utilities which make it easier to use NanoVDB.
## References
Please consider citing this when using *f*VDB in a project. You can use the citation BibTeX:
```bibtex
@article{williams2024fvdb,
title={fVDB: A Deep-Learning Framework for Sparse, Large-Scale, and High-Performance Spatial Intelligence},
author={Williams, Francis and Huang, Jiahui and Swartz, Jonathan and Klar, Gergely and Thakkar, Vijay and Cong, Matthew and Ren, Xuanchi and Li, Ruilong and Fuji-Tsang, Clement and Fidler, Sanja and Sifakis, Eftychios and Museth, Ken},
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.