Hi all,
I just wonder which engines uses OptiX intersection acceleration?
I've made a couple of breakpoints in OptiX initialization code (optixaccel and optixaccelhw) and it stops only for OpenCl engines. Do CPU engines using OptiX intersection?
The other question: how OpenCl code and OptiX are working together? I have no experience with OpenCl, i've used only CUDA, so I would be grateful for an explanation.
Thanks in advance!
OptiX intersection
Re: OptiX intersection
PATHOCL and TILEPATHOCL when using a LuxRays CUDA hardware device (https://github.com/LuxCoreRender/LuxCor ... hw.cpp#L52)
We had OpenCL only support before. I have than added an abstraction layer under the name of generic LuxRays hardware device so the CPU code was able to use OpenCL or CUDA devices. I have also modified the GPU kernel code to be just generic C so it was possible to compile the same sources both with OpenCL and CUDA.
This made possible to run thousand of lines of existing code both with OpenCL or CUDA.
However I have not updated the terminology used (for compatibility with the past): PATHOCL has still the same name but it works with CUDA (and Optix) too. Now everywhere you see "OpenCL", it means OpenCL or CUDA. Outside LuxRays hardware device code where real OpenCL or CUDA API are used:
https://github.com/LuxCoreRender/LuxCor ... e.cpp#L106
https://github.com/LuxCoreRender/LuxCor ... e.cpp#L148
LuxCore auto-detect OpenCL, CUDA and Optix and uses the best combination available by default.
Nope. We use Intel Embree: https://github.com/LuxCoreRender/LuxCor ... eaccel.cpp
Re: OptiX intersection
Wow, thanks for the clear explanation!
I just wonder how do you combine rays emission/intersection/shading/shadowing on GPU side? Is it something like Wavefront Path Tracing used in PBRT (https://research.nvidia.com/sites/defau ... _paper.pdf) or Megakernel approach?
In the case of Megakernel how do you plug OptiX intersection call into it? Do you use OptiX only for intersection calculations?
Thanks for answering!
I just wonder how do you combine rays emission/intersection/shading/shadowing on GPU side? Is it something like Wavefront Path Tracing used in PBRT (https://research.nvidia.com/sites/defau ... _paper.pdf) or Megakernel approach?
In the case of Megakernel how do you plug OptiX intersection call into it? Do you use OptiX only for intersection calculations?
Thanks for answering!
Re: OptiX intersection
Each GPU thread is a state machine iterating over various states (https://github.com/LuxCoreRender/LuxCor ... pes.cl#L42).chuchur wrote: ↑Wed Jun 23, 2021 9:32 am I just wonder how do you combine rays emission/intersection/shading/shadowing on GPU side? Is it something like Wavefront Path Tracing used in PBRT (https://research.nvidia.com/sites/defau ... _paper.pdf) or Megakernel approach?
I run, in a loop, a set of kernels executing each machine state:
https://github.com/LuxCoreRender/LuxCor ... d.cpp#L183
https://github.com/LuxCoreRender/LuxCor ... s.cpp#L514
Indeed, the state machine compute a sample with path tracing and add it to the film.
I developed this solution on my own and improved it in 2014 with micro-kernels: https://twitter.com/Dade916/status/528214623993212930
Yes, you can call it "Wavefront Path Tracing". The principle is the same but I think I developed it before the paper was published.
Yes, one of the state is just "trace rays", it takes an array of rays and returns an array of ray hits: https://github.com/LuxCoreRender/LuxCor ... ixaccel.cl
This is simply the perfect scenario for Optix and GPUs. You are not going to find something that can trace rays faster.
P.S. Mega-kernels are rubbish, dinosaurs.
Re: OptiX intersection
Hey Dade, thank you for the explanation.
I hope, I could help a bit with luxcorerender development (I've done something like an illuminance sensor for old good lux render, but never try to push it into the repository). I'll put my note into "LuxCoreRender Project wants you!" topic
I hope, I could help a bit with luxcorerender development (I've done something like an illuminance sensor for old good lux render, but never try to push it into the repository). I'll put my note into "LuxCoreRender Project wants you!" topic
Re: OptiX intersection
Sure, you are welcome. Just try to pick a small topic to start with: it is a lot of code to look at if you consider the full spectrum of features (CPUs, GPUs, OpenCL, CUDA, Optix, etc.).
Re: OptiX intersection
Hi Chuchur !chuchur wrote: ↑Wed Jun 23, 2021 11:15 am Hey Dade, thank you for the explanation.
I hope, I could help a bit with luxcorerender development (I've done something like an illuminance sensor for old good lux render, but never try to push it into the repository). I'll put my note into "LuxCoreRender Project wants you!" topic
Can only say welcome to you an good luck with this intiative. Sure it is well apreciated