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

Some thinking about D3D API-forwarding #5

Open
BruceMok opened this issue Jul 16, 2021 · 2 comments
Open

Some thinking about D3D API-forwarding #5

BruceMok opened this issue Jul 16, 2021 · 2 comments

Comments

@BruceMok
Copy link

Hi,
It's me again, I read your article.
https://www.studiopixl.com/2017-08-27/3d-acceleration-using-virtio.html.

Is there any possibility, if i hook D3D API in VM guest and send to another Windows host which has physical GPU, when host finish render task, copy result data to guest. Guest and host, same Windows version, same D3D version, it seems can work out.

thanks for your time.

@Keenuts
Copy link
Owner

Keenuts commented Aug 8, 2021

Hi,

Sorry for the late reply.
In theory yes, you could serialize the D3D calls, send them to another machine, and run the commands on this machine. This is called api-forwarding. The problem is "copy result data to guest".

  • serializing D3D api calls to run them as-is on another device is not efficient (latency, verbosity)
  • "copy result data to guest" is not trivial.
    • if we talk about compute jobs, yes, you could copy memory back by setting all memory areas as non-mappable/non-coherent (see the Vulkan compute proof of concept which is essentially api forwarding https://github.com/Keenuts/vulkan-virgl )
    • If you decide to allow memory-mappings, how do you keep them in sync? You'd need to have additional support to sync your dirty pages across the windows guest running on a linux host, and the remote windows machine.
    • if we talks about graphic jobs, it becomes way harder.
      • How do you "present" your framebuffer rendered on another host in your vm?
      • How do you read the said framebuffer? (Not all framebuffers can be read, in case of DRM content by example, you are now allowed to do some operations without trashing the whole data)

@BruceMok
Copy link
Author

BruceMok commented Aug 9, 2021

Very glad to have received your response. Thanks.

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

No branches or pull requests

2 participants