Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • KWin KWin
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 67
    • Issues 67
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 157
    • Merge requests 157
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PlasmaPlasma
  • KWinKWin
  • Merge requests
  • !3859

make multi gpu not suck

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Xaver Hugl requested to merge work/zamundaaa/mgpu-experiments into master Mar 22, 2023
  • Overview 17
  • Commits 8
  • Pipelines 12
  • Changes 59

Currently, our multi gpu paths look like this:

  1. allocate a gbm_bo on the compositing GPU, import that directly to the displaying GPU controller. This is fast and ignoring the edge case of a static image, also very efficient, but only works on very few systems
  2. allocate a gbm_bo on the compositing GPU, copy that into a dumb buffer on the displaying GPU. This is done with the CPU, so especially with high resolutions it's pretty slow and inefficient. This works everywhere

This MR introduces a path in the middle ground between these two: We allocate a gbm_bo on the compositing GPU, render to it, and then import it to the displaying GPU with EGL, where it will then be copied with OpenGL to a buffer that can be displayed. This should result in almost as good performance and efficiency as with (1), and is compatible with most, if not all multi gpu systems. There's some caveats however:

  • to import a buffer from a non-NVidia GPU to a NVidia GPU, only the linear modifier is valid. This modifier is marked as being external only though, which KWin currently doesn't support
  • it's possible that creating an EGLDisplay for DisplayLink "GPU"s works but falls back to software rendering. If so, this needs to be detected; the fallback to CPU copy is preferable in that case
  • on at least some AMD+AMD systems, this path currently doesn't work with explicit modifiers because of a bug in RadeonSi. This includes my system, so the testing I could do is limited. https://gitlab.freedesktop.org/mesa/mesa/-/issues/8431
  • forcing a linear modifier successfully works around the driver bug, but causes another problem: Whenever my dedicated GPU is used for compositing, having anything blurred on a display connected to the integrated GPU causes very severe performance problems, making it a lot worse than CPU copy
Edited Apr 03, 2023 by Xaver Hugl
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/zamundaaa/mgpu-experiments