4

Is there any way to directly use hardware accelerated ray triangle intersection in CUDA without using OptiX? This is analogous to how it is possible to use tensor cores directly in CUDA for small matrix multiplication, see the Programmatic Access to Tensor Cores in CUDA 9.0 section of https://developer.nvidia.com/blog/programming-tensor-cores-cuda-9/. It seems like this should at least be possible in an unsupported way using inline PTX (maybe via some reverse engineering of OptiX binaries).

More generally, are any subcomponents of OptiX usable without using the full pipeline? Like can OptiX just be used to generate an acceleration data structure which is used separately? Or can RT cores be used to traverse a custom BVH not generated by Optix from within device code?

talonmies
  • 70,661
  • 34
  • 192
  • 269

1 Answers1

1

As of this writing, there isn't any PTX or CUDA mechanism for accessing the RT cores. That doesn't mean it can't change in the future, but this is where it stands today. Part of the reason is because an RT core query is not a simple, finite, self-contained operation like a matrix multiply is. Direct access to RT cores might be more complicated than what you imagine, which is part of why OptiX / DXR / VKR wrap these queries with an API that simplifies the interaction.

OptiX can generate an acceleration structure outside of a full pipeline, but because the format is proprietary (and changing frequently) it can't really be used or traversed outside of one of the ray tracing APIs. A BVH can be moved ("relocated") to the host or another device, but requires some patching on the destination device before it can be traversed. And it's pretty common for the cost of the data transfer to exceed the cost of a full BVH rebuild, so doesn't normally help anything to create a BVH anywhere other than the device it will be used on.

The OptiX denoiser can also be used outside of a full pipeline. Aside from those, the pipeline is necessary for shader program compilation, so once you want to trace any rays, you need a pipeline.

David
  • 688
  • 7
  • 13