Adding a backend for cuBQL as a RayTracer - #245
Open
Waqar-ukaea wants to merge 21 commits into
Open
Conversation
Waqar-ukaea
marked this pull request as ready for review
June 25, 2026 12:16
Waqar-ukaea
force-pushed
the
cuBQL-backend
branch
from
July 21, 2026 12:15
8576a9f to
771984d
Compare
- New CuBQLRayTracer class with working create_surface_tree and basic ray queries - Updated plucker_ray_tri intersect to play nice with openmp target offload regions - Implemented new structs for cuBQL BVH objects with XDG data - Implemented mixed precision BVH traversal algorithm for cuBQL - Updated appropriate constants with new cuBQL specifics - Ensured cuBQL properly wired through to xdg public API
…ueries at runtime in xdg
…tadata - Boundary condition metadata now stored on surface instances - Next volume topology also stored on surface instances - Primitive normal stored on hits to be used in reflective BCs - Updated rayhit structs throughout to carry this new data
- Replace the two-level BLAS/TLAS scheme with single-level traversal - Introduce CuBQLSurfaceMesh and CuBQLVolumeGroup following DPRT terminology - Build flattened primitive references and AABBs in create_surface_tree - Update scalar and batch intersection paths for flattened traversal
Waqar-ukaea
force-pushed
the
cuBQL-backend
branch
from
July 31, 2026 16:16
5ae4ca0 to
e0a4bdf
Compare
Collaborator
Author
|
Tests now in place and rebased to latest version of main (after Quads+Hex PR) |
Collaborator
Author
|
I am unable to update the submodule commit to the latest version for cuBQL due to this issue NVIDIA/cuBQL#43 Another larger problem seemingly exists that is stopping openmp traversal of BVHs being as robust as it should be with subsequent builds occasionally having "bad regions" of the BVH in which ray hits are lost. No issue has been opened for that as of yet as I am still figuring out what the exact cause of that is. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds initial support for NVIDIA's cuBQL, a CUDA BVH build-and-query library, as an optional XDG ray tracing backend. The current integration targets cuBQL's OpenMP target-offload path so XDG can build BVHs and run traversal/intersection kernels on an OpenMP target device.
This is still an initial backend implementation. Some OpenMP target allocation, copy, and free handling is intentionally explicit and is expected to be cleaned up in follow-up work.
Build-system and dependency changes
vendor/cuBQL.XDG_ENABLE_CUBQLas an optional CMake backend switch.CMakePresets.jsonentries for LLVM and NVHPC OpenMP target-offload builds on NVIDIA Ada hardware.XDG backend integration
RTLibrary::CUBQLand wires it through the standard XDG backend creation paths.CuBQLRayTracerimplementation.XDGRayHitXDGRayHitBufferallocate_ray_hits()free_ray_hits()ray_fire_batch()cuBQL backend implementation
The backend currently supports surface-based ray queries using a flattened per-volume BVH layout.
CuBQLSurfaceMeshowns device buffers for a topological surface's vertices, triangle indices, and primitive IDs.CuBQLVolumeGroupowns one flattened cuBQL BVH per topological volume.CuBQLVolumeGroup::PrimRef.ray_fire()point_in_volume()ray_fire_batch()runs on device-residentXDGRayHitarrays and writes hit/crossing payload data back into the same records:Shared geometry/intersection changes
dp_mathpathway so the shared Plücker intersection code can compile in OpenMP target code using cuBQL math types.EXIT_EARLYPlücker result object in favour of direct{false, 0.0}returns, which avoids OpenMP device compilation issues.Tests and tools
MeshMock,ray_fireandparticle_simtools soCUBQLcan be selected.ray_benchmarkwith a cuBQL path using device-side ray generation andray_fire_batch().Current limitations
find_element(),closest(), andoccluded()are not implemented for cuBQL.last_hit_primitive; arbitrary exclusion histories are only supported by scalar queries.Submodule note
cuBQL is included as a git submodule. This PR currently pins cuBQL to
5a651b3, which is the working version for this implementation. A later cuBQL commit was tried but caused XDG ray tracing query tests to fail, so updating the submodule further should be handled separately after investigating the cuBQL-side change.