Display issue with Qt application windows over SSH/X11
-
I'm attempting to use PyQt apps on a remote Linux server by SSH and X11 forwarding.
The application window is all black and unusable. Only the window's title bar exists to close it.
I believe it has to do with Qt and OpenGL over ssh/X11.Using Windows 10, PuTTY, VcXsrv, and the PyQt apps are on a Linux OpenSUSE 42.3 host (nVidia drivers).
The apps work fine locally. More details follow:
I can display glxgears over ssh/x11 - not optimal, but at least displays.1. Display issues with Spyder 3.2.8 & 3.3.0 with Qt/PyQt (5.9.4/5.9.2)
- Full issue description: https://github.com/spyder-ide/spyder/issues/7447
- Issue was closed since it is likely a Qt/PyQt problem.
- Spyder displays correctly over ssh/x11 when older versions of Qt/PyQt(5.6.2/5.6.0) are used
The PuTTY terminal displays following:
% spyder QQuickWidget: Failed to make context current QQuickWidget::resizeEvent() no OpenGL context QQuickWidget: Failed to make context current QQuickWidget: Failed to make context current QQuickWidget::resizeEvent() no OpenGL context QQuickWidget: Failed to make context current QQuickWidget: Attempted to render scene with no context QQuickWidget: Attempted to render scene with no context composeAndFlush: makeCurrent() failed
2. Display issues with PyQt5 opengl examples from: https://github.com/baoboa/pyqt5
- Specifically
2dpainting.py
from: https://github.com/baoboa/pyqt5/tree/master/examples/opengl - However these examples even fail with qt/pyqt(5.6.2/5.6.0) over ssh/x11, not just (5.9.4/5.9.2)
- The non-opengl examples seem to work ok. (not black filled)
QOpenGLWidget: Failed to make context current QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::setRenderHint: Painter must be active to set rendering hints QPainter::translate: Painter not active QPainter::save: Painter not active QPainter::setBrush: Painter not active QPainter::setPen: Painter not active ... QPainter::restore: Unbalanced save/restore QPainter::setPen: Painter not active QPainter::setFont: Painter not active QPainter::end: Painter not active, aborted composeAndFlush: makeCurrent() failed composeAndFlush: makeCurrent() failed QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::setRenderHint: Painter must be active to set rendering hints
Any recommendations to try for #1 & #2?
- I tried pyqt 5.11.2 but with same results.
- environment variable settings?
3. qt5/pyqt5 performance degradation over ssh/x11
This maybe a separate topic all together, but I will likely notice performance degradation over ssh/x11
if it occurs. Based on previous posts I suspect it will.Any idea if these changes will be in later versions of qt/pyqt? (To help with ssh/X11 performance)
- https://codereview.qt-project.org/#/c/181609/
- https://codereview.qt-project.org/#/c/151141/
See Bug/Posts: - https://bugreports.qt.io/browse/QTBUG-56851
- https://forum.qt.io/topic/56672/need-help-with-performance-of-qt-application-when-x11-forwarding
- https://stackoverflow.com/questions/28782162/serious-performance-problems-with-qt5-and-x11
Can anyone comments on these apps rather than the standard ssh w/x11 forwarding? (despite this ssh/x11 working fine for years for several Qt applications)
Thank you!
-
Hi and welcome to devnet,
That's a topic you should rather bring to the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.
-
Thanks for recommendation.
Done.
http://lists.qt-project.org/pipermail/interest/2018-July/030460.html -
This is the first place where Google gets me, when I was trying to find a solution for the issue I had, which was:
Qt: QOpenGLWidget: Failed to make context current
composeAndFlush: makeCurrent() failedwhen I used a Qt application over WSL2 with X11 forwarding to my Windows host with VcXsrv.
I understand this topic/question is old, but It would save me Googling time if someone described here a similar problem as I had.
What I did wrong in my case was settingLIBGL_ALWAYS_INDIRECT
env variable (it was set to1
).
As suggested in this Stackoverflow post - unset it, and unset the "Native opengl" checkbox in VcXsrv XLaunch UI, and that fixes the runtime:export LIBGL_ALWAYS_INDIRECT=
I'm on latest Windows 11 Preview with VcXsrv 1.20.9 + Ubuntu 20.04 over WSL2 with Qt 5.15.2.
My Qt Application also sets:QGuiApplication::setAttribute(Qt::AA_UseDesktopOpenGL); QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);