-
Notifications
You must be signed in to change notification settings - Fork 48
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
vhost-device-gpu: Add Initial Implementation #668
base: main
Are you sure you want to change the base?
Conversation
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a complex device, you did such monumental effort!
Since it's large I'd have to re-read it a couple of times.
you're right, we can wait to merge the first PR. |
the vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx that requires epoxy library Signed-off-by: Dorinda Bassey <[email protected]>
the vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx that requires epoxy library Signed-off-by: Dorinda Bassey <[email protected]>
the vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx that requires epoxy library Signed-off-by: Dorinda Bassey <[email protected]>
This version adds fixes for libepoxy dependencies which is required for vhost-device-gpu crate more info about the crate can be found here: rust-vmm/vhost-device#668 Signed-off-by: Dorinda Bassey <[email protected]>
This version includes libepoxy dependencies which is required for vhost-device-gpu crate more info about the crate can be found here: rust-vmm/vhost-device#668 link to the container PR that adds libepoxy where the tag is generated can be found here: rust-vmm/rust-vmm-container#103 Signed-off-by: Dorinda Bassey <[email protected]>
This version includes libepoxy dependencies which is required for vhost-device-gpu crate more info about the crate can be found here: rust-vmm/vhost-device#668 link to the container PR that adds libepoxy where the tag is generated can be found here: rust-vmm/rust-vmm-container#103 Signed-off-by: Dorinda Bassey <[email protected]>
the vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx and the system library packages for rutabaga_gfx crate which is not available in the used ubuntu image, so install the neccessary packages that are available in ubuntu's repositories while for unavailable packages: build and install it manually. Signed-off-by: Dorinda Bassey <[email protected]>
The vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx and the system library packages for rutabaga_gfx crate which is not available in the used ubuntu image, so install the neccessary packages that are available in ubuntu's repositories while for unavailable packages: build and install it manually. Signed-off-by: Dorinda Bassey <[email protected]>
The vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx and the system library packages for rutabaga_gfx crate which is not available in the used ubuntu image, so install the neccessary packages that are available in ubuntu's repositories while for unavailable packages: build and install it manually. Signed-off-by: Dorinda Bassey <[email protected]>
The vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx and the system library packages for rutabaga_gfx crate which is not available in the used ubuntu image, so install the neccessary packages that are available in ubuntu's repositories while for unavailable packages: build and install it manually. Signed-off-by: Dorinda Bassey <[email protected]>
The vhost-device-gpu crate linked here rust-vmm/vhost-device#668 contains rutabaga_gfx and the system library packages for rutabaga_gfx crate which is not available in the used ubuntu image, so install the neccessary packages that are available in ubuntu's repositories while for unavailable packages: build and install it manually. Signed-off-by: Dorinda Bassey <[email protected]>
7817889
to
98f58ae
Compare
98f58ae
to
95b90a5
Compare
5690fd1
to
ab071b7
Compare
Hi @stefano-garzarella, @epilys, @bilelmoussaoui Thanks for the previous reviews. I think I've addressed all of them. let me know if you have any more comments to discuss. |
ab071b7
to
90f9ff5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some more comments, mostly for rust bits
90f9ff5
to
3e89404
Compare
bb3c208
to
7c6e34e
Compare
7c6e34e
to
557dc96
Compare
aa25731
to
11c9057
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: use the rustfmt.toml
file from the sound device and run cargo +nightly fmt
, this will format all comments, doc comments, imports, etc as well.
11c9057
to
370a632
Compare
Thank you for the review, I addressed them let me know if I missed any change. |
370a632
to
2100b8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience 🫠 I recognize these are a lot of nits and addressing them takes time...
This program is a vhost-user backend daemon that provides VIRTIO GPU device emulation as specified in the VIRTIO Spec v.1.2 https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html This crate utilizes the rutabaga crate from crosvm with some minor modification to rutabaga crate to fix compilation. This crate depends on this PR[rust-vmm/vhost#239] that implements support for QEMU's vhost-user-gpu protocol. This device uses the rutabaga_gfx crate to offer two rendering backends: 1. Virglrenderer: - Rutabaga translates OpenGL API and Vulkan calls to an intermediate representation and allows for OpenGL acceleration on the host. 2. Gfxstream: - GLES and Vulkan calls are forwarded to the host. These backends can be used by simply changing the `--gpu-mode` command line option. This crate also includes some modifications from libkrun virtio-gpu device https://github.com/containers/libkrun/tree/main/src/devices/src/virtio/gpu Fixes: rust-vmm#598 Co-authored-by: Dorinda Bassey <[email protected]> Co-authored-by: Matej Hrica <[email protected]> Signed-off-by: Dorinda Bassey <[email protected]> Signed-off-by: Matej Hrica <[email protected]>
2100b8f
to
2c122e6
Compare
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: 02110bc6fcc6af70329f410aef8859ec70dd9224rutabaga_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 utilizes the rutabaga crate v0.1.4 specifically the virglrenderer and gfxstream features.
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 more tests to improve the code coverage
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:
git commit -s
), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.