Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to play with the new AVX instructions. I saw that QEMU might have support, so I built it from Git (yesterday). I set the CPU to SandyBridge and I booted Tiny Core Linux. TCL has kernel 3.0 and Wikipedia claims Linux got AVX support in 2.6.30. TCL works with AVX in Bochs too. But when I cat /proc/cpuinfo when running in QEMU, avx is missing from flags:

$ cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 42
model name  : Intel Xeon E312xx (Sandy Bridge)
stepping    : 1
cpu MHz     : 1861.924
cache size  : 4096 KB
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up pni cx16 popcnt hypervisor lahf_lm
bogomips    : 3725.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

$

How do I get AVX support in QEMU?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted
+50

It seems like if a defined feature is not available, it will fail silently by default (source). Qemu can emulate some instruction sets not supported by the host CPU, but I'm not sure if AVX is among them (or not yet).

Ensure that all the libraries used by Qemu, and especially libvirt, are up to the right level. You could also try the qemu-kvm parameters of -cpu sandyBridge,+avx,enforce. See also if this thread is useful.

For AVX and other new instruction set extensions, Intel provides an emulator:
Intel Software Development Emulator.
You could maybe use it instead, for gaining experience with AVX.

share|improve this answer
    
Yes, thank you very much. I realize that QEMU requires host support since I now know about the check flag and it triggers warnings, even about SSE 4.1. I'm using Bochs now but I might try Intel SDE later since Bochs has high CPU utilization even though I run it at 50 Mhz and with the idle hack. I don't have hardware virtualization support, so I can't use KVM. Bochs has support for more CPU features than real CPU's though. My current Bochs setup has SSE 4.2, 4.3, FMA3 and 4! Thanks again. –  Janus Troelsen Jul 28 '12 at 19:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.