-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Windows ARM64 Support (Qualcomm Snapdragon) #4521
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: master
Are you sure you want to change the base?
feat: Windows ARM64 Support (Qualcomm Snapdragon) #4521
Conversation
- Use ::std:: fully qualified namespace in template functions to avoid ambiguity with clang's namespace resolution - Fix boost::process inline namespace declaration for clang compatibility (clang doesn't support 'inline v1' syntax the same way as MSVC) These changes enable cross-compilation with llvm-mingw toolchain for Windows ARM64 targets.
- Fix icon path handling for cross-compilation with llvm-rc (use relative path from build directory) - Add ARM64 Steam audio driver subdirectory detection Enables building Sunshine for Windows ARM64 using llvm-mingw toolchain.
Add wgc_interop_guids.h which provides __mingw_uuidof specialization for IGraphicsCaptureItemInterop interface. This is required for constexpr GUID evaluation when compiling with clang/llvm-mingw. The header is conditionally included only when building with clang.
Add vendor ID detection for Qualcomm Adreno GPUs: - 0x4D4F4351: "QCOM" in ASCII (reversed as little-endian) - 0x5143: Alternate Qualcomm vendor ID When a Qualcomm GPU is detected, only Media Foundation encoders (h264_mf, hevc_mf, av1_mf) are considered compatible, as Qualcomm doesn't support NVENC, AMF, or QSV encoder APIs.
Add Windows Media Foundation hardware encoder support for platforms that don't have NVENC, AMF, or QSV (primarily Qualcomm Snapdragon). Encoders added: - h264_mf: H.264 via Media Foundation - hevc_mf: HEVC via Media Foundation - av1_mf: AV1 via Media Foundation Configuration: - Uses D3D11VA hardware device for GPU texture input - CBR rate control with display_remoting scenario for streaming - Only supports SDR 4:2:0 8-bit (Qualcomm MF encoder limitation) - Fixed GOP size of 120 frames since MF doesn't support on-demand IDR The mediafoundation encoder is probed after quicksync and amdvce, serving as a fallback for ARM64 Windows devices.
Add comprehensive build guide for cross-compiling Sunshine to Windows ARM64 from Linux using llvm-mingw toolchain. Includes: - Prerequisites and quick start - Step-by-step dependency building (OpenSSL, curl, miniupnpc, opus) - Stub libraries for unsupported features (MinHook, VPL) - CMake toolchain file for aarch64-w64-mingw32 - Hardware encoding notes and limitations - Troubleshooting section
|
|
Duplicate of #3905 |
| } else if (adapter_desc.VendorId == 0x4D4F4351 || // Qualcomm (QCOM as MOQC reversed) | ||
| adapter_desc.VendorId == 0x5143) { // Qualcomm alternate ID | ||
| // If it's not a MediaFoundation encoder, it's not compatible with a Qualcomm GPU | ||
| if (!boost::algorithm::ends_with(name, "_mf")) { |
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.
Let's just move this check for _mf into the Unknown GPU Vendor ID section below. MF should be a generic fallback for any unknown GPUs (and should never be allowed for any GPUs where we have native API support).
Did anyone confirm that |
|
Also it may use IDR on |
Yeah, I expect that to work (as it's mandatory for any hardware encoder per MSDN). If the reason for this was the "Encoder did not produce IDR frame" warning, it's possible that was simply an output delay issue. If the MF encoder is delaying output frames for further input (which is bad for latency), then the warning will be displayed even though the key frame will come after submitting a subsequent frame. |
👀 I somehow doubt that Qualcomm supports these two though, that would be too nice. |
|
It looks good. Consider adding ci and readme If you like, I can give your permission on #3905 |
| # For cross-compilation with llvm-rc, use relative path from build dir | ||
| file(RELATIVE_PATH SUNSHINE_ICON_RELATIVE "${CMAKE_BINARY_DIR}" "${SUNSHINE_ICON_PATH}") | ||
|
|
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.
This seems unnecessary to me. What happens to the rc compilation without this change?
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.
This was fixed in a different PR, can you rebase your branch onto latest master branch?
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 don't know how important the cross compiling guide is because GitHub now provides Windows arm runners. Maybe this should be a blog post created here -> https://github.com/LizardByte/LizardByte.github.io/tree/master/_posts/guides-community
| #if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) | ||
| #define STEAM_DRIVER_SUBDIR L"x64" | ||
| #elif defined(__aarch64__) || defined(_M_ARM64) | ||
| #define STEAM_DRIVER_SUBDIR L"arm64" |
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.
Steam provides an arm version now?
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 think, No
|
Cherry-picked some commits to #3905, Thanks for your work. |




Summary
This PR adds support for building and running Sunshine on Windows ARM64 devices, specifically targeting Qualcomm Snapdragon X Elite/Plus laptops with Adreno GPUs.
Changes
Build System
Clang/MinGW Compatibility
::std::namespace qualification for clang template resolutionboost::processinline namespace syntax for clangwgc_interop_guids.hheader for WGC GUID constexpr evaluationQualcomm GPU Support
Media Foundation Encoder
mediafoundationencoder with h264_mf, hevc_mf, av1_mf codecsFIXED_GOP_SIZEflag for encoders without on-demand IDR supportDocumentation
docs/BUILD-ARM64.mdbuild guideTesting
Tested on:
What Works
Known Limitations
Checklist