llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[AMDGPU] StackSlotColoring before LowerSGPRSpill causes memfault in Blender 4.1 on gfx908

Open yxsamliu opened this issue 2 years ago • 9 comments

https://github.com/llvm/llvm-project/pull/93668 caused a regression in Blender 4.1 on gfx908 for all scenes.

Fra:48 Mem:1531.14M (Peak 1531.14M) | Time:06:58.63 | Mem:2448.05M, Peak:2448.05M | Scene, View Layer | Sample 0/256
Warning: precise memory violation signal reporting is not enabled, reported
location may not be accurate.  See "show amdgpu precise-memory".

Thread 103 "blender" received signal SIGSEGV, Segmentation fault.
[Switching to thread 103, lane 9 (AMDGPU Lane 1:1:1:1/9 (0,0,0)[9,0,0])]
0x00007ffd7689a68c in integrator_intersect_shadow(KernelGlobalsGPU const*, int) () from memory://192866#offset=0x7ffd77f01240&size=4555968

yxsamliu avatar Jun 21 '24 20:06 yxsamliu

@llvm/issue-subscribers-backend-amdgpu

Author: Yaxun (Sam) Liu (yxsamliu)

https://github.com/llvm/llvm-project/pull/93668 caused a regression in Blender 4.1 on gfx908 for all scenes.
Fra:48 Mem:1531.14M (Peak 1531.14M) | Time:06:58.63 | Mem:2448.05M, Peak:2448.05M | Scene, View Layer | Sample 0/256
Warning: precise memory violation signal reporting is not enabled, reported
location may not be accurate.  See "show amdgpu precise-memory".

Thread 103 "blender" received signal SIGSEGV, Segmentation fault.
[Switching to thread 103, lane 9 (AMDGPU Lane 1:1:1:1/9 (0,0,0)[9,0,0])]
0x00007ffd7689a68c in integrator_intersect_shadow(KernelGlobalsGPU const*, int) () from memory://192866#offset=0x7ffd77f01240&size=4555968

llvmbot avatar Jun 21 '24 21:06 llvmbot

After spending time on ISA of good/bad cases, I found that s[0:3] represents the ScratchRsrcReg here, which is used as buffer descriptor(input) for buffer loads & stores, and thus most probably never get redefined or clobbered {since they are reserved & marked live throughout function}. Would it be better if I execute the given assembly & try to debug it?

vg0204 avatar Jun 27 '24 10:06 vg0204

It seems DC's patches fix the issue, so we do not need to revert your patch.

93526 : [AMDGPU] Split VGPR regalloc pipeline

93525: [CodeGen] change prototype of regalloc filter function

yxsamliu avatar Jun 27 '24 14:06 yxsamliu

DC's patches

It seems DC's patches fix the issue, so we do not need to revert your patch.

93526 : [AMDGPU] Split VGPR regalloc pipeline

93525: [CodeGen] change prototype of regalloc filter function

How should I ensure that, as I already reverted the patch, before reverting the revert commit.

vg0204 avatar Jun 27 '24 16:06 vg0204

I have verified that with those patches on top of amd-staging branch.

I will verify them with LLVM main branch.

Since you have reverted your PR. Let's re-enable blender test in buildbot and wait for these two PR's committed then reland your PR.

yxsamliu avatar Jun 27 '24 17:06 yxsamliu

Yeah, sounds good!

vg0204 avatar Jun 27 '24 19:06 vg0204

Yeah, sounds good!

CD has committed his change https://github.com/llvm/llvm-project/pull/93526

I think now you can reland your patch. Thanks.

yxsamliu avatar Oct 01 '24 18:10 yxsamliu

@yxsamliu , I relanded the patch, can you please once check for the failing blender test to verify its correctness, so this issue can be finally closed!

vg0204 avatar Nov 05 '24 06:11 vg0204

@yxsamliu , I relanded the patch, can you please once check for the failing blender test to verify its correctness, so this issue can be finally closed!

test is passing. thanks

yxsamliu avatar Nov 05 '24 15:11 yxsamliu