Git Product home page Git Product logo

Comments (4)

pablode avatar pablode commented on July 22, 2024 1

Hello! Contrary to what one might expect, the switch to a Vulkan AS was actually made in an effort to reduce shader and pipeline compilation times.

In the compute-CWBVH based approach, generated shaders could have 100k+ lines of code and subsequentially, the compute pipeline creation in the driver would take not seconds, but 2 minutes or more.

By switching to an RT pipeline, I can use the shader binding table and callable shaders in order to compile shaders independently from each other and break up the complexity of the pipeline. However, I'm not there yet. I currently only have transitioned the acceleration structure and use it with Ray Queries inside a CS.

I did some ad-hoc testing and observed a performance gain on the RTX 2060 Ti, but it was not large (e.g. 16ms->14ms and 33->31ms). The speedup is probably much larger for an RTX 4090 and future generations.

from gatling.

pablode avatar pablode commented on July 22, 2024 1

I presume it was competitive because the RTX 2060 is a bottom-of-the-line RTX GPU and there's latency hiding going on due to material evaluation (in this case UsdPreviewSurface shading code generated by MaterialX).

Yes, high compilation times are a byproduct of the megakernel design, and yes, I suppose a wavefront design would be the only other solution to this problem. However, one would have to submit one shader dispatch per material per iteration, which could result in reduced occupancy (persistent threading requires a megakernel again). I believe that compilation times due to increasing shading complexity, and the recent introduction of Shader Execution Reordering to ray tracing pipelines are going to make wavefront designs increasingly obsolete.

When it comes to MaterialX, both OSL and MDL code generation backends are agnostic to the renderer architecture. It's up to you to stitch the shaders together.

from gatling.

ib00 avatar ib00 commented on July 22, 2024

Thanks for your explanation.

It's interesting that your BVH traversal was competitive. I presume that the main
reason for slight advantage is that Vulkan is using RTX acceleration units
while your compute shaders were not able to due to limitation in GLSL.

So, slow compilation times are result of a megakernel design? Namely,
would the problem be alleviated if you chose a wavefront design?
This also means that MaterialX would have to be done in a different
manner.

from gatling.

ib00 avatar ib00 commented on July 22, 2024

Thanks!

This reordering looks cool. It'll be interesting to see if it simplifies design or it
further complicates it. GPU path tracers code are already hard to read
and implementing more complex algorithms is pretty ugly.

from gatling.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.