Bug
winml sys reports Machine: AMD64 on Windows ARM64 hosts (Snapdragon X with Prism emulation).
Cause
The project venv uses x64 Python because torch has no Windows-ARM64 wheel. platform.machine() returns the process architecture, not the host. PROCESSOR_ARCHITEW6432 is empty on Snapdragon X — Prism emulation doesn't set it — so reading that env var doesn't help either.
Fix
Use the Win32 IsWow64Process2 API to read the host machine type, falling back to platform.machine() if the call fails.
Repro
On a Snapdragon X dev box using the project's default x64 venv:
- Before:
Machine: AMD64
- After:
Machine: ARM64
Bug
winml sysreportsMachine: AMD64on Windows ARM64 hosts (Snapdragon X with Prism emulation).Cause
The project venv uses x64 Python because
torchhas no Windows-ARM64 wheel.platform.machine()returns the process architecture, not the host.PROCESSOR_ARCHITEW6432is empty on Snapdragon X — Prism emulation doesn't set it — so reading that env var doesn't help either.Fix
Use the Win32
IsWow64Process2API to read the host machine type, falling back toplatform.machine()if the call fails.Repro
On a Snapdragon X dev box using the project's default x64 venv:
Machine: AMD64Machine: ARM64