Repository navigation
asahi: translate the retained G15 wire under virtio - #34
Open
arslanrakh wants to merge 1 commit into
Open
arslanrakh wants to merge 1 commit into
arslanrakh wants to merge 1 commit into
Conversation
The retained G15 kernel speaks the Mesa-751 wire. On the native path, agx_open_device normalizes its feature word and agx_submit repacks every command buffer with agx_g15_wire_pack, but both are skipped under virtio. virglrenderer forwards GET_PARAMS (group 0) and SUBMIT to the same G15 kernel unchanged, so a guest on an M3 sees the raw 0x3e features, fails agx_params_native_kernel_abi_supported, and enumerates no GPU inside muvm. Apply the same normalization under virtio, and translate the command buffer directly into the ccmd payload in agx_virtio_submit; the retained wire is never larger than the canonical input. Mask VM_STATUS and VM_STATUS_MIRROR for virtio guests: virglrenderer rejects param groups other than 0, and hk_check_status and hk_init_vm_status_mirror issue raw GET_PARAMS on the guest fd, which would turn every wait into a device loss. Also check the calloc result in agx_virtio_submit. Tested on a 16" M3 Pro (Mac15,7, G15S) inside muvm 0.7.0 with virglrenderer 1.3.0: aarch64 and x86_64 (via FEX) vulkaninfo now report Apple M3 Pro (G15S B1), and headless vkmark at 1080p passes 13/13 scenes. The native host path is unchanged. Refs: omacom/omarchy#18111 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge. SummaryEnables retained G15 wire support for virtio guests without changing the native submission path.
No actionable issues found. No builds or tests were run. Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the guest side of omacom/omarchy#18111: on M3 (G15S), Vulkan inside
muvmfinds no GPU, so nothing run through muvm + FEX (Steam, x86 games) gets acceleration.Cause
The retained G15 kernel speaks the Mesa-751 wire. On the native path,
agx_open_devicenormalizes its feature word (agx_g15_wire_features) andagx_submitrepacks every command buffer (agx_g15_wire_pack). Both are skipped under virtio (if (!dev->is_virtio && ...), from 97a65d8: "Preserve the canonical paths for other devices and virtio").virglrenderer forwards
GET_PARAMS(group 0) and theSUBMITcommand buffer to the same G15 kernel unchanged (asahi_ccmd_get_params/asahi_ccmd_submit). So the guest sees the raw0x3efeatures and failsagx_params_native_kernel_abi_supported:asahi_proto.his identical to virglrenderer 1.3.0's, so the guest and host protocol already agree.Change
agx_device.c: apply the G15 feature normalization under virtio too, but maskVM_STATUSandVM_STATUS_MIRRORfor virtio guests. virglrenderer rejectsparam_group != 0, andhk_check_status/hk_init_vm_status_mirrorissue rawDRM_IOCTL_ASAHI_GET_PARAMSon the guest virtio-gpu fd, which would turn every wait into a device loss.agx_device_virtio.c: wheng15_legacy_wireis set, translate the command buffer withagx_g15_wire_packstraight into the ccmd payload (the output is never larger than the input), and shrinkcmdbuf_sizeandhdr.len. Also check the requestcalloc.The native host path is unchanged.
Testing
On a 16" M3 Pro (Mac15,7, G15S B1), linux-aurora 7.2.11.aurora14-1, muvm 0.7.0, libkrun 1.19.6, virglrenderer 1.3.0. I used a Vulkan-only build loaded through
VK_ICD_FILENAMES, with system packages untouched.vulkaninfovulkaninfoThe aarch64 results were first measured on a196911, then rebuilt and retested on this branch (
integration/aurorab7b03c5). I built the x86_64 driver from the same patch on a196911 under FEX, with the aarch64-builtmesa_clc/vtn_bindgen2/asahi_clcas--native-filebinaries, as in the mesa-aurora PKGBUILD tools stage. There were no asahi kernel errors on the host during any run.Not tested: i386, GL/Zink in the guest, real games, and the unit test suite (
-Dbuild-tests=false).Packaging follow-up (outside this repo): x86_64 and i386 builds of mesa-aurora with this patch, shipped as a FEX overlay in place of the stock
mesa-fex-emu-overlay-*.🤖 Generated with Claude Code