Writing Ray Tracing Applications in Python Using the Numba Extension for PyOptiX

Originally published at: https://developer.nvidia.com/blog/writing-ray-tracing-apps-in-python-using-numba-for-pyoptix/

Using Numba and PyOptiX, NVIIDA enables you to configure ray tracing pipeline and write kernels in Python compatible with the OptiX pipeline.

Thank you for reading the post! The example outlined in this blog post was adapted from the triangle example in the OptiX package. Several modifications was made to the kernel code to address the differences in python and CUDA C++. The extension currently have several hard coded constraints on some of the API calls, such as the number of payload registers for optix.Trace. While it’s trivial to expand the lowering of these methods to support more overloads, I’m exploring a more programmatic way to provide a full support to all APIs available in optix kernel. In general, this work is in active development and I’d love to hear from you while you are playing with the demo repository.

I have a few higher level questions, my background is previously using CUDA for doing ray tracing based simulations for medical imaging and computed tomography projections.

Does OptiX lend itself to these applications? Typically summing a path integral as a trilinear interpolation through a voxellized space.

Any idea what kind of performance difference with this and a CUDA implementation?

To what numerical precision does OptiX support (float or double)?