VirtualBox Support for AVX Instructions

This is for discussing general topics about how to use VirtualBox.
Post Reply
Marco Polo
Posts: 2
Joined: 26. Mar 2012, 15:05

VirtualBox Support for AVX Instructions

Post by Marco Polo »

Does VirtualBox support the AVX instructions, which came out last year with the Sandy Bridge processor? I'm trying to run the latest Intel MKL on VirtualBox, but it doesn't seem to be working, and I suspect it has something to do with this.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox Support for AVX Instructions

Post by mpack »

VirtualBox is not a CPU simulator. Code runs on the native CPU, which supports whatever instructions it supports.
Marco Polo
Posts: 2
Joined: 26. Mar 2012, 15:05

Re: VirtualBox Support for AVX Instructions

Post by Marco Polo »

Something on my system was not supporting AVX, either the host (Windows 7 SP1) or guest (Ubuntu 11.10). Anyway, I worked around the issue by using MKL 10.2 (instead of 10.3), in case anyone else has a similar problem. Thanks for your help.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: VirtualBox Support for AVX Instructions

Post by michaln »

AVX is not currently supported in VMs.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox Support for AVX Instructions

Post by mpack »

? Michal, can you explain? Why does the VM care what instructions the processor executes? Do you have to enable specific instruction groups somewhere?
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

Re: VirtualBox Support for AVX Instructions

Post by Leak »

mpack wrote:? Michal, can you explain? Why does the VM care what instructions the processor executes? Do you have to enable specific instruction groups somewhere?
I'm pretty sure AVX has some extra state compared to MMX/SSE that would have to be (re-)stored by the hypervisor on a context switch...
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox Support for AVX Instructions

Post by Perryg »

Yeah pretty much like VT-d. Support had to be added in the VBox code as well.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: VirtualBox Support for AVX Instructions

Post by michaln »

mpack wrote:? Michal, can you explain? Why does the VM care what instructions the processor executes? Do you have to enable specific instruction groups somewhere?
There's more CPU state to save/restore. For all SSE variants I think the state was the same, so for those it was just a question letting the relevant CPUID feature bit through. AVX needs more work, and so far there's been no real need to do that work.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox Support for AVX Instructions

Post by mpack »

Ah, I see. Thanks all.
p3r
Posts: 3
Joined: 10. Nov 2012, 22:30

Re: VirtualBox Support for AVX Instructions

Post by p3r »

mpack wrote:AVX needs more work, and so far there's been no real need to do that work.
Ouch! Perhaps I'm exotic but the lack of AVX2 support in VirtualBox has become (a very late and painful) showstopper for me. I'm developing a number-crunching application for multiple OSs and platforms. I use the otherwise excellent VirtualBox to keep all these platforms and development environments migratable and under control on the same host. (The application is however executed on "real" platforms.)

At this point I'm optimizing the software using Intel's AVX2 instructions. Today I got a real shock when I discovered that VirtualBox doesn't support all Intel SIMD instructions (AVX2 for example) although the host CPU does.

Then I was even more worried when I read your post so I just wanted to humbly inform you that there is a real need for this support, at least from me.

Are there no chances whatsoever that AVX2 support will be added in the near future? Or at all?
p3r
Posts: 3
Joined: 10. Nov 2012, 22:30

Re: VirtualBox Support for AVX Instructions

Post by p3r »

Woops. I was a bit too eager. The AVX2 instruction set is not even available until 2013... The AVX set will have to do until then I guess.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox Support for AVX Instructions

Post by mpack »

You also misquoted me. Michaln said that, not me.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: VirtualBox Support for AVX Instructions

Post by michaln »

p3r wrote:Are there no chances whatsoever that AVX2 support will be added in the near future? Or at all?
Assuming you're talking about AVX and not AVX2... the schedule depends on demand from paying customers. That's all I can say.
p3r
Posts: 3
Joined: 10. Nov 2012, 22:30

Re: VirtualBox Support for AVX Instructions

Post by p3r »

mpack wrote:You also misquoted me. Michaln said that, not me.
Yes, I apologize. I screwed up when deleting text I didn't want to quote.
michaln wrote:
p3r wrote:Are there no chances whatsoever that AVX2 support will be added in the near future? Or at all?
Assuming you're talking about AVX and not AVX2... the schedule depends on demand from paying customers. That's all I can say.
OK, fair enough. Until CPUs with AVX2 support is available I hope to cope with the SSE instruction set actually. Thank you all. (And thanks for providing VB to freeloaders like me :wink: )
Post Reply