You need to enable JavaScript to run this app. 如何在VirtualBox的Ubuntu虚拟机中成功启用AVX/AVX2指令集
优惠活动
大模型
产品
解决方案
定价
更多

如何在VirtualBox的Ubuntu虚拟机中成功启用AVX/AVX2指令集

核心摘要
  • TensorFlow 1.15在虚拟机中被Python导入时发生崩溃,报错信息为Illegal instruction (core dumped),问题大概率是虚拟机环境中AVX、AVX2指令集被禁用导致的。
  • 主机为Windows 10 64位系统,支持AVX与AVX2指令集(已通过Cygwin验证,详情见下文),搭载CPU型号为Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz。
  • 客户机运行在VirtualBox 6.1.16上,系统为Ubuntu 20.04 64位(Ubuntu 18.04也存在相同问题),系统层面未识别到AVX与AVX2指令集。
  • 已参照现有技术帖子的建议,在主机上执行两条配置命令,分别为VBoxManage setextradata "Ubuntu20" VBoxInternal/CPUM/IsaExts/AVX 1、VBoxManage setextradata "Ubuntu20" VBoxInternal/CPUM/IsaExts/AVX2 1,执行完成后重启客户机(该客户机名称为Ubuntu20),配置完全未生效。

请问有什么可行的解决建议吗?

详细环境信息

在主机端通过Cygwin执行cat /proc/cpuinfo的输出显示,主机CPU包含avx、avx2指令集标识,关键输出片段如下:

.....
processor       : 7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 158
model name      : Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
stepping        : 9
cpu MHz         : 3600.000
cache size      : 256 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts
 acpi mmx fxsr sse sse2 ss ht tm pbe pni dtes64 est tm2 ssse3 fma cx16 xtpr pdcm sse4_1 sse4_2 movbe 
popcnt aes xsave osxsave avx f16c rdrand hypervisor lahf_lm ida xsaveopt pln pts dtherm fsgsbase 
tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt
TLB size        : 0 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

在客户机端执行cat /proc/cpuinfo的输出显示,客户机CPU标识列表缺失avx、avx2指令集,关键输出片段如下:

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 158
model name  : Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
stepping    : 9
microcode   : 0xffffffff
cpu MHz     : 3599.996
cache size  : 8192 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 22
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 rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid 
tsc_known_freq pni ssse3 pcid sse4_1 sse4_2 hypervisor lahf_lm invpcid_single pti fsgsbase invpcid 
md_clear flush_l1d arch_capabilities
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips    : 7199.99
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

内容的提问来源于stack exchange,提问作者SomethingSomething

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.08 01:15:09