-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(rockchip-rk3588): Enable mesa-vpu extension for GPU acceleration #8979
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
base: main
Are you sure you want to change the base?
fix(rockchip-rk3588): Enable mesa-vpu extension for GPU acceleration #8979
Conversation
WalkthroughAdds a new public shell function Changes
Sequence Diagram(s)sequenceDiagram
participant Loader as Config loader
participant RK3588 as rockchip-rk3588.conf
participant ExtMgr as enable_extension
rect rgba(100,150,200,0.08)
Loader->>RK3588: call extension_prepare_config__enable_mesa_vpu()
end
rect rgba(150,200,150,0.06)
RK3588->>ExtMgr: enable_extension("mesa-vpu")
ExtMgr-->>RK3588: success
end
RK3588-->>Loader: return
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-10-26T12:56:29.185ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Hey @brainwavecoder9! 👋Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡 If you'd like to stay informed about project updates or collaborate more closely with the team, Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀 |
Extensions seem to be optional, but the mesa-vpu extension author stated this 'should be enabled on all for rk3588 distributions' but was never implemented. Without it, desktop images use llvmpipe software rendering instead of GPU. Although ENABLE_EXTENSIONS=mesa-vpu resolves the issue, users will run into concerns for other optional extensions similar to armbian#7482. Approach uses extension_prepare_config hook to auto-enable mesa-vpu, ensuring it loads regardless of user-specified ENABLE_EXTENSIONS. Tested on Orange Pi 5 Plus: glxinfo now shows Mali-G610 (Panfrost).
4cf545f to
03455cb
Compare
|
Initially I added Updated approach as the RK3588 family config should enable it by default and not overwrite even if others are set. |
|
|
||
| function extension_prepare_config__enable_mesa_vpu() { | ||
| # Auto-enable mesa-vpu for RK3588 GPU acceleration | ||
| enable_extension "mesa-vpu" |
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.
Hasn't it already been enabled in some pre-built images? https://github.com/armbian/os/blob/f31d7b29592e9d0ba01ea2d146e1a58b16a01f7a/userpatches/targets-release-standard-support.yaml#L108
Doing this will disable the Mali kernel driver, but there are also people who don't use Panthor, but instead use libmali for games and computing.
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.
I thought about that myself but if you look at the extension, it is pretty locked down already. Like minimal images will not be affected at all.
Overall I am not a fan of squeezing this in by default but on the other hand when using a desktop the OOB experience will be better. It is up to the user to switch to libmali or whatever. Some manuals out there like the one from jellyfin would need adjustment to either disable panthor overlay or use minimal image at start.
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.
I have no problem enabling this extension only for desktop image builds. For server or minimized images, I'd rather handle it myself.
Yes. The Jellyfin documentation may need updating to tell users who need HDR transcoding to disable the panthor-gpu overlay.
|
I took more time to understand the conflicts here, and I am no longer confident that there is a simple/easy path to enabling the hardware. Initially I was of the opinion that a default config would make for a better starting point, but it does not appear possible for desktop rendering and NPU to exist in the same configuration. NPU + GPU is possible, but only with software acceleration for desktop GPU (and that's probably not the best default). In light of this, I'm leaning towards leaving things as-is and discussing how it could be best communicated that additional steps are necessary for different use cases. Instead of this change, I think a better approach might be to help bridge the gap between what ships and what is necessary to get where one wants to be. I'm working on a way to communicate this and would like your thoughts on how to best present to users. I also wonder about more deterministic overlays, or other patterns for making this happen. Perhaps there is documentation out there that I haven't seen, but at this time I'd propose closing this without changes and continuing a discussion. I am happy to have that discussion wherever you would prefer, whether that is here, or on a new issue, or on the forum (whether an existing thread or elsewhere). In any case, thank you for sharing these thoughts. I do very much appreciate your consideration. |
|
FYI here's a first pass... leaving here for reference but happy to put more work into communicating / integrating options (ideally I'd like a selector for one of the options, whether these specific breakdowns or otherwise) RK3588 - GPU/NPU Driver Options & Config GuideMain Configuration Options
XFCE does not support Wayland in any configuration What Each Configuration Gives You
Display Server Compatibility Matrix
Required Packages by Configuration
Hardware Utilization Summary
The Fundamental ConstraintOption 1: NPU Hardware Acceleration (libMali)
Option 2: GPU Hardware Acceleration (Panthor)
Both options offer equivalent VPU: Hardware video encode/decode (H.264, H.265, VP9) WHY YOU (MOSTLY) CANNOT HAVE BOTH: The RK3588 hardware is capable of running NPU + GPU simultaneously, but the available software drivers conflict. Exception: |
|
Thank you @khanh-it. I suspect there could be more configurations that have not made their way into formal support but yours is at least one potential "everything" so I have added it. |
https://github.com/ginkage/vulkan-wsi-layer/releases/tag/v1.3.276-1-d48decd |
|
Since we're close to 6.18 which may become next LTS kernel I could not recommend going for current, last but not least because rk3588 was in a barely working state when 6.12 came out. Lots of stuff has landed in mainline since then. |
Description
This PR enables GPU acceleration for all RK3588 boards (Orange Pi 5/5B/5+, Rock 5A/5B/5C, etc.). For desktop use it's probably not noticeable, but for 3D graphics, ML inference, and video processing expect 10-100x improvement.
The issue is that RK3588 boards ship with llvmpipe software rendering instead of GPU acceleration on desktop images due to driver binding precedence. The proprietary
malidriver is selected by default, which Mesa cannot use. Thepanthor-gpuoverlay resolves this.The
mesa-vpuextension (May 2024) was created for this purpose, with the author intending this to be "enabled on all for rk3588 distributions". However, the rockchip family config was defined before this and was never updated.Fixes the root cause of issues like #7507, #7504.
Documentation summary for feature / change
Short description: Enable mesa-vpu extension for RK3588 GPU acceleration
Summary: Desktop images will now use hardware GPU acceleration (Mali-G610/Panfrost) as the default instead of software rendering (llvmpipe). The extension automatically configures the panthor-gpu overlay for vendor kernel builds.
Example of usage: After flashing desktop image,
glxinfo | grep renderershowsMali-G610 (Panfrost)instead ofllvmpipeWorkaround for existing systems: Add
overlays=panthor-gputo/boot/armbianEnv.txtand reboot.How Has This Been Tested?
Tested on Orange Pi 5 Plus 16GB with Armbian 25.8.1 Noble vendor 6.1.115 XFCE:
glxinfoshowsllvmpipe (LLVM 20.1.2, 128 bits)glxinfoshowsOpenGL renderer string: Mali-G610 (Panfrost)eglinfoshowing GPU acceleration workingAdditional Acknowledgement
Shout out to @pollen-robotics for letting me beta test Reachy Mini, a project cool enough to inspire me to actually need this GPU.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.