Bug 85579 - [bisected] piglit test crashes in spec/glsl-1.50/execution/geometry/max-input-components
Summary: [bisected] piglit test crashes in spec/glsl-1.50/execution/geometry/max-input...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-29 01:11 UTC by Nick Sarnie
Modified: 2017-05-24 08:06 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
log when the test fails (183.49 KB, text/plain)
2014-10-29 01:11 UTC, Nick Sarnie
Details
log when the test crashes (183.38 KB, text/plain)
2014-10-29 01:11 UTC, Nick Sarnie
Details
radeonsi: If compiling the vertex or geometry shader fails, skip the draw (3.27 KB, text/plain)
2014-10-29 08:43 UTC, Michel Dänzer
Details
patch crash (109.16 KB, text/plain)
2014-10-29 12:34 UTC, Nick Sarnie
Details
backtrace (49.24 KB, text/plain)
2014-10-29 19:52 UTC, Nick Sarnie
Details
second bt (120.17 KB, text/plain)
2014-10-30 03:30 UTC, Nick Sarnie
Details

Description Nick Sarnie 2014-10-29 01:11:05 UTC
Created attachment 108602 [details]
log when the test fails

Hi again guys. I've been getting some very weird piglit crashes, including one lockup, which I haven't yet been able to bisect.

Anyway, here's one I've been able to bisect.

The test spec/glsl-1.50/execution/geometry/max-input-components fails before commit 54de7099115502c561f5f51095e08dc0a52c71b7, and always crashes on commits after.

I have attached the piglit result logs from both versions. I'm not sure if the LLVM Register Spilling spam is relating to my other problems, or not. 

Let me know if you need any more information.

Thanks,
sarnex
Comment 1 Nick Sarnie 2014-10-29 01:11:33 UTC
Created attachment 108603 [details]
log when the test crashes
Comment 2 Michel Dänzer 2014-10-29 08:43:31 UTC
Created attachment 108612 [details]
radeonsi: If compiling the vertex or geometry shader fails, skip the draw

Does this patch fix the crash?
Comment 3 Nick Sarnie 2014-10-29 12:34:06 UTC
Created attachment 108624 [details]
patch crash

(In reply to Michel Dänzer from comment #2)
> Created attachment 108612 [details]
> radeonsi: If compiling the vertex or geometry shader fails, skip the draw
> 
> Does this patch fix the crash?

Hi Michel,

Unfortunately, it appears the patch has no effect. But, after updating my mesa to today's version, the test crashes very quickly, when it used to take over 3 minutes to fail or crash. Maybe this is related to the other llvm change?

I attached a log.

Thanks,
sarnex
Comment 4 Michel Dänzer 2014-10-29 14:52:50 UTC
Can you run the test in gdb and attach a backtrace? From the logs you attached, the command line for running the test on your system is:

/usr/local/lib/piglit/bin/shader_runner /usr/local/bin/../lib/piglit/tests/spec/glsl-1.50/execution/geometry/max-input-components.shader_test -auto
Comment 5 Nick Sarnie 2014-10-29 19:52:33 UTC
Created attachment 108646 [details]
backtrace

(In reply to Michel Dänzer from comment #4)
> Can you run the test in gdb and attach a backtrace? From the logs you
> attached, the command line for running the test on your system is:
> 
> /usr/local/lib/piglit/bin/shader_runner
> /usr/local/bin/../lib/piglit/tests/spec/glsl-1.50/execution/geometry/max-
> input-components.shader_test -auto

Hi Michel,

I compiled LLVM3.5 debug and Mesa debug, so hopefully there is enough information here. The backtrace is attached.

Thanks,
sarnex
Comment 6 Michel Dänzer 2014-10-30 03:08:24 UTC
(In reply to sarnex from comment #5)
> I compiled LLVM3.5 debug and Mesa debug, so hopefully there is enough
> information here. The backtrace is attached.

That's a crash in LLVM. Does that also happen with Mesa commit 54de7099115502c561f5f51095e08dc0a52c71b7? If not, can you test my patch on top of that?
Comment 7 Nick Sarnie 2014-10-30 03:30:32 UTC
Created attachment 108669 [details]
second bt

(In reply to Michel Dänzer from comment #6)
> (In reply to sarnex from comment #5)
> > I compiled LLVM3.5 debug and Mesa debug, so hopefully there is enough
> > information here. The backtrace is attached.
> 
> That's a crash in LLVM. Does that also happen with Mesa commit
> 54de7099115502c561f5f51095e08dc0a52c71b7? If not, can you test my patch on
> top of that?

Nope, it's a different crash. I incorrectly assumed it would be the same crash since on latest git vs the first commit where it crashes.

Backtrace attached.

Thanks and sorry for the confusion.
Sarnex
Comment 8 Nick Sarnie 2014-10-30 03:33:31 UTC
(In reply to Michel Dänzer from comment #6)
> (In reply to sarnex from comment #5)
> > I compiled LLVM3.5 debug and Mesa debug, so hopefully there is enough
> > information here. The backtrace is attached.
> 
> That's a crash in LLVM. Does that also happen with Mesa commit
> 54de7099115502c561f5f51095e08dc0a52c71b7? If not, can you test my patch on
> top of that?

Whoops, I forgot about your patch. It doesn't apply against commit 54de7099115502c561f5f51095e08dc0a52c71b7. If you get a chance could you update it, because I'd likely break everything trying to manually apply.


Thanks again,
sarnex
Comment 9 Marek Olšák 2014-11-02 11:19:08 UTC
I think there are 2 ways to fix this and we should do both:

1) Fix VGPR register spilling caused by indirect addressing into lots of registers. LLVM crashes when it attempts to do that. Those registers are just copies of shader inputs and outputs.

2)
Step A) Implement indirect addressing for VS outputs before GS and GS inputs. This means that we cannot store outputs at the end of shaders (using emit_epilogue), but we must store them when they occur as a destination register (using emit_store).

(BTW my tessellation branch contains modifications to emit_store that make it easier to re-implement it for shaders that use store instructions for outputs)

Step B) glsl_to_tgsi and/or some passes of the GLSL compiler may need to be modified not to move ins/outs into temporaries. I think the only pass that does that is the varying packing. The pass should be disabled or rewritten, because its current implementation isn't gonna fly with our hardware and is often the cause of unnecessary register spilling.
Comment 10 Samuel Pitoiset 2017-05-24 08:06:12 UTC
Quite old bug. Can no longer be reproduced with mesa-git (51dc5e3df38), llvm-git (6f7f2057b76) and piglit-git (9cc5b2169). 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.