Migrate to rutabaga_gfx v0.1.76-libkrun.0 from crates.io#560
Migrate to rutabaga_gfx v0.1.76-libkrun.0 from crates.io#560dorindabassey wants to merge 3 commits intocontainers:mainfrom
Conversation
Migrate from the old RutabagaBuilder API that used explicit
virgl_flags to the new capset_mask-based API.
Key changes:
- Replace RutabagaBuilder::new(component, virgl_flags, capset_mask)
with new(capset_mask, fence_handler) signature
- Explicitly set EGL flag via set_use_egl(true) to match old behavior
- Rename RutabagaChannel to RutabagaPath (API change)
- Update handle type constants (e.g. RUTABAGA_MEM_HANDLE_TYPE_* to
RUTABAGA_HANDLE_TYPE_MEM_*)
- Plumb export_table through RutabagaBuilder for cross-domain fd
sharing between virtio-fs and virtio-gpu
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
VirtioFsKey is not publicly exported from rutabaga_gfx v0.1.76-libkrun.0. Define local VirtioFsKey and temporarily disable export_table feature. Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Using rutabaga_gfx from crates.io version 0.1.76-libkrun.0 instead of vendored source. Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Summary of ChangesHello @dorindabassey, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request modernizes the project's GPU virtualization stack by migrating to an upstream version of the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request migrates rutabaga_gfx to version 0.1.76-libkrun.0 from crates.io and removes the vendored version. It correctly adopts the new RutabagaBuilder API and updates resource mapping and transfer calls to match the upstream changes. However, there are two significant issues: the capset_mask is hardcoded to 0, which will likely prevent the guest from discovering 3D capabilities, and the export_table functionality is currently disabled due to type mismatch issues with the VirtioFsKey workaround, resulting in a regression for VirtioFS/GPU resource sharing.
|
|
||
| // Initialize VirglRenderer - use capset_mask=0 to register all available capsets | ||
| // and explicitly set VirglRenderer as the default component | ||
| let capset_mask = 0; |
There was a problem hiding this comment.
The capset_mask is hardcoded to 0. In rutabaga_gfx, this mask determines which capability sets are advertised to the guest. Hardcoding it to 0 will likely cause the guest driver to fail to discover 3D acceleration features (like Virgl), even if the VirglRenderer component is initialized. The comment suggests this registers all available capsets, but typically a bitmask of 0 indicates no capsets are enabled. This should likely be derived from the desired features or set to include relevant capsets like RUTABAGA_CAPSET_VIRGL and RUTABAGA_CAPSET_VIRGL2.
| // TODO: Re-enable once rutabaga_gfx exports VirtioFsKey publicly | ||
| // The export_table feature requires VirtioFsKey which is defined in | ||
| // rutabaga_gfx::rutabaga_core but not re-exported in the public API. | ||
| // Our local VirtioFsKey definition matches the layout but causes type | ||
| // mismatch errors when passed to rutabaga. | ||
| // if let Some(export_table) = export_table { | ||
| // builder = builder.set_export_table(export_table); | ||
| // } | ||
| let _ = export_table; // Suppress unused variable warning |
There was a problem hiding this comment.
The export_table functionality is currently disabled and the variable is suppressed. This is a regression that prevents sharing resources between VirtioFS and the GPU (e.g., for mapping host files into GPU memory). While the TODO indicates this is a temporary workaround for the non-exported VirtioFsKey type in rutabaga_gfx, this feature is critical for certain use cases and should be re-enabled as soon as possible.
As part of the efforts to remove vendored rutabaga_gfx and use upstream Rutabaga_gfx, we are adopting the new RutabagaBuilder API with capset_mask, Add temporary workaround for VirtioFsKey not being publicly exported(marking as draft pending magma-gpu/rutabaga_gfx#43 merge).