[Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Sep 23 14:21:18 UTC 2019


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 at lists.freedesktop.org
          Reporter: emmanueldurand at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190923/93fba43e/attachment.html>


More information about the dri-devel mailing list