AppImage: say up front when its renderer needs AVX2 the CPU lacks #414
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!414
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/cpu-without-avx2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #363
Thanks for
2c48613: the build now follows the CPU, which covers the reporter's case (Windows builder, everything compiled locally). I reduced this PR to what that commit leaves open, and dropped my own CPU detection in favour of yours.What is still open
The Linux AppImage's
hookshot_vk.socomes prebuilt from CI (HOOKSHOT_VK_PREBUILT). On a CPU without AVX2 the game is now built for x86-64-v2, but that renderer is still x86-64-v3, so the game stops at its start after the whole build.Change
nx2/host_cpu.py:host_march()moved there unchanged (byte-identical to2c48613), somake_game.pycan ask it without importingbuild.py(which does work at import).build.pyimports it; itsMARCH/CPUlines are untouched.nx2/make_game.py:check_cpu()stops before the game is read, with a plain message pointing to a source build, whenHOOKSHOT_VK_PREBUILTis set and the CPU is not x86-64-v3. A player-setRX_MARCHskips it.scripts/linux/appimage.sh: the prebuilt renderer is pinned toRX_MARCH=x86-64-v3, so withhost_march()it no longer depends on the CI runner's CPU.tests/test_cpu_target.py(game-free, in source-regressions):host_march()on Haswell / Ivy Bridge / Core 2 cpuinfo, an unreadable cpuinfo, and the WindowsIsProcessorFeaturePresentpath (faked);check_cpu()stopping only for the AppImage without AVX2, and running before the game is read.Testing
python -I -B tests/test_cpu_target.py: 9/9 pass; it fails when the AppImage stop is disabled.test_cpp_preflight.pyalready fails onmain; #409 fixes it).If you'd rather keep
host_march()inbuild.py, I can instead havemake_game.pyimport it from there.🤖 Generated with Claude Code
Checked the
no-visual-studiorelease (which closed #363 and its duplicate #410) to confirm the AppImage case this PR covers.I extracted
usr/lib/hookshot/hookshot_vk.sofromHookshot-no-visual-studio-x86_64.AppImage(read from its squashfs, without running it) and disassembled it withobjdump -d. It is built for x86-64-v3 throughout, e.g.:shlx/shrx/sarx/rorx/bzhi/pdep/pext/mulxvpbroadcast*vpsllv/vpsrlv/vpsravvpermd/vpermqvextracti128/vinserti128lzcnt/tzcntmovbeSo on Linux, a CPU like the Xeon E3-1230 v2 from #410 now gets the game built for x86-64-v2 by
host_march(), but the AppImage's renderer still stops at its first AVX2/BMI2 instruction, after the ~40-minute build. The Windows builder compileshookshot_vk.dlllocally, so it isn't affected.check_cpu()in this PR says so before the game is read, and pinningRX_MARCH=x86-64-v3inappimage.shkeeps the prebuilt renderer from depending on the CI runner's CPU.