Coder Social home page Coder Social logo

cuda-tree's Introduction

CUDA based Tree builder (QuadTree, Octree)

Octree QuadTree
Octree QuadTree
Octree

Functionality

  • CUDA tree builder
  • CPU kNN, Radius Search
  • 2d, 3d visualization (controls: WSAD R F, Mouse). Additional functionality for QuadTree - click on a Tree for kNN and RadiusSearch
  • Random Points Generator
  • Configuration file
  • An obj file loader

Some implementation details: Medium


Build and Run

* mkdir build && cd build
* cmake .. `[-DCUDA_ARCH=SET_YOUR_ARCH]`
* make -j8
* `./cuda_tree_app_TYPE ./app/config/AppConfig.json`
* memory check: `compute-sanitizer --tool memcheck  ./cuda_tree_app_TYPE ./app/config/AppConfig.json`
  • cuda_tree_app_TYPE:
    • cuda_tree_app_rng - to use random points
    • cuda_tree_app_obj - to read .obj file from model_path (only vertices)

Config

  • AppConfig.json - contains general information (points count, pathes to Tree and Render config files)
  • TreeConfig.json:
    • type - 'Quad' or 'Oct'
    • size - width, height, depth (if Octree)
    • threadsPerBlock - min 128 for QuadTree and 256 for Octree (1 warp for each leaf)
  • RenderConfig.json - all about rendering

Requirements

  • CUDA 11.8+
  • C++ 17+
  • OpenGL, GLFW
  • nlohmann, tinyobjloader (included)

Limitations

  • Tested on up to 150 mln points
  • Max stable depth: QuadTree = 7, Octree = 6
  • I recommend to disable rendering (AppConfig.json) if more than 50 mln points are used

Further development

  1. CUDA based kNN, Radius Search
  2. Refactoring, CPU, GPU optimization
  3. OpenGL interop for faster visualization
  4. Raycasting
  5. KDTree

Disclaimer

  • Tested on Linux: Ubuntu 22.02, CUDA: 12.2, GPU: 3060 (laptop)
  • Approach based on Nvidia's QuadTree sample (cdpQuadtree)

cuda-tree's People

Contributors

fatlipp avatar

Stargazers

hhhhhhhhhhhhh avatar  avatar Weidong Liu avatar

Watchers

 avatar

Forkers

dunyazad

cuda-tree's Issues

getLastCudaError() CUDA error : KernelError : (500) named symbol not found.

Hello,

epic library, thanks for providing such a great resource.

Am trying to run the code, and run into this error:

/tmp/cuda-tree/cmake-build-debug/app/cuda_tree_app_obj /tmp/cuda-tree/app/config/AppConfig.json
Load Model()
WARN: Material file [ 12140_Skull_v3_L2.mtl ] not found.
Failed to load material file(s). Use default material.

# of vertices  = 40062
# of normals   = 40062
# of texcoords = 42682
# of shapes    = 4
bmin = -15.487700, 0.050200, -9.920400
bmax = 13.964300, 27.575899, 9.919900
RunAppOctree(): 240048
Initialize() capacity: 240048
 duration: 0
Reset()
Build()
/tmp/cuda-tree/lib/core/octree/OctreeBuilderCuda.cu(57) : getLastCudaError() CUDA error : KernelError : (500) named symbol not found.

Process finished with exit code 1

I noticed #include <thirdparty/tinyobjloader/tiny_obj_loader.h> was missing so am using this version https://github.com/tinyobjloader/tinyobjloader/releases/tag/v2.0-rc1

Any ideas?

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.