All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
@ 2017-10-21 17:32 bugzilla-daemon
  2017-10-21 17:47 ` [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x " bugzilla-daemon
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 17:32 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1612 bytes --]

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

            Bug ID: 103393
           Summary: glDispatchComputeGroupSizeARB : gl_GlobalInvocationID
                    != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x +
                    gl_LocalInvocationID.x
           Product: Mesa
           Version: 17.2
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/Gallium/radeonsi
          Assignee: dri-devel@lists.freedesktop.org
          Reporter: stephane.chevigny@polymtl.ca
        QA Contact: dri-devel@lists.freedesktop.org

Created attachment 134977
  --> https://bugs.freedesktop.org/attachment.cgi?id=134977&action=edit
Difference between the result of  gl_GlobalInvocationID and gl_WorkGroupID.x *
gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x;

The spec for ARB_compute_variable_group_size in this file
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_compute_variable_group_size.txt
state that gl_GlobalInvocationID = gl_WorkGroupID * gl_LocalGroupSizeARB +
gl_LocalInvocationID; but on my computer, arch linux with  Radeon RX 580 Series
(AMD POLARIS10 / DRM 3.18.0 / 4.13.
7-1-ARCH, LLVM 5.0.0) : mesa version 17.2.2,  gl_GlobalInvocationID =
gl_LocalInvocationID ; only. If I replace uint i = gl_GlobalInvocation.x with 
uint i = gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x 
the output of the compute shader work as expected.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3469 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
@ 2017-10-21 17:47 ` bugzilla-daemon
  2017-10-21 17:54 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 17:47 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 755 bytes --]

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

Stephane Chevigny <stephane.chevigny@polymtl.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|glDispatchComputeGroupSizeA |glDispatchComputeGroupSizeA
                   |RB : gl_GlobalInvocationID  |RB :
                   |!= gl_WorkGroupID.x *       |gl_GlobalInvocationID.x !=
                   |gl_LocalGroupSizeARB.x +    |gl_WorkGroupID.x *
                   |gl_LocalInvocationID.x      |gl_LocalGroupSizeARB.x +
                   |                            |gl_LocalInvocationID.x

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1403 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
  2017-10-21 17:47 ` [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x " bugzilla-daemon
@ 2017-10-21 17:54 ` bugzilla-daemon
  2017-10-21 18:19 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 17:54 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 305 bytes --]

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

--- Comment #1 from Ilia Mirkin <imirkin@alum.mit.edu> ---
I wanted to test this out on nouveau -- I ran the program, and it created
output. What's the expected output?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1240 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
  2017-10-21 17:47 ` [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x " bugzilla-daemon
  2017-10-21 17:54 ` bugzilla-daemon
@ 2017-10-21 18:19 ` bugzilla-daemon
  2017-10-21 18:23 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 18:19 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 823 bytes --]

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

--- Comment #2 from Stephane Chevigny <stephane.chevigny@polymtl.ca> ---
The expected output:
value[i].x (= gl_GlobalInvocationID.x ;)  should be equal to value[i].y  and
value[i].w (= gl_WorkGroupID.x * gl_LocalGroupSizeARB.x +
gl_LocalInvocationID.x;)  for all indices i according to spec. With the
parameter I gave to glDispatchComputeGroupSizeARB, the divergence of the result
happen after the indice i = 63 on my computer. So value[i].x = value[i].z
(=gl_LocalInvocationID.x;) instead.

So on my computer, gl_GlobalInvocationID.x appear to be only equal to
gl_LocalInvocationID.x notgl_WorkGroupID.x * gl_LocalGroupSizeARB.x +
gl_LocalInvocationID.x or I misread the spec.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1772 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
                   ` (2 preceding siblings ...)
  2017-10-21 18:19 ` bugzilla-daemon
@ 2017-10-21 18:23 ` bugzilla-daemon
  2017-10-21 18:56 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 18:23 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 834 bytes --]

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

--- Comment #3 from Ilia Mirkin <imirkin@alum.mit.edu> ---
OK, I see. The relevant shader is fill_cs_450.glsl. It puts stuff into the
array with values

(gl_GlobalInvocationID.x, t, gl_LocalInvocationID.x, t)

where t = gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x

Ideally the values printed should be (x, x, l, x) -- i.e. t ==
gl_GlobalInvocationID.x.

With nouveau this outputs a bunch of BS... sometimes gl_GlobalInvocationID.x ==
gl_LocalInvocationID.x, other times gl_GlobalInvocationID.x == randomish value.
I suspect this is a combination of a nouveau bug and a core bug [the latter of
which is affecting the radeonsi output]. Going to try to take a look.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1769 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
                   ` (3 preceding siblings ...)
  2017-10-21 18:23 ` bugzilla-daemon
@ 2017-10-21 18:56 ` bugzilla-daemon
  2017-10-21 19:10 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 18:56 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1028 bytes --]

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

--- Comment #4 from Ilia Mirkin <imirkin@alum.mit.edu> ---
OK yeah, this is totally broken... for a simplified shader (which I will submit
to piglit), this is generating code like

COMP
PROPERTY CS_FIXED_BLOCK_WIDTH 0
PROPERTY CS_FIXED_BLOCK_HEIGHT 0
PROPERTY CS_FIXED_BLOCK_DEPTH 0
DCL SV[0], THREAD_ID
DCL SV[1], BLOCK_ID
DCL SV[2], BLOCK_SIZE
DCL BUFFER[16]
DCL TEMP[0..3], LOCAL
IMM[0] UINT32 {8, 0, 0, 0}
  0: UMAD TEMP[0].x, SV[1].xyzz, TEMP[1].xyzz, SV[0].xyzz
  1: MOV TEMP[1].x, TEMP[0].xxxx
  2: MOV TEMP[1].y, SV[0].xxxx
  3: UMAD TEMP[2].x, SV[1].xxxx, SV[2].xxxx, SV[0].xxxx
  4: UMUL TEMP[3].x, TEMP[2].xxxx, IMM[0].xxxx
  5: STORE BUFFER[16].xy, TEMP[3].xxxx, TEMP[1].xyyy
  6: END

Note the first op which tries to read the uninitialized TEMP[1].xyzz. Oops.
Pretty sure this used to work, so probably got broken at some point with the
various refactors.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1963 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
                   ` (4 preceding siblings ...)
  2017-10-21 18:56 ` bugzilla-daemon
@ 2017-10-21 19:10 ` bugzilla-daemon
  2017-10-21 19:26 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 19:10 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 255 bytes --]

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

--- Comment #5 from Stephane Chevigny <stephane.chevigny@polymtl.ca> ---
Thank you very much for checking that.

S.C.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1204 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
                   ` (5 preceding siblings ...)
  2017-10-21 19:10 ` bugzilla-daemon
@ 2017-10-21 19:26 ` bugzilla-daemon
  2017-10-23 12:42 ` bugzilla-daemon
  2017-10-24  9:25 ` bugzilla-daemon
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-21 19:26 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 437 bytes --]

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

--- Comment #6 from Ilia Mirkin <imirkin@alum.mit.edu> ---
https://patchwork.freedesktop.org/patch/184119/

This fixes both your application as well as a small piglit test I wrote on
nouveau. The issue was in the core logic. If radeonsi still doesn't work with
this, then it has additional issues.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1434 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
                   ` (6 preceding siblings ...)
  2017-10-21 19:26 ` bugzilla-daemon
@ 2017-10-23 12:42 ` bugzilla-daemon
  2017-10-24  9:25 ` bugzilla-daemon
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-23 12:42 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 738 bytes --]

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

--- Comment #7 from Ilia Mirkin <imirkin@alum.mit.edu> ---
An updated patch fixes the issue in a more complete way (with multiple shaders
being linked together, even non-variable local sizes were broken). This is now
upstream in

commit 4d24a7cb97641cacecd371d1968f6964785822e4
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Oct 21 15:15:41 2017 -0400

    glsl: fix derived cs variables

Thanks for reporting and providing a repro! As the original issue was filed
against radeonsi, I'm going to leave this open until someone can confirm that
this does indeed fix the problem there.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1729 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x
  2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
                   ` (7 preceding siblings ...)
  2017-10-23 12:42 ` bugzilla-daemon
@ 2017-10-24  9:25 ` bugzilla-daemon
  8 siblings, 0 replies; 10+ messages in thread
From: bugzilla-daemon @ 2017-10-24  9:25 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 641 bytes --]

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

Samuel Pitoiset <samuel.pitoiset@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #8 from Samuel Pitoiset <samuel.pitoiset@gmail.com> ---
values[i].x == values[i].y == values[i].w for all indices i with radeonsi.

The issue appears to be fixed, thanks guys! Closing.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2387 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-10-24  9:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-21 17:32 [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID != gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x bugzilla-daemon
2017-10-21 17:47 ` [Bug 103393] glDispatchComputeGroupSizeARB : gl_GlobalInvocationID.x " bugzilla-daemon
2017-10-21 17:54 ` bugzilla-daemon
2017-10-21 18:19 ` bugzilla-daemon
2017-10-21 18:23 ` bugzilla-daemon
2017-10-21 18:56 ` bugzilla-daemon
2017-10-21 19:10 ` bugzilla-daemon
2017-10-21 19:26 ` bugzilla-daemon
2017-10-23 12:42 ` bugzilla-daemon
2017-10-24  9:25 ` bugzilla-daemon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.