rust-vmm / vhost-device

'vhost-user' device backends workspace
Apache License 2.0
67 stars 46 forks source link

vhost-device-gpu: Add Initial Implementation #668

Open dorindabassey opened 3 months ago

dorindabassey commented 3 months ago

Summary of the PR

I and @mtjhrc have been working on this PR that adds a new crate - vhost-device-gpu. This vhost-device-gpu crate provides a vhost-user backend daemon for VIRTIO GPU device emulation as specified in the VIRTIO Spec v.1.2

This crate utilizes the rutabaga crate Imported from crosvm commit: 02110bc6fcc6af70329f410aef8859ec70dd9224 rutabaga_gfx: fixes for crrev.com/c/5279413

The rutabaga crate is vendored because it contains minor modifications to rutabaga_gfx to make it compatible with vhost-device-gpu eventually we would use the upstream version when things are more stable.

This crate includes some modifications from crosvm and libkruns virtio-gpu device

This crate depends on this PR that implements support for QEMU's vhost-user-gpu protocol.

Supported features are: Using gfxstream component from rutabaga. Using virglrenderer component from rutabaga. support the GPU device operations as specified by the virtio specification

TODO and nice to have items: Add support for the remaining GPU device operations:

add support for directly sharing display output resource using dmabuf instead of copying it by using transfer_read operation.

Fixes: #598

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

stefano-garzarella commented 3 months ago

@dorindabassey @mtjhrc great! Thanks for this PR. IIUC this is still WIP, so I marked as Draft, feel free to mark this ready when you want ;-)

dorindabassey commented 3 months ago

@dorindabassey @mtjhrc great! Thanks for this PR. IIUC this is still WIP, so I marked as Draft, feel free to mark this ready when you want ;-)

yes, Thanks. I see that it's failing on the CI, once that's resolved we can mark it ready.

stefano-garzarella commented 3 months ago

@dorindabassey @mtjhrc great! Thanks for this PR. IIUC this is still WIP, so I marked as Draft, feel free to mark this ready when you want ;-)

yes, Thanks. I see that it's failing on the CI, once that's resolved we can mark it ready.

Sure, but IMHO we should merge https://github.com/rust-vmm/vhost/pull/239 first before marking this ready.

dorindabassey commented 3 months ago

@dorindabassey @mtjhrc great! Thanks for this PR. IIUC this is still WIP, so I marked as Draft, feel free to mark this ready when you want ;-)

yes, Thanks. I see that it's failing on the CI, once that's resolved we can mark it ready.

Sure, but IMHO we should merge rust-vmm/vhost#239 first before marking this ready.

you're right, we can wait to merge the first PR.