Bug 31246

Summary: [RADEON::CYPRESS:R600C] reproducible hangs on piglit tests with HD5850
Product: Mesa Reporter: Kjell Rune Skaaraas <temp9476-freedesktop>
Component: Drivers/DRI/R600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: sa
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Kjell Rune Skaaraas 2010-10-30 19:15:34 UTC
Ignoring the occasional random hang, I have found that the following tests create a lockup of the system every time:

glsl-fs-main-return
glsl-vs-main-return
glsl-max-varyings
glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

How would I go about debugging these further? It would be very nice if the piglit tests would at least fail, not hang...
Comment 1 Ian Romanick 2010-11-02 10:28:39 UTC
There was a time when the i965 driver would also hang in at least some of these tests.  You might look at how Eric solved it there.  Search the GIT log for those test names.

In all of these cases the problem is that the driver emitted some sequence of instructions that made the GPU angry.  For example, I'll bet that the GPU doesn't like a return instruction that doesn't have a preceding call instruction.  We implemented a lowering pass to remove returns from main to fix this very problem on i965 for glsl-[fv]s-main-return.
Comment 2 Kjell Rune Skaaraas 2010-11-06 12:44:17 UTC
To put it this way, I found the patches you referred to but they don't tell me much. I did dig through the piglet code and found the definition of the test though, it's in a bit of meta-code:

[require]
GL >= 2.0
GLSL >= 1.10

[vertex shader]
void main()
{
        gl_Position = gl_Vertex;
}

[fragment shader]
uniform int early;

void main()
{
        gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
        if (early != 0) /* always true */
                return;
        gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0);
}

[test]
uniform int early 1
draw rect -1 -1 2 2
probe all rgba 0.0 1.0 0.0 0.0

----

So my next question is really how I can look at what GPU instructions the driver *would* create for these shaders, without actually running the shaders. I tried catching that with RADEON_DEBUG=all but that just gives me a zero byte file after reboot so it's no good.
Comment 3 Kjell Rune Skaaraas 2010-11-07 05:13:59 UTC
So... http://www.mesa3d.org/shading.html says there should be a standalone compiler in src/mesa/drivers/glslcompiler that should tell me what the compiled output is. There's just one little problem, I don't have that directory at all. Moved? Gone? And what replaced it?
Comment 4 Jerome Glisse 2011-02-09 07:52:42 UTC
Do you still have issue with lastest r600c or r600g ?
Comment 5 Wyatt Epp 2011-02-22 09:01:57 UTC
(In reply to comment #4)
> Do you still have issue with lastest r600c or r600g ?

Just happened about an hour ago for me on glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.
Comment 6 Sven Arvidsson 2011-06-01 10:26:25 UTC
On my Evergreen, glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined seems to be the only remaining test causing a GPU hang.

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.10.1
-- mesa: git-c5903ed
-- drm: 2.4.25
-- kernel: 2.6.39
Comment 7 Sven Arvidsson 2011-06-01 14:22:59 UTC
It looks like this was fixed, but only for r700 in r600c:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c20778e76f1203063977337ebbe1bd2aacef5dc0
Comment 8 Sven Arvidsson 2011-06-11 09:20:27 UTC
The hang with glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined has been fixed for r600g now :)
Comment 9 Andreas Boll 2012-09-12 15:02:14 UTC
(In reply to comment #8)
> The hang with glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined has been
> fixed for r600g now :)

Closing.

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.