Deadlock in glxCopyImageSubDataNV

I’ve got an inconsistent deadlock occurring when executing a GXLCopyImageSubDataNV. It sometimes takes hundreds of iterations to occur within the application. My suspicion is that I’m not properly calling a synchronization method - just not sure what I’m missing. Any help would be appreciated.

I’m developing on Linux and I’m using driver version: 430.64

The effective steps:

  1. Thread A: Creating a destination texture A to copy rendered image.
  2. Thread B: Render image to a texture B (separate context).
  3. Thread A: Copy texture B into texture A using glxCopyImageSubDataNV

Things I’ve tried:
Inserting glXWaitX glXWaitGL, XLockDisplay before the copies. A glFinish after step 1.
Maybe it’s a combination of the 4 calls.

Thank you,
Mark