Hi OptiX team,
I’m revisiting a long standing performance discrepancy/question that I have been encountering in my renderer, ChameleonRT: GitHub - Twinklebear/ChameleonRT: An example path tracer that runs on multiple ray tracing backends (Embree/DXR/OptiX/Vulkan/Metal/OSPRay) . ChameleonRT is a small path tracer with as identical as possible rendering backends written in each API (Vulkan, DXR, OptiX, Embree, Metal). What I observe is that, in the path tracer version of the code, OptiX is quite noticeably slower than the Vulkan and DXR. For example in an untextured path tracing rendering of Sponza with a single hard-coded light I observe the following performance (all measured using device-side timers):
- OptiX: 8.037 ms/frame
- Vulkan: 1.661 ms/frame
- DXR: 2.733 ms/frame
Screenshots of each are shown below:
OptiX
Vulkan
DXR
When I run these through NSight Compute/Graphics accordingly, I find that the OptiX backend has significantly more VRAM/Memory (and L1/L2) traffic and lower SM utilization compared to Vulkan/DXR.
OptiX Utilization
- SM: 29.49%
- Memory: 70.13% (this is VRAM)
- L1: 32.75%
- L2: 47.74%
Vulkan Utilization
- L2: 59%
- SM: 34.8%
- L1: 13.5%
- VRAM: 10.3%
DXR Utilization
- SM: 47.9%
- L2: 36%
- L1: 15.5%
- VRAM: 7.6%
What I’ve also found is that if I write simpler renderers, e.g., primary rays w/ barycentrics shading, or a basic primary hit + AO ray renderer, I don’t see this performance difference. So it seems like there is some difference in how the larger path tracer kernel and BRDF code gets compiled on OptiX vs. Vulkan/DXR, or some other issue that is not clear to me. So I wanted to see if anything stood out here in the code as being wrong, I did also see Wenzel Jakob’s post mentioning that the Luisa renderer has seen similar issues: Ray tracing performance in OptiX vs DirectX in their paper.
The code for each backend is online:
And releases with all backends built for each platform (as supported by the platform) can be downloaded from the latest release: Release 0.0.10 · Twinklebear/ChameleonRT · GitHub . The barycentrics and AO versions of the renderers can also be downloaded: Release 0.0.8 OptiX + Vulkan Barycentrics & AO · Twinklebear/ChameleonRT · GitHub and code seen on the git tag: GitHub - Twinklebear/ChameleonRT at 0.0.8-optix-vk-bary-ao
Thanks for your time! I realize asking to dig into the code is a lot, but I’ve been stumped on this issue for some time, and hopefully the code is small enough for a brief look through. Or if there are some known issues and this is expected, that’d be good to know as well.