Created attachment 93894 [details] 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
Created attachment 93895 [details] dmesg log
Created attachment 93896 [details] Mesa PKGBUILD Distribution: Archlinux 64-bit Kernel: 3.14rc2 Mesa: git (PKGBUILD attached with ops) libdrm: 2.4.52
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)
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!
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.
(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.)
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.
(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.
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.
Make sure your /usr/lib/xorg/modules/dri/r600_dri.so has debugging symbols.
Created attachment 94468 [details] 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.
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
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?
Created attachment 95909 [details] [review] r600g: Don't leak bytecode on shader compile failure Does this patch help?
(In reply to comment #14) > Created attachment 95909 [details] [review] [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.
(In reply to comment #14) > Created attachment 95909 [details] [review] [review] > r600g: Don't leak bytecode on shader compile failure > > Does this patch help? I can also confirm, that the game doesnt crash anymore.
(In reply to comment #14) > Created attachment 95909 [details] [review] [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.
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.
The patch worked for me, binary download based on Oibaf package. https://launchpad.net/~cheako/+archive/buildingrounds/+build/5883102/+files/libgl1-mesa-dri_10.2~git1404021931.0f641b~mmestnik~gd~s_i386.deb
(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.
Module: Mesa Branch: master Commit: ee2bcf38a4c8930d8f9cecfac580030a45c41dae URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee2bcf38a4c8930d8f9cecfac580030a45c41dae 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
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.