GLX: Failed to make context currentX Error of failed request: GLXBadContextTag

284 views
Skip to first unread message

Mpereke Evans

unread,
Aug 12, 2021, 9:10:12 AM8/12/21
to ArrayFire Users

ArrayFire v3.8.0 (OpenCL, 64-bit Linux, build d99887a)
[0] NVIDIA: Quadro T2000, 3911 MB

When the ArrayFire processing thread is on abackground thread I get the following error:

GLX: Failed to make context currentX Error of failed request:  GLXBadContextTag
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  385
  Current serial number in output stream:  385
when  af::Window.show() is called.

When running from the main thread there is no error.

Pradeep Garigipati

unread,
Aug 12, 2021, 11:55:25 PM8/12/21
to Mpereke Evans, ArrayFire Users
Hello Mpereke,

OpenGL initialization i.e in this case, the first call to ArrayFire function such as af::info or af::setDevice should happen in the main thread so that OpenCL-GL interop setup happens properly on main thread where OpenGL rendering calls are issued.

Please make sure that is the case. If you are still facing the issue, kindly create a standalone snippet that replicates what you are trying to do so that I can debug the problem on my end.

Regards,
Pradeep.

--
You received this message because you are subscribed to the Google Groups "ArrayFire Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arrayfire-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/29b55bad-e9da-45c6-9ec4-d1008f6d0acen%40googlegroups.com.


--

Mpereke Evans

unread,
Sep 14, 2021, 7:09:14 AM9/14/21
to ArrayFire Users
Hi Pradeep

I found that a workaround to the problem was to also create a dummy af::window in the main for the scatter plots to work in the second thread.

It seems that calling the dummy window in the main thread set the correct OpenGL context.

see attached project for the demonstration of the problem. 

Let me know if there is a more elegant solution to the problem.
ArrayFireDemo.zip
Reply all
Reply to author
Forward
0 new messages