Bug 105399 - [snb] GPU hang: after geometry shader emits no geometry, the program hangs
Summary: [snb] GPU hang: after geometry shader emits no geometry, the program hangs
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-08 14:52 UTC by komqinxit
Modified: 2018-06-26 06:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
GPU crash dump saved to /sys/class/drm/card0/error (59.87 KB, text/plain)
2018-03-08 14:52 UTC, komqinxit
Details
This program causes the hang (94.46 KB, application/x-xz-compressed-tar)
2018-03-16 13:09 UTC, komqinxit
Details
shader_test to reproduce tihs issue (32.76 KB, text/plain)
2018-06-19 08:38 UTC, asimiklit
Details
Added dump of Geomery Shader (NIR, Assembler) which leads to GPU hang (mesa 1802 dev) (21.61 KB, text/plain)
2018-06-21 13:06 UTC, asimiklit
Details
Added dump of Geometry Shader (NIR, Assembler) where this issue is fixed by workaround v2 in compiller (21.61 KB, text/plain)
2018-06-21 13:09 UTC, asimiklit
Details

Description komqinxit 2018-03-08 14:52:14 UTC
Created attachment 137898 [details]
GPU crash dump saved to /sys/class/drm/card0/error
Comment 1 Elizabeth 2018-03-08 16:00:40 UTC
Hi, could you provide more information about your system and the issue?
Which mesa version are you using?
Comment 2 komqinxit 2018-03-08 16:08:50 UTC
(In reply to Elizabeth from comment #1)
> Hi, could you provide more information about your system and the issue?
> Which mesa version are you using?

Mesa 17.3.6-1, Arch Linux
Comment 3 Elizabeth 2018-03-14 22:54:04 UTC
Any way to reproduce this? Is functional on previous mesa versions or alternative configuration?
Comment 4 komqinxit 2018-03-16 13:09:37 UTC
Created attachment 138154 [details]
This program causes the hang

This program causes the hang. Uncommenting the commented section in "shadershadow.geometry.txt" stops the hang.
Comment 5 Vladimir Los 2018-04-05 08:13:20 UTC
There are such results for the present moment:

There are NO any GPU HANGs (commented out or not the noted section in "shadershadow.geometry.txt").

Tests were ran with mesa 17.3.[6-8].
In mesa 17.3.6 and 17.3.7 an error occured: "Mesa: User error: GL_INVALID_ENUM in glEnable(GL_TEXTURE_2D)" (in main.cpp:707:8)

System:    Kernel: 4.15.14-1-MANJARO x86_64 bits: 64 Desktop: Cinnamon 3.6.6 
           Distro: Manjaro Linux 17.1.7 Hakoila 
CPU:       Topology: Quad Core model: Intel Core i5-3470 type: MCP L2 cache: 6144 KB 
           Speed: 3501 MHz min/max: 1600/3600 MHz Core speeds (MHz): 1: 3534 2: 3583 3: 3588 4: 3551 
Graphics:  Card-1: Intel Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller driver: i915 v: kernel
Comment 6 Vladimir Los 2018-04-05 09:31:36 UTC
Waiting for a SANDYBRIDGE for next steps.
Comment 7 komqinxit 2018-04-06 15:10:15 UTC
I have "Intel(R) Celeron(R) CPU G530 @ 2.40GHz", maybe it matters.
Comment 8 asimiklit 2018-06-19 08:38:42 UTC
Created attachment 140223 [details]
shader_test to reproduce tihs issue

I have reproduced it on SNB.
I think that I found the root cause of the issue.
I have created the patch to fix it:
https://patchwork.freedesktop.org/patch/230255/

I have created shader_test to reproduce this issue also.
Comment 9 asimiklit 2018-06-19 14:37:27 UTC
(In reply to asimiklit from comment #8)
New link of the patch: https://patchwork.freedesktop.org/patch/230342/
Comment 10 asimiklit 2018-06-21 13:06:48 UTC
Created attachment 140260 [details]
Added dump of Geomery Shader (NIR, Assembler) which leads to GPU hang (mesa 1802 dev)
Comment 11 asimiklit 2018-06-21 13:09:42 UTC
Created attachment 140261 [details]
Added dump of Geometry Shader (NIR, Assembler) where this issue is fixed by workaround v2 in compiller
Comment 12 Iago Toral 2018-06-26 06:26:17 UTC
Fixed in master with:

commit 232c5d75ea8c9536a896a17c9156b8e2ad36a779 (HEAD -> master)
Author: Andrii Simiklit <asimiklit.work@gmail.com>
Date:   Fri Jun 22 10:59:57 2018 +0300

    i965/gen6/gs: Handle case where a GS doesn't allocate VUE
    
    We can not use the VUE Dereference flags combination for EOT
    message under ILK and SNB because the threads are not initialized
    there with initial VUE handle unlike Pre-IL.
    So to avoid GPU hangs on SNB and ILK we need
    to avoid usage of the VUE Dereference flags combination.
    (Was tested only on SNB but according to the specification
    SNB Volume 2 Part 1: 1.6.5.3, 1.6.5.6
    the ILK must behave itself in the similar way)
    
    v2: Approach to fix this issue was changed.
    Instead of different EOT flags in the program end
    we will create VUE every time even if GS produces no output.
    
    v3: Clean up the patch.
    Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105399
    CC: <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
    Tested-by: Mark Janes <mark.a.janes@intel.com>


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.