Skip to content
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

Fix detection of AVX2 #222

Closed
k0ekk0ek opened this issue Aug 1, 2024 · 0 comments · Fixed by #223
Closed

Fix detection of AVX2 #222

k0ekk0ek opened this issue Aug 1, 2024 · 0 comments · Fixed by #223
Labels
bug Something isn't working
Milestone

Comments

@k0ekk0ek
Copy link
Contributor

k0ekk0ek commented Aug 1, 2024

@wekers trying out NSD 4.10.0 on FreeBSD reported nsd-checkzone crashing with "Illegal instruction (core dumped)" (see NLnetLabs/nsd#361). @wekers was kind enough to help out with debugging and it seems there's a bug in ISA detection. The ebx for CPUID with eax=0x7 has bit 5 set (AVX2). However, basing the decision on whether AVX2 is actually available on the system requires bit 28 (AVX instructions supported) being set in ecx with eax=0x1. Apart from that, we must also check if the operating system properly supports it.

Peter Cordes (as always) provides excellent explanations (1, 2) on Stack Overflow.

See Félix Cloutier's pages on CPUID and XGETBV for detailed information on the aforementioned instructions.

@k0ekk0ek k0ekk0ek added the bug Something isn't working label Aug 1, 2024
@k0ekk0ek k0ekk0ek added this to the Release 0.1.1 milestone Aug 1, 2024
k0ekk0ek added a commit to k0ekk0ek/simdzone that referenced this issue Aug 1, 2024
k0ekk0ek added a commit to k0ekk0ek/simdzone that referenced this issue Aug 1, 2024
k0ekk0ek added a commit to k0ekk0ek/simdzone that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant