我正在尝试在装有 Ubuntu 20.04 的机器上启用 AVX2。
我已运行以下命令来安装 AVX2:
Update the package index:
# sudo apt-get update
Install libmkl-avx2 deb package:
# sudo apt-get install libmkl-avx2
按照:
https://ubuntu.pkgs.org/20.04/ubuntu-multiverse-amd64/libmkl-avx2_2020.0.166-1_amd64.deb.html
处理器是:
processor : 0
vendor_id : AuthenticAMD
cpu family : 21
model : 2
model name : AMD FX-8320E Eight-Core Processor
stepping : 0
microcode : 0x6000852
cpu MHz : 2036.567
cache size : 2048 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 16
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
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>
bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips : 6422.00
TLB size : 1536 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro
但是在 cpuinfo 中检查 avx 时我只看到 avx,而看不到 avx2:
grep avx /proc/cpuinfo
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 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
我做错了什么?我需要以某种方式启用 AVX2 吗?
如果有人想知道我是否在问如何安装 AVX2。我不是。它们已经安装了。只是由于某种原因不可用/无法被 CPU 识别。见下文:
root@home:~$ sudo apt-get install libmkl-dev libmkl-avx2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmkl-avx2 is already the newest version (2020.0.166-1).
libmkl-dev is already the newest version (2020.0.166-1).
0 upgraded, 0 newly installed, 0 to remove and 141 not upgraded.