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

AVX2 detection problem #1764

Open
EricDeveaud opened this issue Nov 22, 2024 · 1 comment
Open

AVX2 detection problem #1764

EricDeveaud opened this issue Nov 22, 2024 · 1 comment

Comments

@EricDeveaud
Copy link

Hello,

while running cmake for hyphy-2.5.63

I observe the following

-- Performing Test HAVE_AVX_EXTENSIONS
-- Performing Test HAVE_AVX_EXTENSIONS - Failed
-- Performing Test HAVE_SSE4_EXTENSIONS
-- Performing Test HAVE_SSE4_EXTENSIONS - Success

while lscpu claims that avx and avx2 are available on the host I'm building.
see

build [rpm]:tmp/build > lscpu
Architecture:         x86_64
CPU op-mode(s):       32-bit, 64-bit
Byte Order:           Little Endian
CPU(s):               128
On-line CPU(s) list:  0-63
Off-line CPU(s) list: 64-127
Thread(s) per core:   1
Core(s) per socket:   32
Socket(s):            2
NUMA node(s):         2
Vendor ID:            AuthenticAMD
CPU family:           23
Model:                49
Model name:           AMD EPYC 7452 32-Core Processor
Stepping:             0
CPU MHz:              2350.000
CPU max MHz:          2350.0000
CPU min MHz:          1500.0000
BogoMIPS:             4699.92
Virtualization:       AMD-V
L1d cache:            32K
L1i cache:            32K
L2 cache:             512K
L3 cache:             16384K
NUMA node0 CPU(s):    0-31
NUMA node1 CPU(s):    32-63
Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd amd_ppin arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sme sev sev_es

and gcc knnows how to handle it.

gcc -mavx2 -dM -E - < /dev/null | egrep "SSE|AVX" | sort
#define __AVX2__ 1
#define __AVX__ 1
#define __SSE2_MATH__ 1
#define __SSE2__ 1
#define __SSE3__ 1
#define __SSE4_1__ 1
#define __SSE4_2__ 1
#define __SSE_MATH__ 1
#define __SSE__ 1
#define __SSSE3__ 1

regards

Eric

@spond
Copy link
Member

spond commented Nov 22, 2024

Dear @EricDeveaud,

Thanks for reporting. Our checks for AVX are based on the ability of gcc to successfully compile the following trivial bit of code (

check_cxx_source_runs("
)

 #include <immintrin.h>
      #include <stdio.h>

      int main ()
      {
          __m256d a, b;
          double vals[4] = {0.};
          a = _mm256_loadu2_m128d (vals, vals+2);
          b = _mm256_permute4x64_pd (_mm256_hadd_pd (a,a), 2);
          _mm256_storeu_pd (vals, b);
          printf (\"%g\", vals[0]);
          return (0);
      }

Presumably, this fails on your system. Would you be able to save the following code to a test.c file, try to compile it with gcc and see what the result/errors are? This may be informative.

Best,
Sergei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants