Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXC Validation Error: TGSM pointers must originate from an unambiguous TGSM global variable #3429

Open
Nielsbishere opened this issue Feb 4, 2021 · 7 comments
Labels
bug Bug, regression, crash
Milestone

Comments

@Nielsbishere
Copy link
Contributor

In commit cf044cc (from 23 days ago) I get the following error when enabling optimization;

error: validation errors
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:152:22: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%137 = phi float addrspace(3)* [ %133, %126 ], [ %166, %135 ]' in block '#25' of function 'main'.
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:152:22: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%138 = phi float addrspace(3)* [ %130, %126 ], [ %163, %135 ]' in block '#25' of function 'main'.
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:156:21: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%141 = phi float addrspace(3)* [ %166, %155 ], [ %133, %134 ]' in block '#26' of function 'main'.
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:156:21: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%142 = phi float addrspace(3)* [ %163, %155 ], [ %130, %134 ]' in block '#26' of function 'main'.
Validation failed.

This happens because I have the WaveIsFirstLane write to a groupshared float2 array. I can't publish the code, but I will send a DM on Discord.
When disabling optimization it works, so it seems like some optimization might change the generated DXIL.

@pow2clk
Copy link
Member

pow2clk commented Dec 4, 2021

Sorry for the delay. We can't do much without the code. Can you send the shader to [email protected] or to me directly?

@Nielsbishere
Copy link
Contributor Author

Sent

@llvm-beanz llvm-beanz added the needs-triage Awaiting triage label Jun 29, 2023
@llvm-beanz llvm-beanz moved this to For MSFT in HLSL Triage Jul 25, 2023
@damyanp damyanp added bug Bug, regression, crash and removed needs-triage Awaiting triage labels Apr 16, 2024
@damyanp damyanp moved this from For MSFT to Triaged in HLSL Triage Apr 16, 2024
@damyanp damyanp added this to the Dormant milestone Apr 16, 2024
@damyanp
Copy link
Member

damyanp commented Apr 16, 2024

It is possible that this has been fixed recently. Moving to Dormant for now. @Nielsbishere, can you let us know if this is still an issue for you?

@Nielsbishere
Copy link
Contributor Author

@damyanp Oops, apparently Greg sent a reply to my mail about 3 years ago and I didn't reply :( He managed to simplify the repro to the following:

groupshared float thingies[6];
groupshared uint thingCounter;
 
[numthreads(8, 1, 1)]
void main() {
  if(thingies[thingCounter] >= 0.0) {
    for(int ix = thingCounter; ix >= 0; --ix) {
      if(thingies[ix] <= 0.0) {
        thingies[ix] = 3.0;

        break;

      }

      thingies[ix] = 4.0;

    }

    ++thingCounter;
  }
} 

After a quick check it is still reproducible on the version on shader-playground and when fetching the latest from nuget (1.8.2403.2).

D:\programming\repos\rt_core\builds\external\dxc>"D:\programming\repos\rt_core\builds\external\dxc\build\native\bin\x64\dxc.exe" "C:\Users\n\Downloads\newio.txt" -E main -T cs_6_0
error: validation errors
C:\Users\n\Downloads\newio.txt:9:22: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%13 = phi float addrspace(3)* [ %8, %7 ], [ %22, %11 ]' in block '#5' of function 'main'.
C:\Users\n\Downloads\newio.txt:15:20: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%15 = phi float addrspace(3)* [ %22, %19 ], [ %8, %10 ]' in block '#6' of function 'main'.
Validation failed.

@damyanp
Copy link
Member

damyanp commented Apr 29, 2024

@damyanp damyanp removed the status in HLSL Triage Apr 29, 2024
@damyanp damyanp added the needs-triage Awaiting triage label Apr 29, 2024
@Nielsbishere
Copy link
Contributor Author

@damyanp that verifies that it is an issue right? Or is it to hint that I should link the code like that. Can do that next time.

@damyanp
Copy link
Member

damyanp commented Apr 29, 2024

It was meant more as a convenience for us when we look at this next. But if you want to link like that in the future then that'd be great as well :)

@damyanp damyanp modified the milestones: Dormant, Backlog Apr 30, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label Apr 30, 2024
@damyanp damyanp moved this to Triaged in HLSL Triage Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
Status: Triaged
Development

No branches or pull requests

4 participants