Bug 70445

Summary: [IVB/HSW/BYT] unigine-tropics v1.3 performance reduced ~50%
Product: Mesa Reporter: zhoujian <jianx.zhou>
Component: Drivers/DRI/i965Assignee: Eric Anholt <eric>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: high CC: eero.t.tamminen, eric
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description zhoujian 2013-10-14 08:34:11 UTC
System Environment:       
----------------------------------------------
Platform:IVB/HSW
Libdrm: (master)2.4.47
Mesa:	(master)8958741e5a0c3cce95f0415ce8e6e8e840a5207d
Xserver:(master)xorg-server-1.14.99.2-7-g44d502c6f1d03a9e548
Xf86_video_intel:(master)2.99.904-10-ge914dada5595a24b5d0fada
Cairo:	(master)6f05ecf488314e4b0c6c6b0110963c449bebe7d7
Kernel:	(drm-intel-nightly) 55d077d2efad373f7b36c8ae50f4205f652dea83

Bug detailed description:
----------------------------------------------
unigine-tropics v1.3 performance reduced ~50%. The problem exists on both gnome-session and Raw X.
It’s Mesa regression, bisecting show that the first bad commit is:
commit 36fbe66d3a71df76fcb6f915846da4471b3a8442
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Oct 9 17:17:59 2013 -0700
i965/fs: Convert gen7 to using GRFs for texture messages.

Performance
--------------------------------------------------------------------
Test tropics on HSW mobile GT3e with Raw X
git-36fbe66:  12.02
git-ee21c8b:  26.00

Reproduce steps:
---------------------------------------------
1, xinit&
2. export LD_LIBRARY_PATH=bin/:$LD_LIBRARY_PATH 
export force_glsl_extensions_warn=true
vblank_mode=0 ./bin/Tropics -video_app opengl -data_path ../ -sound_app null -system_script tropics/unigine.cpp -engine_config ../data/unigine.cfg -video_mode -1 -video_fullscreen 1 -video_multisample 0 -extern_define PHORONIX -video_width 1920 -video_height 1080
Comment 1 Eero Tamminen 2013-10-14 13:44:33 UTC
I see that according to your numbers, on BYT and HSW ULT, Lightsmark improved by a third.  Based on Eric's commit comment, that would be explained by the same change.  Lightsmark didn't improve on other HW which is somewhat strange considering how their GPU / memory bandwidth ratios sit between BYT & HSW ULT...

Looking at the numbers for different machines around the time this change happened, the drop in Unigine Tropics FPS was smallest for IVB (desktop), a third, larger for BYT and largest for HSW, about half.

Changes for the other internal tests were clearly smaller (e.g. 10% drop for UrbanTerror, but for some reason only on HSW desktop).  Those could be unrelated.
Comment 2 Eric Anholt 2013-10-15 21:08:33 UTC
http://lists.freedesktop.org/archives/mesa-dev/2013-October/046400.html

The top FS spills both before texture-grf and after this patch, and I haven't retested to see if it fully fixes any regression.

There's a lot more work that could be done on that shader, before and after.  http://dri.freedesktop.org/wiki/I965Todo/ updated.
Comment 3 meng 2013-10-16 09:27:51 UTC
(In reply to comment #2)
> http://lists.freedesktop.org/archives/mesa-dev/2013-October/046400.html
> 
> The top FS spills both before texture-grf and after this patch, and I
> haven't retested to see if it fully fixes any regression.
> 
> There's a lot more work that could be done on that shader, before and after.
> http://dri.freedesktop.org/wiki/I965Todo/ updated.
With above patch, the performance problem still exists on IVB.
Comment 4 Eric Anholt 2013-10-31 03:50:40 UTC
Once GLSL CSE lands, we're down to -10.7162% +/- 0.476574% on my IVB.
Comment 5 meng 2013-11-04 09:01:31 UTC
(In reply to comment #4)
> Once GLSL CSE lands, we're down to -10.7162% +/- 0.476574% on my IVB.

With the latest driver,unigine-tropics got 19.4186 fps.
So now, unigine-tropics reduced ~25%(26 fps ->19.4186 fps).
-------------------------------------------------
Libdrm:(master)2.4.47-2-g45810d3d7546f3ddbcdae114c6726ada30e919c9
Mesa:  (master)723f047a3bc21b536d27ab1c0d6cc82f93002648
Xserver:(master)xorg-server-1.14.99.3-24-g902ff0b3497d202b86bf9a411e17db7b694d6eaa
Xf86_video_intel:(master)2.99.905-43-g82e6d41c2f4f343bd1854d3d8ee4b624b5d68971
Cairo:	(master)98fef3cef2d0f7f463a2e4f9f1b35b09f7b6ea77
Libva:	(staging)1a011ce5bb0b80506797a25a988854f3f81ce909
Libva_intel_driver:(staging)1cee858036a87837deddc87586701ed869f96
Comment 6 Eric Anholt 2013-11-12 23:22:22 UTC
commit e9daead784921e453906853a4a78a2f3135af2e0
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Nov 6 17:38:23 2013 -0800

    i965/fs: Try a different pre-scheduling heuristic if the first spills.
Comment 7 meng 2013-11-13 01:07:04 UTC
Verified it with above commit git-e9daead78492.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.