Skip to content

fix(sdk): prepare GCC 11 toolchain and Adreno F16 fallback - #1699

Open
Khoi VN (vnk8071) wants to merge 3 commits into
mainfrom
fix/linux-glibc235-hexagon-build
Open

Khoi VN (vnk8071) wants to merge 3 commits into
mainfrom
fix/linux-glibc235-hexagon-build

Conversation

@vnk8071

@vnk8071 Khoi VN (vnk8071) commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Description

ARM64 Linux builds need a consistent compiler/runtime ABI, and Adreno compiler E031.42.02.00 aborts while compiling optimized F16 attention kernels with a Stride != 0 assertion. This change prepares the next Linux toolchain image and applies a compiler-specific llama.cpp fallback so the same SDK can run across supported IoT hardware.

Summary

  • Prepare docker.io/qualcomm/geniex-toolchain-linux:v0.2.1 using the BASE_IMAGE build argument. The Linux base defaults to published v0.2.0 and accepts a linux_base_image override; the Dockerfile does not embed an image tag or digest. Publishing defaults to both Linux and Android. Install GCC/G++ 11 ARM64 cross compilers, preserve and hash-check the GLIBC 2.41 ARM64 sysroot and target libstdc++ runtime, and compile/link C and C++/OpenMP smoke programs.
  • Select GCC 11 in both Linux presets and the Rust linker. Patch the Hexagon F16 size check to use sizeof(uint16_t) for GCC 11 compatibility.
  • Audit every installed ARM64 host ELF, including bin/geniex-bench, against GLIBC 2.41, GLIBCXX 3.4.30 and CXXABI 1.3.13. Keep ABI regression tests in tests/test_check_linux_abi.py and run them from the Python lint workflow.
  • Apply an OpenCL fallback only when the reported Adreno compiler is E031.42.02.00. Skip the crashing optimized F16 kernels, guard optional kernel dispatch and use existing generic paths. Decline fused flash attention through the existing backend capability check.

The fallback is selected by compiler version rather than board identity. The llama.cpp submodule pin remains 93cf736a8d1d46aa922e27eb64aa712bcd5ebc30; two patches are registered in GenieX's SDK build without changing that pin.

Related Issue

Related: #458 (Linux libstdc++ ABI compatibility).

Type of Change

  • Bug fix
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional Context

Test plan

Four-board smoke-test results:

Hardware Host OS Tested environment CPU GPU llama.cpp NPU
QCS8550 Ubuntu 22.04 / GLIBC 2.35 Ubuntu 24.04 SDK containers and full release Docker Pass Pass, including the final patched backend regression Pass, v73
QCS9075 Ubuntu 24.04 / GLIBC 2.39 Native full SDK and release CLI Pass Pass after runtime setup Pass, v73
QCS8275 Ubuntu 24.04 / GLIBC 2.39 Native full SDK, release CLI and full release Docker Pass Pass Pass, v75
QCS6490 Ubuntu 20.04.3 / GLIBC 2.31 Ubuntu 24.04 SDK/CLI containers and full release Docker Pass Pass with the compiler fallback Unsupported: v68 DSP; supplied skels start at v73

All successful inference smoke tests used Qwen3-0.6B-Q8_0.gguf, context 256 and eight generated tokens. Accelerator tests used all-layer offload; GPU runs offloaded 29/29 layers. These checks establish successful inference for the tested configurations, rather than comparative performance.

Validation:

  • CPU SDK, full Snapdragon SDK, CPU CLI and full release builds passed for the toolchain candidate. The package-wide ABI audit passed for 38 ARM64 ELFs in the full SDK and 10 in the CPU SDK; observed maximum requirements were GLIBC 2.39, GLIBCXX 3.4.30 and CXXABI 1.3.13.
  • OpenCL kernel compilation and the native GCC 11.4 backend build passed. F16 numerical coverage passed for 226 cases before the final capability refinement and a 32-case subset after the final backend rebuild. Twelve fused flash-attention cases were correctly declined; they were not numerical execution tests of fused attention.
  • Patch application and repeated CMake configuration passed against the pinned llama.cpp source.

Remaining work:

  • The local v0.2.1 candidate is built and validated, but the image has not been published. Both Linux CI references and documented build commands still select published v0.2.0, which lacks GCC 11. Publish and verify v0.2.1, then update those references before merging; Both Linux SDK CI jobs now fail to configure because aarch64-linux-gnu-gcc-11 and aarch64-linux-gnu-g++-11 are missing from the current CI image.
  • The final GPU fallback was tested as a rebuilt backend overlay in the full release container on QCS6490 and QCS8550. The complete release image has not been rebuilt with that final patch. QCS9075 and QCS8275 were tested with the earlier toolchain candidate before the GPU patch; Docker was not tested on QCS9075.
  • QCS6490 NPU support remains unresolved: the device reports v68, while the pinned backend selects v73 and the supplied package has no v68 skel. The NPU attempt timed out.
  • This change preserves a GLIBC 2.41 target sysroot; it does not establish native Ubuntu 20.04 or 22.04 compatibility. Those older hosts were exercised through Ubuntu 24.04 containers. Deployment remains dependent on actual ELF symbol requirements and available GPU/DSP drivers.
  • Hardware/build evidence was collected from baseline 09991a8695adca562b653826aba498164d34c013. The review branch was advanced to main cbc93b313d6524b056d67975b8cc9f1f9977727b for this PR; hardware and full-release builds have not been repeated on the newer base. Local ABI tests, lint and patch integrity checks were repeated during PR preparation. The later configurable-base-image change passed workflow YAML and whitespace checks; the toolchain image and hardware tests have not been repeated for that configuration change.

All six ABI regression tests passed after moving them to tests/test_check_linux_abi.py (python -m unittest discover -s tests -p 'test_check_linux_abi.py'); Ruff lint/format, workflow YAML parsing and staged whitespace checks passed. No additional explanatory source comments were introduced. Existing licensing is preserved. No device addresses, credentials, local reports or workstation paths are included.

Signed-off-by: vnk8071 <kvo@qti.qualcomm.com>
Signed-off-by: vnk8071 <kvo@qti.qualcomm.com>
Signed-off-by: vnk8071 <kvo@qti.qualcomm.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants