All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
@ 2019-09-23 14:21 bugzilla-daemon
  2019-09-23 14:22 ` bugzilla-daemon
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-23 14:21 UTC (permalink / raw)
  To: dri-devel


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

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

            Bug ID: 111784
           Summary: Hang when using glWaitSync with multithreaded shared
                    GL contexts
           Product: DRI
           Version: XOrg git
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: not set
         Component: DRM/AMDgpu
          Assignee: dri-devel@lists.freedesktop.org
          Reporter: emmanueldurand@protonmail.com

Created attachment 145472
  --> https://bugs.freedesktop.org/attachment.cgi?id=145472&action=edit
Output of dmesg

I develop a tool which uses a separate thread for uploading textures to the
GPU, in parallel to the rendering thread. These two threads are synchronized
using OpenGL fences, which prevents the rendering to happen while a texture is
being copied from a PBO.

On recent AMD hardware (tested on a Vega 56 and a Radeon VII) this setup hangs
almost instantaneously. From my tests it seems that it waits for a glWaitSync
to finish. The exact same code runs flawlessly on Intel (Mesa driver) and
Nvidia (proprietary driver).

I managed to somewhat reproduce the issue in a simpler code, which merely
creates two shared OpenGL contexts and does nothing except creating fences and
waiting for the other thread. This example hangs with AMDGPU driver, but once
again runs fine on Intel (Mesa driver) and Nvidia (proprietary driver).

I'll attach the code to this thread, and it can be found here too:
https://gitlab.com/sat-metalab/splash/blob/fix/radeon_test/tests/sandbox/radeon_mesa_shared_context_freeze.cpp.

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

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

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

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

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

* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
  2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
@ 2019-09-23 14:22 ` bugzilla-daemon
  2019-09-23 14:23 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-23 14:22 UTC (permalink / raw)
  To: dri-devel


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

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

--- Comment #1 from Emmanuel Durand <emmanueldurand@protonmail.com> ---
Created attachment 145473
  --> https://bugs.freedesktop.org/attachment.cgi?id=145473&action=edit
Xorg log

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

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

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

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

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

* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
  2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
  2019-09-23 14:22 ` bugzilla-daemon
@ 2019-09-23 14:23 ` bugzilla-daemon
  2019-09-23 14:38 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-23 14:23 UTC (permalink / raw)
  To: dri-devel


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

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

--- Comment #2 from Emmanuel Durand <emmanueldurand@protonmail.com> ---
Created attachment 145474
  --> https://bugs.freedesktop.org/attachment.cgi?id=145474&action=edit
Source code exhibiting the issue

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

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

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

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

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

* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
  2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
  2019-09-23 14:22 ` bugzilla-daemon
  2019-09-23 14:23 ` bugzilla-daemon
@ 2019-09-23 14:38 ` bugzilla-daemon
  2019-09-23 15:32 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-23 14:38 UTC (permalink / raw)
  To: dri-devel


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

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

Emmanuel Durand <emmanueldurand@protonmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|not set                     |high

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

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

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

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

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

* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
  2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
                   ` (2 preceding siblings ...)
  2019-09-23 14:38 ` bugzilla-daemon
@ 2019-09-23 15:32 ` bugzilla-daemon
  2019-09-24  7:40 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-23 15:32 UTC (permalink / raw)
  To: dri-devel


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

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

Emmanuel Durand <emmanueldurand@protonmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|XOrg git                    |DRI git

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

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

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

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

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

* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
  2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
                   ` (3 preceding siblings ...)
  2019-09-23 15:32 ` bugzilla-daemon
@ 2019-09-24  7:40 ` bugzilla-daemon
  2019-09-24 15:14 ` bugzilla-daemon
  2019-09-25 18:50 ` bugzilla-daemon
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-24  7:40 UTC (permalink / raw)
  To: dri-devel


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

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

--- Comment #3 from Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> ---
Created attachment 145487
  --> https://bugs.freedesktop.org/attachment.cgi?id=145487&action=edit
output from gdb

Using the env var "GALLIUM_THREAD=0" makes the issue worse (the example hangs
at the first iteration).

One app thread is stuck at: glWaitSync(_textureUploadFence, 0,
GL_TIMEOUT_IGNORED);

The other thread is stuck waiting for the first thread to release the mutex.
Before waiting for the mutex it made a call to: "_textureUploadFence =
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);"

All the mesa internal threads are waiting for work to do.

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

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

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

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

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

* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
  2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
                   ` (4 preceding siblings ...)
  2019-09-24  7:40 ` bugzilla-daemon
@ 2019-09-24 15:14 ` bugzilla-daemon
  2019-09-25 18:50 ` bugzilla-daemon
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-24 15:14 UTC (permalink / raw)
  To: dri-devel


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

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

Alex Deucher <alexdeucher@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|DRI git                     |git
          Component|DRM/AMDgpu                  |Drivers/Gallium/radeonsi
            Product|DRI                         |Mesa
         QA Contact|                            |dri-devel@lists.freedesktop
                   |                            |.org

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

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

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

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

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

* [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts
  2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
                   ` (5 preceding siblings ...)
  2019-09-24 15:14 ` bugzilla-daemon
@ 2019-09-25 18:50 ` bugzilla-daemon
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2019-09-25 18:50 UTC (permalink / raw)
  To: dri-devel


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

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

GitLab Migration User <gitlab-migration@fdo.invalid> changed:

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

--- Comment #4 from GitLab Migration User <gitlab-migration@fdo.invalid> ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1430.

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

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

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

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

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

end of thread, other threads:[~2019-09-25 18:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23 14:21 [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts bugzilla-daemon
2019-09-23 14:22 ` bugzilla-daemon
2019-09-23 14:23 ` bugzilla-daemon
2019-09-23 14:38 ` bugzilla-daemon
2019-09-23 15:32 ` bugzilla-daemon
2019-09-24  7:40 ` bugzilla-daemon
2019-09-24 15:14 ` bugzilla-daemon
2019-09-25 18:50 ` 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.