2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Virtual Box上でCPU拡張命令セット(AVX2)を有効化(Windows)

Posted at

素でVBのVMを作ると新しめのCPU拡張命令セットは入っていない。

user1@my-VirtualBox:~$ cat /proc/cpuinfo | grep flags
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 pni pclmulqdq ssse3 cx16 pcid 
sse4_1 sse4_2 movbe popcnt aes rdrand hypervisor lahf_lm abm 3dnowprefetch
invpcid_single pti fsgsbase bmi1 bmi2 invpcid rdseed clflushopt
md_clear flush_l1d arch_capabilities

VMを落とした状態で、ホストOS側のコマンドラインで以下のコマンドを実施。

> VBoxManage setextradata "Ubuntu-BC" VBoxInternal/CPUM/IsaExts/AVX2 1
> VBoxManage setextradata "Ubuntu-BC" VBoxInternal/CPUM/IsaExts/AVX 1
> VBoxManage getextradata "Ubuntu-BC"
Key: GUI/LastCloseAction, Value: PowerOff
Key: GUI/LastGuestSizeHint, Value: 1920,1018
Key: GUI/LastNormalWindowPosition, Value: 0,23,1920,1057,max
Key: VBoxInternal/CPUM/IsaExts/AVX, Value: 1
Key: VBoxInternal/CPUM/IsaExts/AVX2, Value: 1

Windowsの場合、グループデバイスポリシーエディタ(gpedit.msc)で
「コンピュータの構成>管理用テンプレート>Device Guard>仮想化ベースのセキュリティを有効にする」を無効にする。

さらにHyper-V仮想化を無効(bcdedit /set hypervisorlaunchtype off)にし、VBの準仮想化IFにHyper-V以外(KVMなど)を選択。

そうすると、ゲストOSのUbuntu側で

user1@my-VirtualBox:~/Desktop$ cat /proc/cpuinfo | grep flags
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 pclmulqdq ssse3 cx16 pcid
sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch
invpcid_single pti fsgsbase bmi1 avx2 bmi2 invpcid rdseed clflushopt
md_clear flush_l1d arch_capabilities

という風に拡張命令セットが有効になった状態になる。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?