https://bugs.freedesktop.org/show_bug.cgi?id=43341
Bug #: 43341 Summary: CoreBreach: Crash in r600_update_derived_state Classification: Unclassified Product: Mesa Version: git Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: sa@whiz.se
Created attachment 53956 --> https://bugs.freedesktop.org/attachment.cgi?id=53956 backtrace
Hi,
The game CoreBreach crashes when the ships guns are fired, or when the walls of the racetrack are hit. This only happens when Post Processing is turned on (which it is by default). The crash happens with both git master and in Mesa 7.11.1.
The game is so far only available as a beta: http://phoronix.com/forums/showthread.php?65016-A-New-Commercial-Game-For-Li...
A backtrace is attached.
System environment: -- system architecture: 32-bit -- Linux distribution: Debian unstable -- GPU: REDWOOD -- Model: XFX Radeon HD 5670 1GB -- Display connector: DVI -- xf86-video-ati: 6.14.2 -- xserver: 1.11.1.902 -- mesa: c8db5a3d535c347193556c0d4a8fad83d96be184 -- drm: 2.4.27 -- kernel: 3.1.1
https://bugs.freedesktop.org/show_bug.cgi?id=43341
--- Comment #1 from Sven Arvidsson sa@whiz.se 2011-11-29 09:59:59 PST --- Forgot to mention that this is printed on the terminal:
EE r600_shader.c:141 r600_pipe_shader_create - translation from TGSI failed !
https://bugs.freedesktop.org/show_bug.cgi?id=43341
--- Comment #2 from Vadim ptpzz@yandex.ru 2011-11-30 03:05:40 PST --- The shader translation is failed because of too many temps used. They could be optimized away in theory, but this shader also uses indirect addressing, and some optimization passes in mesa are disabled due to this.
The shader also contains alternative code that afaics does the same calculations without indirect addressing, you may check if it helps by adding the line:
#define WORKAROUND 1
in the beginning of the ./CoreBreach.app/Resources/postprocessing.frag
https://bugs.freedesktop.org/show_bug.cgi?id=43341
--- Comment #3 from corecode mayer.julian@googlemail.com 2011-11-30 07:52:32 PST --- hello i am the game developer.
the workaround for disabling indirect addressing is automatically applied if linking the shader fails because of the indirect adressing. e.g. this happens on the geforce 7100 under windows.
if you let linking fail instead of crashing, the same code path will be used here.
i don't want to make disable indirect addressing by default since i guess it will be slower on recent hardware.
i'm not sure whats with the talk about too many temps. this crash occurs on 5770 / 5670 which are very capable cards. with the proprietary nvidia/ati drivers this shader works fine even back to ancient hardware under windows/mac/linux e.g. Radeon 2400 or GeForce 7300.
https://bugs.freedesktop.org/show_bug.cgi?id=43341
--- Comment #4 from Vadim ptpzz@yandex.ru 2011-11-30 19:04:57 PST --- (In reply to comment #3)
hello i am the game developer.
the workaround for disabling indirect addressing is automatically applied if linking the shader fails because of the indirect adressing. e.g. this happens on the geforce 7100 under windows.
if you let linking fail instead of crashing, the same code path will be used here.
Yes, the crash needs to be fixed, of course, but I'm afraid that just fixing it won't make everything work as expected, because it happens too late. I'll check this.
i'm not sure whats with the talk about too many temps. this crash occurs on 5770 / 5670 which are very capable cards. with the proprietary nvidia/ati drivers this shader works fine even back to ancient hardware under windows/mac/linux e.g. Radeon 2400 or GeForce 7300.
The shader code with mesa is not as heavily optimized as with the proprietary drivers. There are some optimization passes that do not support indirect addressing currently, so they are disabled in this case, that's why this shader breaks the limits.
i don't want to make disable indirect addressing by default since i guess it will be slower on recent hardware.
I'm not sure that it will be slower. Code optimization with indirect addressing is much harder, so I guess almost every compiler will produce more efficient code without indirect addressing (at least in this case). It's definitely true for mesa at the moment. Also I did a quick comparison of the generated code for this shader with AMD GPU Shader Analyzer (that is, code generated by the AMD's proprietary driver), here are some of the results for the HD5770:
w/o WORKAROUND: 2864 MPixels/sec with WORKAROUND: 3629 MPixels/sec
I'm not an expert in shaders performance, but afaics many apps are trying to avoid the indirect addressing, e.g. Unigine Heaven IIRR doesn't use it at all.
https://bugs.freedesktop.org/show_bug.cgi?id=43341
--- Comment #5 from corecode mayer.julian@googlemail.com 2011-12-01 04:13:15 PST --- thanks, you are right, the indirect addressing is slower after all (full benchmark on Radeon 5770, Radeon 2600 and GeForce 9600M). the difference is actually small on the 5770 but up to 100% on the other cards:
http://imageshack.us/f/13/bildschirmfoto20111201u.png/
i'll disable the indirect addressing unconditionally and will have a look if everything work fine now with the r600 driver or if there are remaining problems.
of course this bug should be fixed nevertheless ;-)
https://bugs.freedesktop.org/show_bug.cgi?id=43341
Sven Arvidsson sa@whiz.se changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #6 from Sven Arvidsson sa@whiz.se --- This is no longer a problem with Mesa 9.2 and CoreBreach 1.1.5, not sure if it was fixed in the driver or the game but no reason to keep the bug open.
dri-devel@lists.freedesktop.org