From: bugzilla-daemon@freedesktop.org Subject: [Bug 111784] Hang when using glWaitSync with multithreaded shared GL contexts Date: Mon, 23 Sep 2019 14:21:18 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0762340358==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 88FB96E929 for ; Mon, 23 Sep 2019 14:21:18 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0762340358== Content-Type: multipart/alternative; boundary="15692484781.deda0dd.17404" Content-Transfer-Encoding: 7bit --15692484781.deda0dd.17404 Date: Mon, 23 Sep 2019 14:21:18 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D111784 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=3D145472&action=3Dedit 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 ha= ngs almost instantaneously. From my tests it seems that it waits for a glWaitSy= nc 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 on= ce 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/ra= deon_mesa_shared_context_freeze.cpp. --=20 You are receiving this mail because: You are the assignee for the bug.= --15692484781.deda0dd.17404 Date: Mon, 23 Sep 2019 14:21:18 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 111784
Summary Hang when using glWaitSync with multithreaded shared GL conte= xts
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 [details]
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 ha=
ngs
almost instantaneously. From my tests it seems that it waits for a glWaitSy=
nc
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 on=
ce
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-meta=
lab/splash/blob/fix/radeon_test/tests/sandbox/radeon_mesa_shared_context_fr=
eeze.cpp.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15692484781.deda0dd.17404-- --===============0762340358== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0762340358==--