-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace GLX with EGL for X11 #389
Replace GLX with EGL for X11 #389
Conversation
893c862
to
299be6b
Compare
This is great! If we can make this reliable enough, I would be very keen to merge. Especially if we can support the use case of a frame buffer without window. |
I posted the issue with the blank window with certain nvidia drivers with a minimal example at the nvidia forum: https://devtalk.nvidia.com/default/topic/1037901/x11-with-egl-produces-black-window-for-driver-versions-gt-384 . Since this issue also appears in the official mesa example, I somehow suspect that this is a driver issue. When this works, going to windowless should be easy. We could even separate the EGL context creation into a class that is used by X11, Wayland and windowless. |
4935a80
to
d74ffff
Compare
The X11+EGL window and context creation now works in a threaded environment. |
f8dfdc5
to
c47722c
Compare
So did you manage to work around the NVidia issue that you references? |
The nvidia driver issue is unrelated to Pangolin, it also appears for the minimal EGL example that I posted in the nvidia forum https://devtalk.nvidia.com/default/topic/1037901/x11-with-egl-produces-black-window-for-driver-versions-gt-384 . It seems to only occur with the nvidia drivers > 384 from the official CUDA repository for Ubuntu. E.g. it is working on other distributions or using the nvidia installation script (see post by matthewcmatl in the linked nvidia issue). |
c47722c
to
58897ba
Compare
Okay, I'm excited to merge this, but I guess I should wait until the Ubuntu package is fixed. |
02bbb29
to
a46b43f
Compare
a46b43f
to
db1bade
Compare
db1bade
to
1084c0e
Compare
I can confirm that the X11+EGL feature is working now with nvidia driver versions 390.48 (Ubuntu 18.04 repo) and 410.48 (CUDA repo). |
Are there any downsides to this implementation, or should I now consider this for merge? |
I am using this branch for quite a while now on Ubuntu 14.04 and 18.04 with Nvidia drivers from the CUDA repo. I think it would be good if this branch could be tested by others in different configurations to see if this issue with black windows still exists. |
3c1b90d
to
953fd9c
Compare
f74813f
to
892115d
Compare
892115d
to
269ce4b
Compare
269ce4b
to
036bc71
Compare
Hi all, I tried this PR in a Ubuntu 22.04 docker with X11. HelloPangolin works as expected. This PR helps me to solve my issue (libtorch+Pangolin segfault, see #884). Thank you very much. The only thing I think is a little bit verbose is that I have to link explicitly Here is my current
The EGL is explicitly added here. If I don't do this, I will have this error:
|
5bf16e8
to
5ac285a
Compare
5ac285a
to
8f49e99
Compare
21bded5
to
2488c55
Compare
6e54f4e
to
465713f
Compare
Thanks to this MR, save me from OpenGL errors |
465713f
to
9c7e45a
Compare
9c7e45a
to
5af0413
Compare
@stevenlovegrove I've tested this successfully on Intel and Nvidia systems natively on X11 and via XWayland Wayland display servers. Since this removes the GLX dependency completely and fixes issues reported by others (#782, ), I would finally like to merge this now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
This prevents memory leaks since the xkb context is not free'ed if the exception is thrown.
This PR replaces GLX by EGL for the X11 windowing and fixes potential issues like: #74 #242 #260. Example programs like
SimpleDisplay
work already.Before continuing working on this: Will replacing GLX by EGL be potentially merged? This will remove the GLX dependency but adds and dependency on EGL (which is also required by Android).
EDIT: With NVIDIA drivers > 384 (390, 396), the window content does not update and stays black.
Fixes #782.