Bug 64471 - Radeon HD6570 lockup in Brütal Legend with HyperZ
Radeon HD6570 lockup in Brütal Legend with HyperZ
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600
git
x86-64 (AMD64) Linux (All)
: medium major
Assigned To: Default DRI bug account
:
: 64933 71046 (view as bug list)
Depends on:
Blocks: 75112
  Show dependency treegraph
 
Reported: 2013-05-11 13:02 UTC by Zoltán Böszörményi
Modified: 2015-02-07 13:43 UTC (History)
7 users (show)

See Also:


Attachments
Lockup from "new game" (96.49 KB, text/plain)
2013-05-11 13:02 UTC, Zoltán Böszörményi
Details
Lockup from "continue" (88.14 KB, text/plain)
2013-05-11 13:02 UTC, Zoltán Böszörményi
Details
Xorg.log with HyperZ enabled and GPU lockup on HD 6530D (62.86 KB, text/plain)
2013-10-31 02:53 UTC, Johannes Hirte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltán Böszörményi 2013-05-11 13:02:12 UTC
Created attachment 79165 [details]
Lockup from "new game"

I tried Brütal Legend on Fedora 18/x86_64, the game itself if i386.
The system has these newer-than-Fedora18 components:
kernel 3.9+ (commit 51a26ae7a14b85c99c9be470c2d28eeeba0f26a3)
libdrm 2.4.44 from 2.4.44-2.fc20 SRPM from Koji recompiled on F18
llvm-3.3 from May 7, before branching to 3.3 was done
mesa 9.2 from May 7, commit was around 03ef60681e61a52dee7fa3285618c313cf13f50c
compiled into an RPM with float textures enabled:

$ rpm -q mesa-libGL
mesa-libGL-9.2-0.1.fc18.x86_64
mesa-libGL-9.2-0.1.fc18.i686

The game makes the Radeon chip lock up, reliably at the same point,
which is when the game starts after the long cutscene.

Attached are two dmesgs, showing the same lockup.
The first occurred when I started a new game and watched through the cutscene.
The second occurred when I tried to continue the auto-saved game.
Comment 1 Zoltán Böszörményi 2013-05-11 13:02:46 UTC
Created attachment 79166 [details]
Lockup from "continue"
Comment 2 Alex Deucher 2013-05-11 19:36:23 UTC
Does disabling hyperZ help?  set env var R600_HYPERZ=0
Comment 3 Zoltán Böszörményi 2013-05-12 06:27:30 UTC
Yes, it does. Thanks.

Now it doesn't lock up but the reflection of fire(? it must be fire, considering the surroundings) on the face of the hero is wrong. It looks metallic and can be described as bad rendering. (It is a different bug.)

I had these set previously, but I can see they are gone from the r600g sources:

$ set | grep R600
R600_ENABLE_S3TC=1
R600_STREAMOUT=1
R600_TILING=1

Now, which R600_DEBUG options do you suggest running the game with, so I can provide you with more in-depth information?
Comment 4 Zoltán Böszörményi 2013-05-12 06:47:05 UTC
FYI, the "r600g: force full cache for hyperz" patch is in the source of my RPMs.
Comment 5 Zoltán Böszörményi 2013-05-24 17:08:38 UTC
The lockup also happens with mesa commit
0b5b3f8816f9cb5a2b2259176b4c7dd9e4d31233 and llvm-3.3,
whatever commit it is at in current Fedora 19 beta.
Comment 6 Alex Deucher 2013-05-29 03:30:11 UTC
*** Bug 64933 has been marked as a duplicate of this bug. ***
Comment 7 Nicholas Miell 2013-06-10 22:43:11 UTC
Also affects Double Fine's The Cave
Comment 8 Andre Heider 2013-08-05 09:01:16 UTC
Seeing the same thing on "The Cave" with -rc3 and recent Mesa
Comment 9 Alex Deucher 2013-10-30 14:14:17 UTC
*** Bug 71046 has been marked as a duplicate of this bug. ***
Comment 10 Johannes Hirte 2013-10-31 02:51:21 UTC
Also seen on HD 6530D, but it's not only the HyperZ. After disabling it the game works, but there are still screen corruptions.
Comment 11 Johannes Hirte 2013-10-31 02:53:27 UTC
Created attachment 88389 [details]
Xorg.log with HyperZ enabled and GPU lockup on HD 6530D
Comment 12 Andre Heider 2013-11-12 11:19:49 UTC
I tried this game again and the issue is still present.
Tested with 3.12 and recent mesa (head: f0f202e6b764be803470e27cba9102f14361ae22).

However, with a current apitrace it's now possible to trace and replay it on r600g to provoke the GPU reset. Using past apitraces makes the game work without traces/glitches.
I'm using apitrace head 0227203a229e85f98a491c6b9480c0bc210f1dbb, I didn't test if a replay with older versions yields the hang.

I've uploaded a trace here (~260MiB):
http://static.hackmii.com/dhewg/brutalz.trace.xz

Replaying that without R600_HYPERZ reliably reproduces GPU hangs on my BARTS card. Replaying it with R600_HYPERZ=0 makes the hangs go away, but you'll see glitches on the hero's face (effects like described above).

Note: Trace is 1920x1200 fullscreen. Windowed mode or different resolutions didn't always lockup. I tried to trim the trace down, but apitrace choked on it.
Comment 13 Edmondo Tommasina 2013-12-25 16:10:39 UTC
Issue reproduced reliably on Radeon HD5850 (Evergreen) with default settings.

Kernel: 3.12
Libdrm: 2.4.50
Mesa: 10.0.1
Comment 14 Edmondo Tommasina 2014-01-23 20:39:05 UTC
Just for the log.

Kernel, libdrm and mesa updated. Issue reproduced with HYPERZ active.

Kernel: 3.13.0
Libdrm: 2.4.51
Mesa: 10.0.2

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD CYPRESS
OpenGL core profile version string: 3.1 (Core Profile) Mesa 10.0.2
OpenGL core profile shading language version string: 1.40
OpenGL version string: 3.0 Mesa 10.0.2
OpenGL shading language version string: 1.30
Comment 15 Samir Ibradžić 2014-02-06 16:50:07 UTC
I have the similar issue with radeonsi. The problem is bit more severe on si, cause whole X session would die, probably due to glamor...

Kernel: 3.13.0
Libdrm: 2.4.52+git128e74
Mesa 10.1.0-devel (git-dc00ec1)

OpenGL renderer string: Gallium 0.4 on AMD TAHITI
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.0-devel (git-dc00ec1 saucy-oibaf-ppa+curaga)
OpenGL core profile shading language version string: 3.30

Starting Brutal Legend with disabled HyperZ makes the problem go away:
R600_DEBUG=nohyperz ./.local/share/Steam/SteamApps/common/BrutalLegend/Buddha.bin.x86
Comment 16 Hamish Wilson 2014-02-07 17:58:57 UTC
Bug still occurs with a Radeon HD 5750 on Fedora 20 x86_64 running Linux 3.12.9
and Mesa 9.2.5. Disabling HyperZ by entering "export R600_HYPERZ=0" into a terminal before launching Brütal Legend stops the crashes.

Interestingly, it does not show up with my Radeon HD 4670 on Arch i386 running Linux 3.12.9 and Mesa 10.0.3 - although it should be noted that the problem was still not in evidence before I upgraded the system to the latest stable version of Mesa.
Comment 17 Laurent carlier 2014-02-10 21:19:47 UTC
I can also reproduce the lockup with a Pitcain card mesa-git/llvm-svn with Brutal Legend game. Disabling hyperz fix the issue.

I've uploaded a trace here: http://pkgbuild.com/~lcarlier/traces/BrutalLegend.trace.tar.xz

With this one i can reproduce the lockup.
Comment 18 Hamish Wilson 2014-02-17 21:09:04 UTC
Is everyone that is having issues using x86_64? The main difference between my Arch system and the Fedora 20 system is that I am using i386 instead.
Comment 19 Nicholas Miell 2014-02-18 06:42:04 UTC
The Cave will now reliably crash the (Radeon HD 6770) GPU with HyperZ disabled.
Comment 20 Edmondo Tommasina 2014-02-18 06:48:40 UTC
(In reply to comment #18)
> Is everyone that is having issues using x86_64? The main difference between
> my Arch system and the Fedora 20 system is that I am using i386 instead.

Yes, I'm using x86_64.
Comment 21 Michel Dänzer 2014-02-18 07:32:18 UTC
(In reply to comment #19)
> The Cave will now reliably crash the (Radeon HD 6770) GPU with HyperZ
> disabled.

Please file your own report for that. This report is about Brütal Legend, which only seems problematic with HyperZ enabled.
Comment 22 Samir Ibradžić 2014-02-18 15:36:10 UTC
yes, x86_64 here as well
Comment 23 Zoltán Böszörményi 2014-02-18 16:05:22 UTC
x86_64 here, too.
Comment 24 Marek Olšák 2014-08-24 13:40:54 UTC
Thanks a lot for the apitrace.

Temporary workaround that shouldn't decrease htile Z performance is here:
http://lists.freedesktop.org/archives/mesa-dev/2014-August/066519.html
Comment 25 Edmondo Tommasina 2014-08-25 19:07:15 UTC
Tested-By: Edmondo Tommasina

Applied PATCH 1/6, tested with R600_HYPERZ=1 and it fixes lockup.

Test environment:

Kernel: 3.16.1
Libdrm: 2.4.56
Mesa: from git (83503f9e) + your PATCH 1/6

OpenGL renderer string: Gallium 0.4 on AMD CYPRESS
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.4.0-devel (git-8f06d72)
OpenGL core profile shading language version string: 3.30


HUGE THANKS Marek!
Comment 26 Marek Olšák 2014-09-01 19:35:05 UTC
The patch has been committed, but it's a workaround, not a fix. I think this bug should remain open until a proper fix has been found.
Comment 27 Clément Guérin 2014-12-29 21:34:34 UTC
Latest Arch Linux with today's mesa-git and llvm-git, I'm getting a GPU lockup after the intro, when beating up the three druids. HD 7950

I tried without HyperZ and with the lowest visual settings but it doesn't change anything.
Comment 28 Clément Guérin 2014-12-29 23:00:11 UTC
Here's an apitrace that makes my computer hang: http://ge.tt/7RmQXf72/v/0?c
Comment 29 Clément Guérin 2014-12-30 10:00:58 UTC
Woops, sorry, this is out of place. Should I open another bug in the radeonsi section?
Comment 30 Alexandre Demers 2014-12-31 01:30:41 UTC
(In reply to Clément Guérin from comment #29)
> Woops, sorry, this is out of place. Should I open another bug in the
> radeonsi section?

I would indeed open a new bug since this one and its comments seem related to r600g only.
Comment 31 Marek Olšák 2015-02-07 13:43:10 UTC
(In reply to Marek Olšák from comment #26)
> The patch has been committed, but it's a workaround, not a fix. I think this
> bug should remain open until a proper fix has been found.

Let's close this. I have enough apitraces to reproduce the issue.