Bug 99219 - The Stanley Parable GPU hang when starting a new game
Summary: The Stanley Parable GPU hang when starting a new game
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
Depends on:
Reported: 2016-12-29 10:29 UTC by Christoph Haag
Modified: 2017-01-05 13:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

full dmesg (75.48 KB, text/plain)
2016-12-29 19:30 UTC, Christoph Haag

Description Christoph Haag 2016-12-29 10:29:32 UTC
RX 480 with llvm 4.0.0svn_r290670, mesa git

Tested with linux 4.9 and 4.10-rc1, happens on both. Tested with ingame settings medium and highest, happens with both.

This apitrace hangs my GPU: https://haagch.frickel.club/files/stanley_linux.trace.xz

Dez 29 11:21:58 c-l kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, last signaled seq=6391, last emitted seq=6394
Dez 29 11:21:58 c-l kernel: [drm] IP block:gfx_v8_0 is hung!
Comment 1 Christoph Haag 2016-12-29 19:30:02 UTC
Created attachment 128688 [details]
full dmesg

Apparently this didn't attach correctly when I created the bug.
Comment 2 Samuel Pitoiset 2017-01-02 12:48:08 UTC
Thanks for reporting this.

I can reproduce the hang on rx 480 with latest mesa/llvm git.

It hangs at drawcall 674985.

I will investigate.
Comment 3 Samuel Pitoiset 2017-01-02 22:03:11 UTC
It's actually a regression in mesa, works fine with 13.0.2.

After bisecting, the first bad commit is:

commit ed3190b3f3a776fc8c75b1e6130a88079166d115
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Sun Nov 13 18:41:43 2016 +0100

    radeonsi: don't export ClipVertex and ClipDistance[] if clipping is disabled
    This is the first user of optimized monolithic shader variants.
    Cull distances can't be disabled by states.
    Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>

But this doesn't seem to be actually related to the clip planes optimization because
if you replay the trace with R600_DUMP_SHADERS=y, it no longer crashes. If my understanding
is correct, it won't compile shaders asynchronously. Forcing num_compiler_threads = 1 in
si_pipe.c also "fixes" the hang.
Comment 4 Marek Olšák 2017-01-03 10:08:06 UTC
This should fix it:
Comment 5 Christoph Haag 2017-01-03 11:17:11 UTC
The game runs without hangs now. Thanks.
Comment 6 Marek Olšák 2017-01-05 13:02:30 UTC
Fixed by: 3753dc896dfe98b246ba8b030aab27a9928533af

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.