[llvm-bugs] [Bug 33531] New: Incorrect PPC64LE VSX code generated for Mesa 17.1.2 vertex shader program

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 20 11:38:35 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33531

            Bug ID: 33531
           Summary: Incorrect PPC64LE VSX code generated for Mesa 17.1.2
                    vertex shader program
           Product: new-bugs
           Version: 3.9
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: bcrocker at redhat.com
                CC: llvm-bugs at lists.llvm.org, nemanja.i.ibm at gmail.com,
                    ulrich.weigand at de.ibm.com

Overview:

On PPC64LE, some of the Piglit tests fail because erroneous VSX code is
generated for the vertex shader programs; the same tests pass again if
VSX code generation is disabled (i.e. if just Altivec is used).

Steps to reproduce:

ON YOUR PPC64LE TEST SYSTEM:
0) dnf install mesa-dri-drivers glx-utils redhat-rpm-config
1) Download Mesa 17.1.2 (recent release): git clone -b mesa-17.1.2
git://anongit.freedesktop.org/mesa/mesa
2) dnf builddep mesa
3) Build Mesa: in Mesa directory:
   a) RECOMMEND export CFLAGS="-g -O0" ; eqxport CXXFLAGS="-g -O0"
   b) prefix=<where you want to install Mesa, e.g. $HOME/local/lib>
   c) ./autogen.sh --prefix=$prefix \
             --with-dri-drivers=  \
             --with-gallium-drivers=swrast \
             --enable-gallium-llvm \
             --enable-glx-tls \
             --enable-debug
   d) apply the patch to lp_bld_misc.cpp described below
   e) make
   f) make install
   g) make sure your LD_LIBRARY_PATH points to where 'make install' installed,
i.e. to $prefix
4) Back in home directory, download Piglit: git clone
git://anongit.freedesktop.org/piglit
5) Install Piglit build dependencies: dnf builddep piglit; IF problems here,
manually install
- cmake
- python-nose
- chrpath
- libtiff-devel
- python2-numpy
- python3-numpy
- libXrender-devel
- python-lxml
- python3-mako
- libpng-devel
- libpng-tools
- opencl-headers
- ocl-icd-devel
- mesa-libGL-devel
- mesa-libGLU-devel
- mesa-libEGL-devel
- mesa-demos glew glew-devel libGLEW
- waffle-devel
- redhat-rpm-config-40-2.fc24.noarch (may not need this after redhat-rpm-config
above)
6) In Piglit directory: cmake . ; make
7) Create Piglit results directory (NOT in Piglit directory): mkdir
$HOME/piglit-results
8) Run Piglit 'quick' test: in Piglit dir: ./piglit-run.py tests/quick.py
   a) export RESULTDIR=$HOME/piglit-results
   b) export RESULTNAME=q.ppc64le.mesa-17.1.2
   c) ./piglit-run.py tests/quick.py $RESULTDIR/$RESULTNAME

ON YOUR PC running your browser, where you should also have Piglit installed:
9) Create Piglit result directory; recommend $HOME/piglit-results
10) Copy the q.ppc64le.mesa-17.1.2 directory over via SCP or other means
11) Create browser-viewable summary:
   a) in Piglit directory...
   b) export RESULTDIR=$HOME/piglit-results
   c) export RESULTNAME=q.ppc64le.mesa-17.1.2
   d) export SUMMARYNAME=sq.ppc64le.mesa-17.1.2
   e) ./piglit summary html $RESULTDIR/$SUMMARYNAME $RESULTDIR/$RESULTNAME

12) Open the summary in a browser tab:
   a) ^O to open a file;
   b) select .../piglit-results/sq.ppc64le.mesa-17.1.2/index.html
   c) narrow the view by selecting "problems"
   d) find the two tests under arb_vertex_attrib_64bit; click on "fail" in the
rightmost column
   e) Note multiple color discrepancies: Expected 0 255 0 255, Observed 0 0 255
0


Results: See 12(e) immediately above

Expected Results: No color discrepancy messages; "pass"

Additional info:

Installed on my PPC64LE system:
llvm.ppc64le                    3.9.1-2.fc25           @updates                 
llvm-devel.ppc64le              3.9.1-2.fc25           @updates                 
llvm-libs.ppc64le               3.9.1-2.fc25           @updates

Commands to run the failing tests (in Piglit dir):

bin/shader_runner \
   
$HOME/piglit/generated_tests/spec/arb_vertex_attrib_64bit/execution/vs_in/vs-input-float_mat3x4-position-double_dmat4x3.shader_test
-auto -fbo 

bin/shader_runner \
   
$HOME/piglit/generated_tests/spec/arb_vertex_attrib_64bit/execution/vs_in/vs-input-position-double_dmat3-float_mat2_array3.shader_test
-auto -fbo

Enabling/disabling Mesa debug output:

export LIBGL_DEBUG=verbose
export MESA_DEBUG=verbose
export MESA_GLSL=""
export MESA_GLSL="dump log uniform useprog errors"
export GALLIVM_DEBUG="tgsi ir asm dumpbc"
export ST_DEBUG=tgsi

These are very useful when you're debugging Mesa; you will see the
shader program source at several levels, including LLVM IR.
BUT they must all be blank when you're running Piglit, otherwise
the Piglit run will take a VERY long time and the 'summary' step
will not work.

THE TESTS CAN BE MADE TO PASS BY DISABLING VSX code generation; I added
the following patch to lp_bld_misc.cpp to gain finer control over +VSX/-VSX
code generation:

--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -624,7 +624,10 @@
lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
     * See LLVM bug https://llvm.org/bugs/show_bug.cgi?id=26775
     */
    if (util_cpu_caps.has_altivec) {
-      MAttrs.push_back("+vsx");
+      if (getenv("GALLIVM_PPC_NO_VSX"))
+         MAttrs.push_back("-vsx");
+      else
+         MAttrs.push_back("+vsx");
    }
 #endif
 #endif

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170620/c9127c46/attachment.html>


More information about the llvm-bugs mailing list