Megakernel vs Wavefront GPU Path Tracing

Rafael Padilla, Kyle Webster, Austin H Kim · 2026

Read Megakernel vs Wavefront GPU Path Tracing by Rafael Padilla, Kyle Webster, Austin H Kim (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-27323.txt.

Introduction

Rafael Padilla, Kyle Webster, and Austin Kim compare two GPU path tracing designs: the megakernel approach and the wavefront approach. The wavefront design, which keeps state between specialized kernel calls, runs about 16 percent faster in their tests. Tracing data point to better cache locality, though no unit reaches peak throughput, so memory delay and synchronization still limit speed.

Catalog record

CREATORRafael Padilla, Kyle Webster, Austin H Kim
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE18093
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.27323

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Megakernel vs Wavefront GPU Path Tracing Rafael Padilla, Kyle Webster, Austin H Kim Abstract . Over the last decade, advances in GPU hardware have been driven in large part by the demands of real-time graphics, culminating in dedicated hardware ray tracing cores (RT cores). These units accelerate ray-scene intersection queries directly in hardware, making physically based ray tracing algorithms increasingly practical for interactive applications. This paper compares and analyzes the performance of two ray-based rendering algorithms: forward path tracing (PT) and wavefront path tracing (WPT). GPU-based PT computes the color of each pixel by having each thread trace a single path to completion, naturally leading to a megakernel approach – while WPT maintains state buffers between specialized kernel invocations to trace path stages simultaneously. We find that WPT affords a ~16% speedup over PT in our implementation. By analyzing traces from NVIDIA Nsight Graphics, we attributed this speedup to WPT’s improved cache locality compared to PT. We also find that our implementation does not achieve maximum GPU throughput across any of its units, suggesting that communication and memory latency, as well as synchronization, are the limiting factors. Finally, we address potential algorithmic improvements and future work for real-time path tracing implementation for practical applications. Figure 1. Sample real-time generated images using our GPU hardware accelerated renderer. 1. Introduction Path tracing maps naturally onto massively parallel GPU hardware, yet efficient implementation remains challenging due to the irregular nature of light transport. As paths encounter different materials, bounce depths, visibility events, and termination conditions, threads within a warp can quickly diverge, reducing SIMD efficiency and often degrading memory locality. These issues become increasingly important on modern GPU architectures, where performance is frequently limited not only by arithmetic throughput, but also by latency hiding, cache behavior, and scheduling efficiency. Wavefront path tracing ( 3 ) has emerged as an alternative formulation that addresses these issues by restructuring path tracing into coherent stages, grouping similar work into specialized kernels rather than tracing each path to completion independently. This approach has long been discussed in offline rendering and has become increasingly relevant for modern GPU-based rendering, yet its practical tradeoffs relative to simpler megakernel formulations remain dependent on architecture, implementation details, and workload characteristics. This motivates a direct study of how these approaches differ in practice. In this paper, we implement both forward megakernel path tracing and wavefront path tracing within a shared Vulkan-based renderer and analyze their performance behavior on modern GPU hardware. Beyond comparing frame performance, we use NVIDIA Nsight Graphics to study hardware throughput, cache activity, and execution behavior to better understand the sources of observed differences. We further discuss how these tradeoffs relate to real-time versus offline rendering workloads, scene complexity, and broader considerations in GPU path tracing architecture design. 2. Background There are many methods for synthesizing digital imagery, ranging from digital sketching and painting tools to light transport integrators on physically-based simulated scenes. Our renderer falls closer to the latter category. In this section we introduce the light transport equation, Monte Carlo integration, and the two algorithms we implement on the GPU that solve the rendering equation. 2.1. Light Transport Equation Rendering can be formulated as a recursive integral equation that describes the transport of radiance between surfaces. That is, the Light Transport Equation ( 2 ) : (1) L(x,\omega_{o})=L_{e}(x,\omega_{o})+\int_{S^{2}}L_{i}(x,\omega_{i})f(x,\omega_{o},\omega_{i})|n\cdot\omega_{i}|\mathrm{d}\omega_{i} where L is the radiance in direction \omega_{o} at position x , L_{e} is the emitted radiance, L_{i} is the incident radiance, f is a bidirectional scattering distribution function (BSDF), n is the surface normal at point x and the integral is over the sphere of directions \omega_{i} at point x . This formulation of light transport lends itself to being solved by Monte Carlo Integrators . A Monte Carlo Integrator provides an estimate of an integral by drawing samples from a distribution and evaluating the integrated function on those samples. The general form can be expressed as (2) \hat{I}=\frac{1}{N}\sum_{i=1}^{N}\frac{f(X_{i})}{p(X_{i})}\approx\int_{\Omega}f(x)\mathrm{d}x Such an integrator is unbiased if the support of p(x) covers the support of f(x) – that is, the estimate will converge to the analytic value given enough samples if the generates samples can take any value which produce nonzero f . Both of the rendering algorithms that we implement are formulated as Monte Carlo Integrators. 2.2. Forward Path Tracing The forward path tracing algorithm incrementally generates and evaluates paths from an initial camera ray – accumulating the radiance traveling along that path to the camera and updating the throughput from scattering at each surface. The Monte Carlo integrator appears as (3) \hat{L}(\mathbf{x}_{n})=\frac{L_{0\to 1}T(\mathbf{x}_{n})}{p(\mathbf{x}_{n})},\quad T(\mathbf{x}_{n})=\prod_{j=1}^{N-1}f(x_{j},\omega_{o,j},\omega_{i,j})|n_{j}\cdot\omega_{i,j}| where \mathbf{x}_{n} is a path of n+1 vertices \{x_{0},\cdots,x_{n}\} with x_{0} on a light source, p(\mathbf{x}_{n}) is the probability of generating path \mathbf{x}_{n} , and T(\mathbf{x}_{n}) is the path throughput ( 4 ) . The steps for performing forward path tracing are as follows: (1) Generate initial ray from camera (2) Extend path by intersecting scene in current direction \omega to find scattering point x (3) Accumulate radiance along path (4) Sample new direction \omega to extend path with, and update path throughput (5) Repeat steps 2 through 4 until maximum path length is reached The megakernel implementation does the above steps from a single kernel dispatch, running one thread per pixel. In contrast, the wavefront implementation takes a batched approach. 2.3. Wavefront Path Tracing Wavefront Path Tracing (WPT) decouples the path tracing pipeline into four sequential GPU compute stages: ray generation, scene intersection, material shading, and radiance accumulation. These are dispatched from the host application per bounce iteration. The ray generation stage initializes per-pixel ray state and samples primary ray directions through the camera projection model. Ray origins within each pixel are jittered using a Halton low-discrepancy sequence with bases 2 and 3, augmented with per-pixel Cranley-Patterson rotation to decorrelate spatially adjacent pixels, producing a well-distributed sample sequence across both pixels and frames that reduces visible noise at low sample counts compared to pseudorandom jitter. The scene intersection stage traces each active ray against the scene’s top-level acceleration structure (TLAS) using Vulkan inline ray queries, writing hit records to persistent per-pixel global buffers. The material shading stage then reconstructs full surface geometry from these stored records, evaluating interpolated normals, tangents, and texture coordinates without re-tracing the ray and evaluates the OpenPBR layered BSDF. Finally, the accumulation stage blends each completed path sample into a persistent buffer via a progressive running average, followed by tonemapping for display output. Between all stages, explicit Vulkan pipeline barriers ensure that buffer writes produced by each kernel are fully visible to the next before execution proceeds. 3. Implementation Our renderer is implemented as a Vulkan-based GPU path tracer using compute shaders and hardware ray tracing via inline ray queries. Scene data, including geometry, transforms, materials, and acceleration structure handles, are packed on the CPU into GPU-friendly buffers and uploaded to the device. We use BLAS/TLAS acceleration structures to support efficient ray-scene intersection, while shading and light transport are evaluated in Slang shaders using a physically based path tracing integrator. Material response is modeled using Adobe OpenPBR, and assets are imported through Assimp, with scenes authored and tested in Blender. We implemented and compared two integrators within the same framework. In the forward path tracer, each GPU thread traces

Read the complete text