Huawei Open-Sources SimpleGPULayer: Full-Scenario GPU Acceleration for HarmonyOS

Huawei's HarmonyOS team open-sources SimpleGPULayer (SGL), a Vulkan-based GPU acceleration framework providing 52 image filters, 28 compute operators for AI inference, 2D/3D rendering with glTF/PBR support, and GPU Bezier line generation — all accessible via minimal C/NAPI APIs for native HarmonyOS apps.

HarmonyOS Developer Technology
HarmonyOS Developer Technology
HarmonyOS Developer Technology
Huawei Open-Sources SimpleGPULayer: Full-Scenario GPU Acceleration for HarmonyOS

Huawei's HarmonyOS development team has officially open-sourced SimpleGPULayer (SGL) on GitCode, a high-performance GPU acceleration framework built on Vulkan that targets HarmonyOS native applications. SGL encapsulates complex GPU pipeline details — device initialization, memory management, pipeline creation, command submission — into concise APIs, allowing developers to integrate GPU acceleration with only a few lines of code.

Four Core Capabilities

1. Image Processing: 52 Filters + Large-Image Solution + Layer Blending

SGL ships with 52 built-in GPU image filters covering blur, artistic styles, color adjustment, and geometric deformation. It supports large-radius real-time preview. For ultra-large image editing, a tiled processing solution controls video memory usage while avoiding boundary artifacts. An asynchronous prefetch mechanism enables parallel CPU reading and GPU computation, significantly improving large-image editing responsiveness. Additionally, SGL provides 4 layer blending modes (multiply, overlay, dissolve, lighten) for multi-layer editing, material overlay, and complex visual compositing.

2. AI Inference Computing: 28 Operators Covering Mainstream Model Pre/Post-Processing

The ComputeEngine module provides 28 compute operators : 22 GPU operators and 6 CPU reduction operators . These cover matrix operations, activation functions, normalization, positional encoding, element-wise operations, and reduction statistics. They efficiently support on-device AI model pre/post-processing and general GPU compute scenarios. The repository includes an LLM inference demo demonstrating how to quickly build a Transformer inference pipeline using SGL.

3. 2D/3D Rendering: Off-Screen Rendering + Model Loading

The Renderer module supports 3D mesh rendering and 3D Gaussian splatting rendering . It can load mainstream 3D formats such as glTF and includes a complete PBR texture pipeline . Off-screen rendering is supported, allowing render results to be output directly as images — suitable for server-side rendering and automated processing scenarios. This dramatically lowers the development and integration barrier for 2D/3D rendering on HarmonyOS.

4. Vector Graphics Generation: GPU Bezier Thick Line Generation

SGL provides GPUBezierThickLineGenerator, which moves Bezier curve generation to GPU compute shaders for parallel execution. Developers only need to pass control points, start/end widths, and endpoint sampling parameters; the GPU compute shader quickly generates triangle-strip vertex sets for tapered thick lines. This capability has been validated in office software for node-to-node tapered connection lines, showing significant performance gains over traditional CPU per-segment calculation in dense-node, frequent-drag, real-time canvas refresh scenarios.

Minimal Integration: Three Lines for a Gaussian Blur

SGL deeply encapsulates the complex GPU pipeline. Developers only prepare input image, output image, and filter parameters. Example for Gaussian blur:

const auto filter = std::make_shared<FastGaussianBlurFilter>();
filter->SetRadius(120);
sgl::image::ImageEngine::Process(inputImage, outputImage, filter);

For HarmonyOS app integration, SGL provides C API and NAPI interfaces , allowing developers to embed it as a native acceleration library and expose business interfaces to the ArkTS/JS layer with minimal integration cost.

Open-Source Collaboration & Repository

The project is led by the HarmonyOS Strike Team, with image processing filters co-built by the Wukong Image partner, and Bezier tapered-line capability jointly validated with an office software vendor. SGL is already running stably in production apps including Wukong Image. The open-source repository is available at:

https://gitcode.com/OpenHarmonyPerfSquad/SGL

Developers can also search "SimpleGPULayer" or "SGL" on GitCode to obtain the source code. The team welcomes community contributions to continuously expand the framework's capabilities.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Image ProcessingGPU accelerationHarmonyOSAI inference3D renderingvector graphicsVulkanSimpleGPULayer
HarmonyOS Developer Technology
Written by

HarmonyOS Developer Technology

HarmonyOS developers provide key technology analysis, version updates, Codelabs practice, and event information for HarmonyOS. Welcome developers to join the HarmonyOS ecosystem and create infinite possibilities together!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.