Bug 71285

Summary: Xonotic LLVM ERROR
Product: Mesa Reporter: Rafael Castillo <jrch2k10>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high CC: darkbasic
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: zipped shader dump
R600_DEBUG=ps,vs shader dump
Work Around
Fix
dmesg of gpu hard reset

Description Rafael Castillo 2013-11-06 01:41:15 UTC
Created attachment 88735 [details]
zipped shader dump

in Xonotic 7.0 several levels return this error after crash

LLVM ERROR: ran out of registers during register allocation

GL_VENDOR: X.Org
GL_RENDERER: Gallium 0.4 on AMD CAPE VERDE
GL_VERSION: 3.0 Mesa 10.0.0-devel (git-5ae31d7)

level 
maps/stormkeep

attached: shader dump

many thanks for your time
Comment 1 Michel Dänzer 2013-11-13 04:02:21 UTC
Which version of LLVM are you using? If it's 3.3, does a 3.4 snapshot work better?
Comment 2 Rafael Castillo 2013-11-13 22:12:54 UTC
I use llvm 3.4 daily emerged on gentoo
Comment 3 Tom Stellard 2013-11-16 02:29:16 UTC
Could you dump the assembly output from the shaders?  Use the environment variable:
R600_DEBUG=ps,vs
Comment 4 Rafael Castillo 2013-11-16 18:09:24 UTC
Created attachment 89331 [details]
R600_DEBUG=ps,vs shader dump
Comment 5 darkbasic 2013-11-18 00:12:16 UTC
The problem is only with the "offset mapping" effect enabled.
Radeonsi (HD 7950) + LLVM 3.4 git + mesa 10.1 git + linux 3.13
Comment 6 Rafael Castillo 2013-11-18 04:21:39 UTC
confirmed offset mapping is the culprit
Comment 7 Tom Stellard 2013-11-22 04:42:22 UTC
Created attachment 89615 [details] [review]
Work Around

This patch should avoid the crash, but the effect will not be rendered correctly.  Can you test?
Comment 8 Rafael Castillo 2013-11-22 13:38:34 UTC
(In reply to comment #7)
> Created attachment 89615 [details] [review] [review]
> Work Around
> 
> This patch should avoid the crash, but the effect will not be rendered
> correctly.  Can you test?

yes ofc, when i reach home tonight ill test it and report back
Comment 9 Rafael Castillo 2013-11-24 00:51:03 UTC
im try to test the patch but currently llvm master don't build claiming missing unistd.h header, so once is fixed ill test the patch
Comment 10 Tom Stellard 2013-11-26 04:31:06 UTC
Created attachment 89805 [details] [review]
Fix

This new patch is an actual fix, not just a workaround.  It fixes the crash for me, can you verify?
Comment 11 Rafael Castillo 2013-11-26 14:59:20 UTC
sorry for the delay, about your previous patch it worked as you say. ill test this one tonight

many thanks for your time
Comment 12 Rafael Castillo 2013-11-26 23:43:15 UTC
well it compiles just fine but since llvm 3.5 xonotic and pepper flash hard reset the GPU. im trying to get a dump of the failure
Comment 13 Rafael Castillo 2013-11-27 00:51:26 UTC
Created attachment 89878 [details]
dmesg of gpu hard reset

This with or wthout your patch
Comment 14 darkbasic 2013-11-27 10:06:24 UTC
If you need someone who tests the patch I can switch back to LLVM 3.4, let me know.
Comment 15 Arek Ruśniak 2013-11-27 11:53:37 UTC
Rafael try latest libdrm from git. I had the same problem with libdrm 2.4.49
Comment 16 Rafael Castillo 2013-11-27 14:05:48 UTC
(In reply to comment #15)
> Rafael try latest libdrm from git. I had the same problem with libdrm 2.4.49

thanks, arek

i do use libdrm git but i see that 5 days ago new patches landed and im not sure i pulled them, so i ll re emerge today to be sure and test again

many thanks for your tip
Comment 17 Rafael Castillo 2013-11-27 23:33:55 UTC
ok after updating all my stack to todays git my GPU stopped hard resseting and effectively this patch fixes all xonotic issues.

Many many thanks for your good work tom
Comment 18 Tom Stellard 2013-11-28 00:03:02 UTC
The fix was committed to the LLVM tree: r195880

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.