scopehal-apps icon indicating copy to clipboard operation
scopehal-apps copied to clipboard

Improve Primus/Optimus support

Open azonenberg opened this issue 3 years ago • 1 comments

When working on a laptop featuring a combined integrated and discrete GPU, it may be beneficial to split the application across both.

Proposed architecture:

  • Do not use g_vkComputeDevice for final rendering. Create a separate Vulkan device pointer which may or may not point to the same handle.
  • Use g_vkComputeDevice for waveform rasterization
  • Use the new render device handle for all imgui stuff as well as tone mapping
  • Ensure device handles are propagated in AcceleratorBuffer's and other objects as needed
  • During tone mapping, if g_vkComputeDevice is not equal to the render device, perform a device to device copy of the grayscale fp32 pixels. This is similar to how glscopeclient's Vulkan-OpenGL transition works, and would effectively be application managed Primus (with low level control of the partitioning)

azonenberg avatar Oct 10 '22 02:10 azonenberg

We still need to look into how PrimusVK manages power. Do we have the ability to power the dGPU on/off on cue? Is data lost / are handles invalidated when we do so?

Also, might it be beneficial to dynamically switch from 100% iGPU to Primus-style iGPU rendering and dGPU compute offload depending on framerate, memory depth, or other metrics? This would improve power efficiency if we are working with smaller datasets where the dGPU is overkill.

azonenberg avatar Oct 10 '22 02:10 azonenberg