I recently started using OptiX as I am experimenting with light transport algorithms. I have been trying to get a grasp of the main concepts by examining the SDK examples, as well as the great course on OptiX 7 by Ingo Wald. However, I was not sure about the limits of the launch parameters that you can pass to a pipeline when you launch it. If I understand correctly, the launch parameters can take any kind of arbitrary data. For example, I can pass a vector of Lights to it, so I can access the data of these light sources from anywhere in my device programs. But I was wondering how these launch parameters are stored in GPU memory, and if I should take into account any performance hits regarding to what I store in this struct. Is storing a vector of light source data, as I proposed before, an okay thing to do? Or should this launch parameter space be reserved for small, limited data?
Thank you in advance,
Just have a read through this search list of OptiX threads which mention launch parameters:
Your questions are answered in there.
OptiX Programming Guide on launch parameters:
The gist is:
- Launch parameters are put into constant memory by OptiX.
- That constant memory is limited to 64 kB and it’s read-only!
- It’s a good idea to keep it small.
- OptiX identifies the single launch parameter structure via its name given to OptixPipelineCompileOptions pipelineLaunchParamsVariableName.
- Everything big you need to read (camera-, light-, material-definitions, per instance data, etc.) should be and everything you write (all output buffers of any kind) must be stored as CUdeviceptr (or typed pointers which are also just 64 bit device pointers) inside the launch parameters via which you can access the underlying data inside global memory.
More example code doing that here:
Launch parameter struct showing all of the above:
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.