Comments (4)
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.
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.
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.
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)
- Compile errors on Linux HOT 2
- Running problems on the Mac platform HOT 3
- Arch Linux Build HOT 10
- Broken SPIRV-Reflect sub module HOT 1
- Compile error due to case sensitive on Linux HOT 1
- Question: Two-level BVH HOT 1
- License for cgpu? HOT 3
- Could you, please, share usd scene with Ford Mustang? HOT 3
- Can you share a simplest test scene? even a box HOT 6
- About the assets in the usd-assets repository HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatling.