Skip to content

platform: Add AArch64 CPU feature detection#622

Merged
hysw merged 4 commits into
google:mainfrom
dnovillo:main
Jul 14, 2026
Merged

platform: Add AArch64 CPU feature detection#622
hysw merged 4 commits into
google:mainfrom
dnovillo:main

Conversation

@dnovillo

@dnovillo dnovillo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This all started because I got myself an ARM laptop and tried to build BigWheels on it under Windows and WSL2.

CpuInfo only supported x86. On AArch64 the platform-detection code did not compile, Platform::GetCpuInfo() returned an empty struct, and sample_00_ppx_info did not build.

This PR adds AArch64 support to the CPU detection layer.

  1. Add CpuInfo::AArch64Features to platform.h. It exposes 31 feature flags populated from cpu_features::GetAarch64Info().
  2. Add GetAArch64CpuInfo() to platform.cpp, gated on __aarch64__ || _M_ARM64. Vendor and microarchitecture strings are
    resolved from the implementer/part fields using codes from the Linux kernel (arch/arm64/include/asm/cputype.h).
  3. Update sample_00_ppx_info to print the AArch64 feature set on AArch64 and the x86 feature set otherwise.
  4. Fix !PPX_ANDROID to NOT PPX_ANDROID in projects/CMakeLists.txt. The original expression always evaluated to true, so sample_00_ppx_info was always added regardless of the Android target.

Tested on a Snapdragon X Elite (Qualcomm Oryon X1) running Linux AArch64 and Windows 11.

NOTE: On Linux I still cannot get samples to work (they all fail with VK_ERROR_INCOMPATIBLE_DRIVER). I think Mesa drivers don't yet support my hardware (Qualcomm(R) Adreno(TM) X1-85 GPU). Or maybe I've not configured it properly.

All the samples work fine on Windows, though. Both in Vulkan and DX12 mode.

@google-cla

google-cla Bot commented Jun 4, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

CpuInfo only supported x86. Add GetAArch64CpuInfo() backed by
cpu_features::GetAarch64Info(), with vendor and microarchitecture
strings resolved from implementer/part codes (Linux kernel
arch/arm64/include/asm/cputype.h). Adds CpuInfo::AArch64Features
with 31 feature flags.

Update sample_00_ppx_info to print the AArch64 feature set on AArch64
and the x86 feature set otherwise. Fix !PPX_ANDROID to NOT PPX_ANDROID
in projects/CMakeLists.txt.

Tested on Snapdragon X Elite (Qualcomm Oryon X1), Linux AArch64.
@dnovillo

dnovillo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@jorgeag-google I've signed the CLA, who would be an appropriate reviewer for this change? Thanks.

@hysw hysw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks.

Two nits, don't need to be fixed in this PR.

Comment thread src/ppx/platform.cpp Outdated
Comment thread src/ppx/platform.cpp Outdated
Comment thread projects/sample_00_ppx_info/main.cpp
@dnovillo

dnovillo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@hysw @jorgeag-google thanks for the review. I think I've addressed all the feedback. PTAL.

@dnovillo

Copy link
Copy Markdown
Contributor Author

@hysw all the tests finished successfully. If the PR is ok, would you be able to submit it for me? I don't have write access to the repo. Thanks.

@hysw
hysw merged commit ae412e2 into google:main Jul 14, 2026
11 checks passed
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.

3 participants