Table of Contents
Fetching ...

Exploiting ray tracing technology through OptiX to compute particle interactions with cutoff in a 3D environment on GPU

Algis David, Bérenger Bramas

TL;DR

This work investigates using GPU ray tracing, via OptiX, to compute short-range particle interactions with a cutoff in 3D space, aiming to bypass grids or kd-trees. It introduces three geometric representations—Spherical, Double Squares, and Custom AABB—to cast rays and detect neighbor particles within a cutoff, computing interactions only for those within distance $C$. The study compares these OptiX-based approaches against a classical CUDA grid method across uniform and non-uniform distributions on two GPUs, showing that Custom AABB and triangle-based OptiX methods can outperform in sparse scenarios and that hardware and IS optimizations will increasingly determine practical effectiveness. The findings suggest that ray-tracing-based neighbor search, augmented by tailored IS and geometric strategies, holds promise for future high-performance simulations as GPU architectures evolve. The work provides a foundation for further refinement and broader hardware testing, with potential applicability to large-scale particle-based simulations as RT-core capabilities mature, and includes concrete algorithms for converting particle positions to geometric primitives and for generating particles on a sphere.

Abstract

Computing on graphics processing units (GPUs) has become standard in scientific computing, allowing for incredible performance gains over classical CPUs for many computational methods. As GPUs were originally designed for 3D rendering, they still have several features for that purpose that are not used in scientific computing. Among them, ray tracing is a powerful technology used to render 3D scenes. In this paper, we propose exploiting ray tracing technology to compute particle interactions with a cutoff distance in a 3D environment. We describe algorithmic tricks and geometric patterns to find the interaction lists for each particle. This approach allows us to compute interactions with quasi-linear complexity in the number of particles without building a grid of cells or an explicit kd-tree. We compare the performance of our approach with a classical approach based on a grid of cells and show that, currently, ours is slower in most cases but could pave the way for future methods.

Exploiting ray tracing technology through OptiX to compute particle interactions with cutoff in a 3D environment on GPU

TL;DR

This work investigates using GPU ray tracing, via OptiX, to compute short-range particle interactions with a cutoff in 3D space, aiming to bypass grids or kd-trees. It introduces three geometric representations—Spherical, Double Squares, and Custom AABB—to cast rays and detect neighbor particles within a cutoff, computing interactions only for those within distance . The study compares these OptiX-based approaches against a classical CUDA grid method across uniform and non-uniform distributions on two GPUs, showing that Custom AABB and triangle-based OptiX methods can outperform in sparse scenarios and that hardware and IS optimizations will increasingly determine practical effectiveness. The findings suggest that ray-tracing-based neighbor search, augmented by tailored IS and geometric strategies, holds promise for future high-performance simulations as GPU architectures evolve. The work provides a foundation for further refinement and broader hardware testing, with potential applicability to large-scale particle-based simulations as RT-core capabilities mature, and includes concrete algorithms for converting particle positions to geometric primitives and for generating particles on a sphere.

Abstract

Computing on graphics processing units (GPUs) has become standard in scientific computing, allowing for incredible performance gains over classical CPUs for many computational methods. As GPUs were originally designed for 3D rendering, they still have several features for that purpose that are not used in scientific computing. Among them, ray tracing is a powerful technology used to render 3D scenes. In this paper, we propose exploiting ray tracing technology to compute particle interactions with a cutoff distance in a 3D environment. We describe algorithmic tricks and geometric patterns to find the interaction lists for each particle. This approach allows us to compute interactions with quasi-linear complexity in the number of particles without building a grid of cells or an explicit kd-tree. We compare the performance of our approach with a classical approach based on a grid of cells and show that, currently, ours is slower in most cases but could pave the way for future methods.
Paper Structure (35 sections, 2 theorems, 13 equations, 13 figures, 2 algorithms)

This paper contains 35 sections, 2 theorems, 13 equations, 13 figures, 2 algorithms.

Key Result

Lemma 1

Given a circle $\mathcal{C}$ and let $e_x$ and $e_y$ be the two segments of the cross of length less than $r$, then the number of intersections of $\mathcal{C}$ with $e_x$ or with $e_y$ is strictly less than $2$.

Figures (13)

  • Figure 1: Schematic view of BVH tree creation. The OptiX library requires a list of encompassing axis-aligned bounding boxes (AABBs), which can either be directly provided or generated from a list of basic primitives.
  • Figure 2: Schematic view of the OptiX ray tracing workflow. The user casts rays in the desired direction, and OptiX manages the BVH tree traversal and potential interactions. When a ray enters an enclosing bounding box (AABB), a callback function is invoked to determine whether the ray actually intersects the corresponding primitive, based on a built-in or user-defined Intersection Shader (IS), referred to as the intersection strategy. For custom primitives, the user must implement the IS. If the ray does not intersect or is marked to continue, the process is repeated for other primitives. The traversal stops when a final intersection is found or no more primitives can be intersected, triggering a call to the miss callback.
  • Figure 3: 3D Spherical representation of a source and target particles distance from $C=1$. The source sphere has a radius of $\frac{\sqrt{2}}{\sqrt{3}}$ and the rays, represented by segments, are of length $\frac{1}{\sqrt{3}}$ in each direction. In this case, the sphere could englobe the rays.
  • Figure 4: 2D Spherical representation of the particles in three different cases. In the first one (left), we what will be the positioned of the farthest source particle and how it will be detected by the ray. In the second one (center), we show the case where the source particle is the farthest from the rays (it also shows that in 2D the sphere radius could be smaller). In the last one (right), we show different source particles with their spheres and the rays that will intersect with them.
  • Figure 5: Double squares (line) representation of the particles. On the left, we show how the squares can overlap for particles that are too far, but which can be easily filtered with the distance. In the middle, we show how particles that have the same $x$ coordinate can have their squares that overlap. On the right, we show different source particles with their squares and the rays that will intersect with them.
  • ...and 8 more figures

Theorems & Definitions (2)

  • Lemma 1
  • Lemma 2