Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Improve multi-GPU buffer sharing #1347

Open
emersion opened this issue Oct 29, 2018 · 6 comments
Open

Improve multi-GPU buffer sharing #1347

emersion opened this issue Oct 29, 2018 · 6 comments

Comments

@emersion
Copy link
Member

emersion commented Oct 29, 2018

On multi-GPU setups we render everything on one primary GPU and then we copy buffers around to display them on secondary GPUs. This is done by exporting a DMA-BUF on the primary GPU, importing it on the secondary GPU, and rendering it on the secondary GPU:

struct gbm_bo *copy_drm_surface_mgpu(struct wlr_drm_surface *dest,

Instead we should use direct scan-out to skip rendering on the secondary GPU. This could be the groundwork for #1270.


wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1347

@VincentVanlaer
Copy link
Contributor

From issues we had with #1531 this doesn't seem possible on some drivers (radeon) because they can't scan-out from DMA-BUFs (which don't live in VRAM, but in system memory) directly. It would make more sense to copy the bo from system memory to VRAM, instead of using GL, but GBM doesn't have a way to copy buffers.

@emersion
Copy link
Member Author

Weston has a bunch of checks to figure out if a buffer is suitable for scan-out.

Maybe we could try to scan-out and fallback to a copy if it doesn't work, too.

@emersion emersion changed the title Zero-copy multi-GPU texture sharing Improve multi-GPU buffer sharing May 29, 2020
@emersion
Copy link
Member Author

Use-cases:

  • Display-only devices like DisplayLink don't have memory
  • Nouveau doesn't support OpenGL for some NVIDIA hw (so falls back to llvmpipe)

We could try these strategies:

  • Directly import and scan-out the DMA-BUF
  • Import the buffer and perform a copy via OpenGL
  • Do a manual copy via system memory

@emersion
Copy link
Member Author

The copy could be improved with:

  • Damage tracking support
  • Detect whether the DRM device is render-capable, don't try to use OpenGL in this case (do a CPU copy instead)

@d4g

This comment has been minimized.

@emersion
Copy link
Member Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants