Skip to contentSkip to conversation

SGPR spilling

Bug 92923 [email protected] 1 participant 16 messages Nov 12, 2015 – Aug 24, 2016

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=92923

Bug ID: 92923
Summary: SGPR spilling
Product: Mesa
Version: 11.0
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

Created attachment 119606
--> https://bugs.freedesktop.org/attachment.cgi?id=119606&action=edit
stacktrace from game log file

"LLVM triggered Diagnostic Handler: Ran out of VGPRs for spilling SGPR"

The game Planet Explorers crashes after a few minutes, the log file is flooded with this error message.

Additional error messages:
radeon_llvm_compile: Processing Diag Flag
LLVM failed to compile shader
EE si_state_shaders.c:647 si_shader_select - Failed to build shader variant (type=1) 1

The problem may have started with mesa 11.0 but I'm not sure, I don't play it very often. The game runs on unity 5.

Attaching backtrace and stacktrace from the log file. There is also a memory map I could attach.

OpenGL info from the log file:

Version:  OpenGL 3.0 [3.0 Mesa 11.0.5]
Renderer: Gallium 0.4 on AMD PITCAIRN (DRM 2.43.0, LLVM 3.7.0)
Vendor:   X.Org
VRAM:     2048 MB

Hardware is a Radeon HD 7870

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #1 from pat <[email protected]> --- Created attachment 119607
--> https://bugs.freedesktop.org/attachment.cgi?id=119607&action=edit
backtrace from game log file

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

Michel Dänzer <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Michel Dänzer <[email protected]> --- Tom, any ideas?

pat, please run the game with the environment variable R600_DEBUG=vs,gs,ps and attach its stderr output after reproducing the problem.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

pat <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

 Attachment #119606|0                           |1

is obsolete| |

--- Comment #3 from pat <[email protected]> --- Created attachment 119948
--> https://bugs.freedesktop.org/attachment.cgi?id=119948&action=edit
Game log file

Steam seems to mess with stderr, I hope this game log has the info you need.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #4 from Michel Dänzer <[email protected]> --- (In reply to pat from comment #3)

Quoted 1 line

Steam seems to mess with stderr, I hope this game log has the info you need.

It does, thanks.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #5 from pat <[email protected]> ---

Version:  OpenGL 3.0 [3.0 Mesa 11.2.0-devel (git-bca1805)]
Renderer: Gallium 0.4 on AMD PITCAIRN (DRM 2.43.0, LLVM 3.8.0)

No more crashes with the current game version and mesa git/llvm svn, but it runs with 1 FPS (with very rare boosts to 45-60 FPS) on lowest settings. The log file still looks like before as far ar I can tell.

This was probably my last test with AMD/mesa.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #6 from Nicolai Hähnle <[email protected]> ---
Sorry for your pain. We did make some changes to make LLVM more robust recently, so that's something. As for the performance problems you're seeing, I'd really appreciate if you could provide an apitrace, see
https://github.com/apitrace/apitrace/wiki/Steam if you're running the game under Steam. That should allow us to reproduce the issue.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #7 from pat <[email protected]> --- llvm svn version 257076 (32bit: 257085)
OpenGL 3.0 [3.0 Mesa 11.2.0-devel (git-040e314)]
apitrace: http://www.psycho3d.de/temp/PlanetExplorersApitrace.7z (300MB 7zipped)

Apitrace should include a few minutes of gameplay, 2x freeze for several seconds. I disabled the steam overlay for the trace but I think I had probably 1-3 FPS during the test.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #8 from Nicolai Hähnle <[email protected]> --- Created attachment 120923
--> https://bugs.freedesktop.org/attachment.cgi?id=120923&action=edit
fix long buffer wait times observed in trace

Hi pat, thanks for following up with this!

On Tonga, this trace runs into a variant of the compiler error you mentioned earlier in the bug report due to limited SGPRs. This is something we still need to address.

On Carrizo, I can run the trace and I notice an obvious buffer wait time problem. Please try the quick-and-dirty patch I've attached. The trace is still slow for me, but (a) it's a trace and (b) it's not a dGPU part, so I'd be interested to hear how the in-game performance is for you with the patch.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #9 from pat <[email protected]> --- Hey Nicolai, thanks for the fast patch.

I've patched rev 5e3edd4 of the 32bit package (lib32-mesa-git, lib32-mesa-git-debug, lib32-mesa-libgl-git) and started the 32bit game binary. It's still at 3-4 FPS.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #10 from pat <[email protected]> ---
Any last tests you'd want me to do before I upgrade my hardware and say bye bye to AMD?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #11 from Nicolai Hähnle <[email protected]> ---
With the branch at http://cgit.freedesktop.org/~nh/mesa/log/?h=pub-invalidate
the in-game part of your trace plays back at around 11 FPS on a Carrizo, which is an integrated GPU (laptop). It may be worth a shot.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #12 from Nicolai Hähnle <[email protected]> --- Created attachment 120987
--> https://bugs.freedesktop.org/attachment.cgi?id=120987&action=edit
always add GTT to buffers' initial domain

How much VRAM do you have? Try running the game with GALLIUM_HUD=num-bytes-moved, with and without the attached patch.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #13 from pat <[email protected]> --- 2048M VRAM

Test 1:
Version: OpenGL 3.0 [3.0 Mesa 11.2.0-devel (git-6f898f7)] Patched with both patches you provided.

With patch: the graph spikes up to 45.5 MB during the loading screen, later it stays at 0 byte. When I turn around it goes up to KB but not MB. Still around 3 FPS, up to 11 when looking at the sky.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

--- Comment #14 from pat <[email protected]> --- Test 1: no noticeable difference between patched and not.

Test 2: your repo/branch (git-016eba7), no noticeable improvement (including the GTT patch). Graph also shows minimal bytes moved.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=92923

Marek Olšák <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #15 from Marek Olšák <[email protected]> --- Fixed a long time ago.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel