[Mesa-dev] [Bug 68297] New: Mesa tries to detect AVX support and fails horribly

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Aug 19 17:03:23 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=68297

          Priority: medium
            Bug ID: 68297
          Assignee: mesa-dev at lists.freedesktop.org
           Summary: Mesa tries to detect AVX support and fails horribly
          Severity: major
    Classification: Unclassified
                OS: Linux (All)
          Reporter: delroth at gmail.com
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: git
         Component: Other
           Product: Mesa

src/gallium/auxiliary/util/u_cpu_detect.c:         util_cpu_caps.has_avx    =
((regs2[2] >> 28) & 1) && // AVX

This is wrong. To check for AVX support, you need to:
1. Check if the AVX bit is set in cpuid (DONE)
2. Check if the XSAVE bit is set in cpuid (NOT DONE)
3. Check if xgetbv with ecx=0 & XFEATURE_ENABLED_MASK == XFEATURE_ENABLED_MASK
(NOT DONE)

See, for example:
https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?r1=180991&r2=180990&pathrev=180991
https://code.google.com/p/dolphin-emu/source/detail?r=377202b9f6154ae56c5b2f0a45e235ceaeb6da9c

Intel have some reference material about that but software.intel.com seems to
be down at the moment.

When trying to run llvmpipe on a machine with hardware AVX support but no
kernel support for it, it currently SIGILLs.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130820/fbb4f93a/attachment.html>


More information about the mesa-dev mailing list