Manuscript Offprint

arXiv:2610.31630

Ray-by-Ray: Fine-Grained Resource Management for GPU Ray Tracing Units

Junrui Pan, Cesar Avalos Baddouh, Kai Ze Ee, Timothy G. Rogers

Junrui Pan

Purdue University

West Lafayette, IN, USA

pan251@purdue.edu

Cesar Avalos Baddouh

Purdue University

West Lafayette, IN, USA

cavalosb@purdue.edu

Kai Ze Ee

Purdue University

West Lafayette, IN, USA

ee@purdue.edu

Timothy G. Rogers

Purdue University

West Lafayette, IN, USA

timrogers@purdue.edu

Abstract—Ray tracing (RT) generates photorealistic images by simulating the physical behavior of light as it interacts with surfaces in a virtual scene. In film production and high-end rendering pipelines, this technique computes global illumination, reflections, refractions, and soft shadows by tracing millions of light rays per frame and accurately modeling their bounces and attenuation. Contemporary GPUs incorporate specialized ray tracing hardware to accelerate key operations in the traversal pipeline. By accelerating these stages in hardware, the unit enables real-time ray tracing for complex scenes that previously required offline computation. However, ray tracing introduces substantial control and data divergence. Each ray may traverse a different set of nodes in the acceleration structure, encounter distinct materials, or terminate at varying depths. This irregularity reduces thread coherence and exposes a fundamental disparity between the GPU SIMT and per-thread execution model of dedicated RT units, where each ray progresses independently.

In this work, we seek to validate assumptions made in open-source infrastructure and identify potential inefficiencies in resource management within the ray tracing pipeline. To address inefficiency caused by mismatches between SIMT and RT granularities, we propose Ray-by-Ray, which decomposes on-chip buffers into the granularity of individual rays and introduces lightweight management structures that enable more warps to run in parallel without increasing buffer capacity. This approach improves ray tracing unit utilization and increases memory-level parallelism. Experimental results show that Ray-by-Ray achieves an average performance improvement of 1.91x over the baseline, with an area overhead of 0.19%.

Index Terms—GPU, ray tracing, graphics rendering, SIMT efficiency

I. INTRODUCTION

Ray tracing (RT) is capable of rendering photorealistic images by physically simulating how light interacts with objects in a scene, producing accurate lighting effects such as reflections, refractions, soft shadows, and global illumination. Unlike rasterization, which approximates lighting using pre-computed or screen-space effects, ray tracing models the paths that light rays take as they travel, bounce, and scatter within a virtual environment. This physical accuracy has made ray tracing the foundation of production rendering pipelines [11], [13], [16], [20], where it is widely used to generate realistic imagery for visual effects and animation.

Recent advances in graphics processing unit (GPU) architecture have enabled real-time ray tracing by integrating dedicated hardware units that accelerate key operations in the traversal pipeline. By offloading these operations to specialized hardware, GPUs can now perform ray tracing in complex, dynamic scenes at interactive frame rates, tasks that previously required hours of offline computation. Even with hardware support for ray tracing operations, achieving real-time performance remains challenging. This is because ray tracing is highly divergent.

Figure

Fig. 1. Simulated RT occupancy and efficiency using Vulkan-Sim [35], [53]. Occupancy is the average ratio of warps resident in the RT unit to its maximum allowed warps; efficiency is the average ratio of threads active in the RT unit to its maximum thread capacity.

Contemporary GPUs [2], [6], [44] perform ray traversal by using a tree-like acceleration structure called a Bounding Volume Hierarchy (BVH). The BVH organizes scene geometry into a hierarchical tree, where each node represents a bounding volume that encloses its child nodes. If a ray misses a parent node, it misses all children, efficiently excluding large object groups from further intersection tests. To perform the traversal of these BVH trees in hardware, patents from NVIDIA [40] and state-of-the-art academic work [23], [53], [61] assume a single CISC instruction is issued from each warp to perform the traversal of all the 32 rays within the warp. GPUs follow a Single-Instruction, Multiple-Thread (SIMT) execution model, where a warp of 32 threads executes in lockstep. However, this model does not map well to BVH traversal [1], motivating the introduction of dedicated RT cores. All threads within a warp enter the RT core together, perform the traversal, and return as a group once the traversal has fully completed. Each ray traverses the scene independently and may intersect different objects. Some rays descend deeper into the BVH while others terminate early. This mismatch between warp-level management and thread-level behavior, where each ray progresses differently, creates control-flow divergence. As a result, rays that complete early are forced to wait for the longest-running rays within the same warp.

Fig. 1 shows that although overall RT unit occupancy is high, indicating that sufficient warps are available to keep the RT units busy, RT efficiency remains low. RT efficiency is defined as the fraction of threads actively performing traversal work. This low efficiency arises because rays follow different paths during traversal, and some terminate much earlier than others. The problem is particularly severe in path tracing workloads: when a ray hits an object, a new ray is launched from the hit point to simulate reflection. This process repeats until the ray terminates and invokes shading. The recursive nature of path tracing amplifies execution divergence and further degrades overall ray tracing efficiency.

To help reduce the effects of threads within a warp traversing different paths, NVIDIA introduced Shader Execution Reordering (SER) [46]. SER allows the GPU to dynamically regroup threads based on their execution state into new, coherent warps. However, this mechanism requires writing out the full execution context of each thread and later restoring it when the thread is reassigned to a different warp. This context save-and-restore operation introduces overhead, and the extra memory traffic and latency limit its effectiveness [45]–[47]. Because SER operates strictly as a post-traversal mechanism, it is incapable of resolving divergence during the active ray traversal phase.

While numerous academic works have analyzed and proposed improvements to dedicated ray tracing cores in state-of-the-art GPUs [9], [10], [24], [34], [61], none of these studies recognized the underlying inefficiency caused by warp-granular resource allocation. The assumption of all these prior works is that RT resources are allocated and deallocated at a warp granularity. To validate this assumption, we perform microbenchmarking on the RT core using the OptiX interface and a cycle-level analysis tool we developed. From this analysis, we observe that on-chip resources inside contemporary RT cores are allocated at warp granularity, causing substantial waste whenever lanes in a warp are inactive, which is a common scenario in ray tracing workloads. Unlike traditional SIMT code, ray traversal exhibits memory access patterns that gain little from coalescing; retaining warp-granular execution offers limited benefit. Moreover, our measurements show that the RT core operates as a relatively narrow pipeline, making it naturally amenable to sharing among threads from different warps rather than servicing an entire warp at once.

Building on the insights from our study, we propose decomposing each ray buffer group into finer-grained ray buffers paired with lightweight hardware for dynamic warp-to-thread mapping. Our guiding principle is to exploit divergence rather than eliminate it. To achieve this, we decouple software-visible SIMT divergence from hardware-level execution divergence. At the software level, we leave the standard control-flow divergence untouched: the programming model still sees the original active-lane mask carried by a warp, and a ray strictly returns to its original lane and warp once traversal completes. Instead, our design targets the internal hardware divergence that occurs inside the RT unit. This under-utilization arises because the unit traditionally manages buffers and traversal stacks at a warp granularity, even though ray traversal is inherently a thread-level operation. By dynamically reordering active rays onto available RT-unit resources, our hardware turns this internal divergence into reclaimable capacity rather than wasted occupancy. We can isolate this optimization because the entire traversal process is encapsulated within a single complex instruction, which bounds the divergence phase and creates a clean architectural boundary. Consequently, we can manage divergent execution entirely in hardware without the extensive overheads of general-purpose dynamic warp formation, which recomposes threads into entirely new warps [17], [18]. Ultimately, this allows more rays to traverse concurrently. Because ray traversal is heavily memory-latency bound, this increased memory-level parallelism successfully hides memory latency.

In summary, we make the following contributions:

  • We propose Ray-by-Ray, a lightweight, fine-grained per-ray resource management mechanism within the ray tracing unit to better utilize on-chip resources, enabling higher ray parallelism to hide memory latency. Across a wide range of workloads, this design achieves an average speedup of 1.91×1.91 \times with an area overhead of 0.19%.

  • We observe that ray traversal exhibits irregular memory access patterns that cannot benefit from traditional GPU memory coalescing mechanisms. We exploit this insight by dynamically regrouping rays into new coherent groups during hardware traversal.

  • We present the first detailed microarchitectural characterization of NVIDIA RTX 5090 ray tracing cores, which suggests that RT core resources may be allocated at the warp granularity, shows that shared memory is highly active during traversal, and that the pipeline width inside the RT core is less wide than the SIMT pipeline. We leverage these insights to inform our design of Ray-by-Ray.

References (66)