Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement GPU acceleration for OpenGL #2715

Merged
merged 34 commits into from
Aug 9, 2021
Merged

Implement GPU acceleration for OpenGL #2715

merged 34 commits into from
Aug 9, 2021

Conversation

osy
Copy link
Contributor

@osy osy commented Aug 9, 2021

  • egl-headless + ANGLE was pretty straightforward but I wasn't satisfied with the solution because it rendered offline to a framebuffer on GPU -> framebuffer is copied to the CPU -> CPU buffer is sent to SPICE client -> SPICE client renders it by copying it back to the GPU. Although this is the only way if running a VM remotely, the movement of data back and forth from GPU to CPU is unnecessary.
  • On Linux, SPICE uses dmabuf to pass a pointer to GPU data so no copying was needed. On macOS we don't have dmabuf, but we have IOSurface which has a similar mechanism. ANGLE also supports rendering to IOSurface. So we added IOSurface rendering to QEMU's spice-display.
  • In order to be compatible with SPICE libraries (without having to modify the APIs), we wrap IOSurfaceID into a file descriptor by passing it through a pipe. On macOS, we have to use kIOSurfaceIsGlobal to pass IOSurfaceID across process boundaries. On iOS, everything is in one process so that's not needed. A better solution would use mach ports or XPC but it would be a lot of work to integrate that into QEMU.

Closes #161

osy added 30 commits July 25, 2021 20:21
Previously, we would try to connect QMP and SPICE independently and wait
for a display to be created. This introduced a lot of race conditions
and is unworkable with GL scanout event being sent before we connect the
event. Now, we wait for QMP to be connected first (we still have to
retry because there's no good way to see if QEMU has started QMP yet).
Once QMP is connected, we start up SPICE. Once SPICE is connected, we
resume booting up the VM.
Required for new dependencies.
ANGLE does not support it.
Remove link on main UTM executable.
@osy osy merged commit 0475156 into master Aug 9, 2021
@osy osy deleted the dev branch August 9, 2021 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement virgil3d support for GPU paravirtualization
1 participant