4 ms·
Do those programs blindly try to execute AVX instructions without checking whether they’re supported? What happens if you're just running on an older intel proc
by beervirus 6y ago
Do those programs blindly try to execute AVX instructions without checking whether they’re supported? What happens if you're just running on an older intel processor?
- saagarjha 6y agoUsually you'd want to check cpuid or similar and fall back to something reasonable.
- jayyhu 6y agoApple seems to suggest that all well behaving programs: >use the sysctlbyname function to check the hw.optional.avx512f attribute So my guess it they probably just replace the AVX instructions with no-ops and let it blow up if the correct checks/fallbacks aren't in place.
- monocasa 6y agoOr just SIGILL rather than noop.
- throwaway2048 6y agoit would be a lot more normal to trap the illegal instruction, the same thing that happens if you give a CPU a nonsense nonexistent instruction.
- makomk 6y agoAll well-behaving software will of course check if AVX is supported before trying to use it, but at least in some cases that just means they'll refuse to install or run on systems that don't have it: https://www.pro-tools-expert.com/production-expert-1/2019/9/5/is-this-software-issue-the-final-curtain-call-for-old-mac-pro-cheese-graters-used-in-todays-recording-studios https://www.pro-tools-expert.com/production-expert-1/2019/9/... (Developing parallel code paths and keeping them working indefinitely is a lot of extra work, and AVX has been around for close to a decade at this point.)
- giantrobot 6y agoMost heavy math libraries that use AVX do function multiversioning. When calling the function it does a CPUID instruction check and then picks a code path appropriate for the CPU. Intel's MKL gets flak for this because non-Intel CPU's always fall back to the least optimal path even if they support a more efficient path. I think you'd be hard pressed to find programs using AVX that didn't do some sort of feature check. While AVX debuted with Sandy Bridge in 2011, Intel's Celeron/Pentium branded CPUs don't support those instructions (or didn't for a long time).