Page 1 of 1

VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 15:19
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.

Re: VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 15:36
by mpack
VirtualBox is not a CPU simulator. Code runs on the native CPU, which supports whatever instructions it supports.

Re: VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 18:46
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.

Re: VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 19:15
by michaln
AVX is not currently supported in VMs.

Re: VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 20:54
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?

Re: VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 21:37
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...

Re: VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 21:41
by Perryg
Yeah pretty much like VT-d. Support had to be added in the VBox code as well.

Re: VirtualBox Support for AVX Instructions

Posted: 26. Mar 2012, 22:51
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.

Re: VirtualBox Support for AVX Instructions

Posted: 27. Mar 2012, 11:04
by mpack
Ah, I see. Thanks all.

Re: VirtualBox Support for AVX Instructions

Posted: 10. Nov 2012, 23:14
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?

Re: VirtualBox Support for AVX Instructions

Posted: 11. Nov 2012, 12:53
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.

Re: VirtualBox Support for AVX Instructions

Posted: 11. Nov 2012, 13:10
by mpack
You also misquoted me. Michaln said that, not me.

Re: VirtualBox Support for AVX Instructions

Posted: 11. Nov 2012, 18:32
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.

Re: VirtualBox Support for AVX Instructions

Posted: 13. Nov 2012, 19:57
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: )