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

Viogpu: support cross-adapter resources (use case: virtio-gpu-pci used w/ gpu passthru) #1111

Open
sharkautarch opened this issue Jun 27, 2024 · 0 comments

Comments

@sharkautarch
Copy link

sharkautarch commented Jun 27, 2024

I’m currently using virtio-gpu-pci w/ gpu passthru, since my computer is a muxless hybrid laptop, and intel SR-iov support w/ intel XE driver is still in development.
I’m wondering if supporting cross-adapter resources could allow the viogpu to transfer frames from the passed-thru’d gpu more efficiently

According to these Microsoft links:
https://learn.microsoft.com/en-us/windows-hardware/drivers/display/rendering-on-a-discrete-gpu-using-cross-adapter-resources

https://learn.microsoft.com/en-us/windows-hardware/drivers/display/using-cross-adapter-resources-in-a-hybrid-system?source=recommendations

Supporting cross-adapter resources could allow the passed-thru gpu to share resources w/ the viogpu in certain situations. (Or is it supposed to work the other way around? Not entirely sure)

Here’s where I’m thinking that it might help w/ performance:

  • it might result in some copies to system memory (alloc’d by viogpu) being replaced by copies to a cross-adapter resource (not sure if it always has to be alloc’d by the display adapter, or if it can also be alloc’d by the discrete gpu?

I know that viogpu definitely has to make one copy to system memory for each frame transferred to the host, but I’m not sure if there might currently be at least one extra copy to system memory per frame between the passedthru gpu & viogpu. Perhaps due to composition?

  • even if the above is not the case, I’m pretty sure this would at least allow the passed thru’d to start copying as soon as it is done rendering. Since otherwise I would imagine that the compostor and/or Dxgkrnl.sys has to figure out how to move the rendered stuff to viogpu on its own?

Microsoft does provide diagrams for the different cross-adapter display models here:
https://learn.microsoft.com/en-us/windows-hardware/drivers/display/rendering-on-a-discrete-gpu-using-cross-adapter-resources

But I can’t find a diagram for how hybrid display works without cross-adapter resources to compare against the cross-adapter resource display diagrams…

I understand if it’s too complicated to support any of the cross-adapter resource stuff. Just wanted to check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants