https://bugs.freedesktop.org/show_bug.cgi?id=74868
Priority: medium Bug ID: 74868 Assignee: dri-devel@lists.freedesktop.org Summary: r600g: Diablo III Crashes After a few minutes Severity: normal Classification: Unclassified OS: All Reporter: nick.tenney@gmail.com Hardware: Other Status: NEW Version: git Component: Drivers/Gallium/r600 Product: Mesa
Created attachment 93894 --> https://bugs.freedesktop.org/attachment.cgi?id=93894&action=edit Xorg Log
Disclaimer: This is my first bug report, so I apologize if I do not attach enough information.
I tried booting up Diablo III a few days back to see the new geometry shaders in action on my 4890, and alas, I had a few minutes of happy gameplay followed by a startling black screen. I ran it in a terminal window, though wine was not kind enough to allow me to properly pipe the output (only grabbed the launcher window and gave up) it contained ooodles of r600_shader_select issues. There were thousands of the (type=1) -1 lines prior to the the -12 lines right before the crash:
EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -1 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -1 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -1 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -1 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -1 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -1 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_texture.c:1003 r600_texture_transfer_map - failed to create temporary texture to hold untiled copy Mesa: User error: GL_OUT_OF_MEMORY in glCompressedTexSubImage2D err:d3d:wined3d_debug_callback 0x1c8178: "GL_OUT_OF_MEMORY in glCompressedTexSubImage2D". err:d3d_surface:surface_upload_data >>>>>>>>>>>>>>>>> GL_OUT_OF_MEMORY (0x505) from glCompressedTexSubImage2DARB @ ../../../wine-1.7.12/dlls/wined3d/surface.c / 1688 EE r600_texture.c:1003 r600_texture_transfer_map - failed to create temporary texture to hold untiled copy Mesa: User error: GL_OUT_OF_MEMORY in glCompressedTexSubImage2D err:d3d:wined3d_debug_callback 0x1c8178: "GL_OUT_OF_MEMORY in glCompressedTexSubImage2D". err:d3d_surface:surface_upload_data >>>>>>>>>>>>>>>>> GL_OUT_OF_MEMORY (0x505) from glCompressedTexSubImage2DARB @ ../../../wine-1.7.12/dlls/wined3d/surface.c / 1688 EE r600_texture.c:1003 r600_texture_transfer_map - failed to create temporary texture to hold untiled copy Mesa: User error: GL_OUT_OF_MEMORY in glCompressedTexSubImage2D err:d3d:wined3d_debug_callback 0x1c8178: "GL_OUT_OF_MEMORY in glCompressedTexSubImage2D". err:d3d_surface:surface_upload_data >>>>>>>>>>>>>>>>> GL_OUT_OF_MEMORY (0x505) from glCompressedTexSubImage2DARB @ ../../../wine-1.7.12/dlls/wined3d/surface.c / 1688 EE r600_texture.c:1003 r600_texture_transfer_map - failed to create temporary texture to hold untiled copy Mesa: User error: GL_OUT_OF_MEMORY in glCompressedTexSubImage2D err:d3d:wined3d_debug_callback 0x1c8178: "GL_OUT_OF_MEMORY in glCompressedTexSubImage2D". err:d3d_surface:surface_upload_data >>>>>>>>>>>>>>>>> GL_OUT_OF_MEMORY (0x505) from glCompressedTexSubImage2DARB @ ../../../wine-1.7.12/dlls/wined3d/surface.c / 1688 EE r600_texture.c:1003 r600_texture_transfer_map - failed to create temporary texture to hold untiled copy Mesa: User error: GL_OUT_OF_MEMORY in glCompressedTexSubImage2D err:d3d:wined3d_debug_callback 0x1c8178: "GL_OUT_OF_MEMORY in glCompressedTexSubImage2D". err:d3d_surface:surface_upload_data >>>>>>>>>>>>>>>>> GL_OUT_OF_MEMORY (0x505) from glCompressedTexSubImage2DARB @ ../../../wine-1.7.12/dlls/wined3d/surface.c / 1688 EE r600_texture.c:1003 r600_texture_transfer_map - failed to create temporary texture to hold untiled copy Mesa: User error: GL_OUT_OF_MEMORY in glCompressedTexSubImage2D err:d3d:wined3d_debug_callback 0x1c8178: "GL_OUT_OF_MEMORY in glCompressedTexSubImage2D". err:d3d_surface:surface_upload_data >>>>>>>>>>>>>>>>> GL_OUT_OF_MEMORY (0x505) from glCompressedTexSubImage2DARB @ ../../../wine-1.7.12/dlls/wined3d/surface.c / 1688
https://bugs.freedesktop.org/show_bug.cgi?id=74868
Nick Tenney nick.tenney@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Hardware|Other |x86-64 (AMD64) OS|All |Linux (All) CC| |nick.tenney@gmail.com
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #1 from Nick Tenney nick.tenney@gmail.com --- Created attachment 93895 --> https://bugs.freedesktop.org/attachment.cgi?id=93895&action=edit dmesg log
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #2 from Nick Tenney nick.tenney@gmail.com --- Created attachment 93896 --> https://bugs.freedesktop.org/attachment.cgi?id=93896&action=edit Mesa PKGBUILD
Distribution: Archlinux 64-bit Kernel: 3.14rc2 Mesa: git (PKGBUILD attached with ops) libdrm: 2.4.52
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #3 from Michel Dänzer michel@daenzer.net --- Looks like there's a memory leak somewhere. Does valgrind --leak-check=full give any hints? (Not sure if or how that can be used for Wine though)
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #4 from Nick Tenney nick.tenney@gmail.com --- I took a quick peak at Valgrind, but Diablo III has some workarounds that seem to be messing with it. I'll toy around with it a bit more on the weekend. Thanks!
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #5 from Nick Tenney nick.tenney@gmail.com --- I have tried various configurations with valgrind as recommended here: http://wiki.winehq.org/Wine_and_Valgrind
I have gotten it to begin loading, but before it completes, Diablo crashes with an internal error. Are there any other tools available or more limited valgrind traces I could run to track this down? I know wine stuff is tricky to work with.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #6 from Ilia Mirkin imirkin@alum.mit.edu --- (In reply to comment #5)
Are there any other tools available or more limited valgrind traces I could run to track this down? I know wine stuff is tricky to work with.
apitrace -- records all OpenGL calls. If replaying a trace causes the same leak, then you're all set. (You could also run valgrind on the trace replay.)
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #7 from Nick Tenney nick.tenney@gmail.com --- Created attachment 94142 --> https://bugs.freedesktop.org/attachment.cgi?id=94142&action=edit Diablo III Valgrind output
Thanks Ilia, that did the trick! I just grabbed the first few minutes of game play in Valgrind up until it started encountering the error that was popping previously.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #8 from Ilia Mirkin imirkin@alum.mit.edu --- (In reply to comment #7)
Created attachment 94142 [details] Diablo III Valgrind output
Thanks Ilia, that did the trick! I just grabbed the first few minutes of game play in Valgrind up until it started encountering the error that was popping previously.
I'm not a radeon guy, just a drive-by commenter, but I'm going to go ahead and guess that this output is going to be of little use to anyone debugging :(
A trace with symbols in r600_dri would be much more useful. With what you provided, we just know that the memory is allocated with malloc and calloc... which is of little surprise.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #9 from Nick Tenney nick.tenney@gmail.com --- Thanks for the help so far! I am happy to keep on debugging with more specificity, but will need some help as I'm still pretty new with this stuff. Let me know if there is anything I can provide to help shine light on this.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #10 from Michel Dänzer michel@daenzer.net --- Make sure your /usr/lib/xorg/modules/dri/r600_dri.so has debugging symbols.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
Nick Tenney nick.tenney@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #94142|0 |1 is obsolete| |
--- Comment #11 from Nick Tenney nick.tenney@gmail.com --- Created attachment 94468 --> https://bugs.freedesktop.org/attachment.cgi?id=94468&action=edit D3 Valgrind output with debugging symbols
Recompiled and ran Valgrind again. The resulting Valgrind looks more informative than previous attempts. Let me know if anything else would be helpful.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #12 from Nick Tenney nick.tenney@gmail.com --- Commands used:
$ apitrace32 wine Diablo\ III.exe $ valgrind --leak-check=full --trace-children=yes --vex-iropt-register-updates=allregs-at-mem-access --workaround-gcc296-bugs=yes --log-file=d3-valgrind-debug_v2 --suppressions=$HOME/valgrind-suppressions apitrace replay d3debug_v2.trace
Realized I didn't have an apitrace on here, so I grabbed a new one for posting. Dropbox link is as follows:
https://www.dropbox.com/s/1zlzceaho5ym5pa/d3-trace.tar.bz2 sha256sum: f60ded613d5a9dd71629ec75ad2cc3b1f7c93ed80b22f92aeadd0f94f97ade19
My valgrind output was a bit above the limit too: https://www.dropbox.com/s/uyqzxsf1ma5sqds/d3-valgrind-debug_v2 sha256sum: ffb4a35cfd714c78b228bfa0219445648190430324020924c8d04d3ce217a5dc
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #13 from Nick Tenney nick.tenney@gmail.com --- I decided to try running with R600_DEBUG=hyperz,nosb to see what happened and I got another line in the shader failure output about the shader requiring 227 registers:
EE r600_state_common.c:750 r600_shader_select - Failed to build shader variant (type=1) -12 EE r600_shader.c:2183 r600_shader_from_tgsi - GPR limit exceeded - shader requires 227 registers EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed !
Any tips on further debugging to find which shader is failing?
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #14 from Michel Dänzer michel@daenzer.net --- Created attachment 95909 --> https://bugs.freedesktop.org/attachment.cgi?id=95909&action=edit r600g: Don't leak bytecode on shader compile failure
Does this patch help?
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #15 from Reiner Herrmann reiner@reiner-h.de --- (In reply to comment #14)
Created attachment 95909 [details] [review] r600g: Don't leak bytecode on shader compile failure
Does this patch help?
Yes, this patch is helping, thank you! :) I applied it to current Mesa 10.1 and was able to play Diablo 3 for several hours without crashing due to being out of memory.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #16 from 640bugs@gmail.com --- (In reply to comment #14)
Created attachment 95909 [details] [review] r600g: Don't leak bytecode on shader compile failure
Does this patch help?
I can also confirm, that the game doesnt crash anymore.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #17 from Nick Tenney nick.tenney@gmail.com --- (In reply to comment #14)
Created attachment 95909 [details] [review] r600g: Don't leak bytecode on shader compile failure
Does this patch help?
Finally had a chance to test the patch. I compiled this morning with and without the patch and GALLIUM_HUD=fps,requested-VRAM,requested-GTT. It clearly leaked away without and the flow was stemmed with the proper error handling patch. Awesome!
I see that the patch properly destroys the shader on error now, which is definitely an improvement. The error spamming to stdout is still occurring, so I'm not sure whether that should be another bug report/left open in this one with a new name or anything.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #18 from John Lenz lenz@math.uic.edu --- Just to confirm, I had this exact problem with mesa 10.1 and diablo 3, and the attached patch fixes the problem. I played for ~1.5 hours with no crash, when before it would crash within 2-3 minutes.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #19 from Mike Mestnik cheako+bugs_freedesktop_org@mikemestnik.net --- The patch worked for me, binary download based on Oibaf package.
https://launchpad.net/~cheako/+archive/buildingrounds/+build/5883102/+files/...
https://bugs.freedesktop.org/show_bug.cgi?id=74868
--- Comment #20 from Michel Dänzer michel@daenzer.net --- (In reply to comment #17)
The error spamming to stdout is still occurring, so I'm not sure whether that should be another bug report/left open in this one with a new name or anything.
Please file separate bugs for the shader compile failures.
https://bugs.freedesktop.org/show_bug.cgi?id=74868
Michel Dänzer michel@daenzer.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #21 from Michel Dänzer michel@daenzer.net --- Module: Mesa Branch: master Commit: ee2bcf38a4c8930d8f9cecfac580030a45c41dae URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee2bcf38a4c8930d8f9cecfac58...
Author: Michel Dänzer michel.daenzer@amd.com Date: Wed Apr 9 15:38:21 2014 +0900
r600g: Don't leak bytecode on shader compile failure
https://bugs.freedesktop.org/show_bug.cgi?id=74868
Lauri Kasanen curaga@operamail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |85596
dri-devel@lists.freedesktop.org