Skip to content
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

Main window is black when starting Spyder over ssh/X11 #7447

Closed
9 tasks done
bscipio opened this issue Jul 13, 2018 · 13 comments
Closed
9 tasks done

Main window is black when starting Spyder over ssh/X11 #7447

bscipio opened this issue Jul 13, 2018 · 13 comments

Comments

@bscipio
Copy link

bscipio commented Jul 13, 2018

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [n/a] Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

I'm attempting to use Spyder on a remote Linux server by SSH and X11 forwarding (Windows 10, PuTTY, VcXsrv).

Launch spyder (% spyder), splash screen appears, and spyder windows is black and unusable.
Only windows title bar exists to close it.

and 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

Believe issue is related to Qt/PyQt (5.9.4/5.9.2) versions.
Since same 3.3.0 version of Spyder, but older Qt/PyQt (5.6.2/5.6) will work.
More details below.

May be somewhat related to #7152 and #6968

What steps reproduce the problem?

  1. conda create -n a52spy33 anaconda=5.2
  2. conda activate a52spy33
  3. conda install spyder=3.3.0
  4. From Windows PC using PuTTY ssh to Linux host (VcXsrv for X11), and launch spyder (% spyder)
  5. Splash screen appears, and spyder windows is black (only windows title bar exists)

Spyder 3.2.8 bundled with Anaconda 5.2 also has same problem

What is the expected output? What do you see instead?

Splash screen appears, and then normal spyder app window.
Instead, splash screen appears, and spyder app window is all black.

Versions

  • Spyder version: 3.3.0
  • Python version: 3.6.5
  • Qt version: 5.9.4
  • PyQt version: 5.9.2
  • Operating System name/version: openSUSE Leap 42.3

Dependencies

(Able to provide from a local Linux login session, not over ssh/X11)

IPython >=4.0     :  6.4.0 (OK)
cython >=0.21     :  0.28.2 (OK)
jedi >=0.9.0      :  0.12.0 (OK)
matplotlib >=2.0.0:  2.2.2 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
numpy >=1.7       :  1.14.3 (OK)
pandas >=0.13.1   :  0.23.0 (OK)
psutil >=0.3      :  5.4.5 (OK)
pycodestyle >=2.3 :  2.4.0 (OK)
pyflakes >=0.6.0  :  1.6.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  1.8.4 (OK)
qtconsole >=4.2.0 :  4.3.1 (OK)
rope >=0.9.4      :  0.10.7 (OK)
sphinx >=0.6.6    :  1.7.4 (OK)
sympy >=0.7.3     :  1.1.1 (OK)

Versions that worked

Installing spyder from conda-forge uses older Qt/PyQt versions that work:
conda create -n spycf -c conda-forge spyder=3.3.0 python=3.6

  • Spyder version: 3.3.0
  • Python version: 3.6.5
  • Qt version: 5.6.2
  • PyQt version: 5.6
  • Operating System name/version: openSUSE Leap 42.3

conda create -n spy328cf -c conda-forge spyder=3.2.8 python=3.6

  • Spyder version: 3.2.8
  • Python version: 3.6.5
  • Qt version: 5.6.2
  • PyQt version: 5.6
  • Operating System name/version: openSUSE Leap 42.3
@ccordoba12
Copy link
Member

Believe issue is related to Qt/PyQt (5.9.4/5.9.2) versions.

Yes, it is, so it's not a Spyder problem. You have two options:

  1. Try to deactivate OpenGL when connecting through ssh (I don't know it it's possible).
  2. Remain at Qt/PyQt 5.6 in your server.

@bscipio
Copy link
Author

bscipio commented Jul 15, 2018

That's unfortunate, but at least a work around for the near term. Thanks.
Looks like a Qt regression to me.

Posted in Qt Forum to start:
https://forum.qt.io/topic/92664/display-issue-with-qt-application-windows-over-ssh-x11

If anyone is interested, these pyqt5 examples also have similar display issues over ssh+x11:
https://github.com/baoboa/pyqt5/tree/master/examples/opengl

@arnonerba
Copy link

Can confirm that Spyder 3.3.0 crashes with various OpenGL errors as referenced in #7152 unless Qt is downgraded to 5.6:

conda install qt=5.6* pyqt=5.6*

Windows gets "Could not Initialize GLX", while macOS gets "Unrecognized OpenGL version".

@bscipio, please let me know if I can provide you with any debugging info if you are going to bring this to the attention of the Qt maintainers.

@bscipio
Copy link
Author

bscipio commented Jul 21, 2018

I started a thread here: http://lists.qt-project.org/pipermail/interest/2018-July/030460.html
as recommended by someone at forum.qt.io. Haven't seen much response there.

It might be better to add to https://bugreports.qt.io/projects/QTBUG/issues/
and to point out the provided pyqt5/opengl examples fail from:

@arnonerba It would be good to know if those examples fail for you too.

@bscipio
Copy link
Author

bscipio commented Aug 5, 2018

Qt Creator has similar bugs when used over ssh + X11.

Another with similar sounding behavior:
https://bugreports.qt.io/browse/QTBUG-68449

@arnonerba
Copy link

Interesting. It looks like I can't launch Qt Creator over SSH to run the demos. It fails with the same "Unrecognized OpenGL version" error.

I'll keep an eye on the open bug reports.

@bscipio
Copy link
Author

bscipio commented Aug 13, 2018

FYI
Rstudio was found to have a very similar issue.
But has configuration options to use software rendering, and can be set via .ini file.

I'm not sure if similar configuration options are theoretically possible additions to spyder. Assuming they'd help.

@ccordoba12
Copy link
Member

Ok, thanks a lot for this pointer. We'll try to use the same options in Spyder.

@ccordoba12
Copy link
Member

@bscipio, I implemented your suggestion in PR #7700.

@ccordoba12
Copy link
Member

And it'll be available since our 3.3.2 version.

@bscipio
Copy link
Author

bscipio commented Aug 16, 2018

Thanks @ccordoba12

Though sorry to say that I'm still having the same errors occur with #7700

QQuickWidget: Failed to make context current
QQuickWidget::resizeEvent() no OpenGL context

I did test RStudio 1.2.907 with "software" set and it did display ok (Otherwise same error). So something unique to Spyder is going on.

What I tried - hopefully not user error:
Download .zip and extract:
https://github.com/spyder-ide/spyder/tree/d5d39de3b190784c954dd04741d0d41c97f5b6c3

% conda create -n spytest spyder
% conda activate spytest
% conda remove spyder
# goto d5d39d spyder folder
# from Putty SSH+X11 Forwarding session with VcXsrv  1.20.0.1
% python bootstrap.py -- --opengl=software
Executing Spyder from source checkout
Revision None, Branch: None
01. Patched sys.path with /home/user/Downloads/spyder-d5d39de3b190784c954dd04741d0d41c97f5b6c3
02. PyQt5 is detected, selecting
03. Imported Spyder 3.3.2.dev0
    [Python 3.7.0 64bits, Qt 5.9.6, PyQt5 5.9.2 on Linux]
04. Running Spyder
Bootstrap completed in 00:00:00.3885
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
QQuickWidget: Failed to make context current
QQuickWidget::resizeEvent() no OpenGL context

Tested on CentOS 7 server, Intel graphics.

FYI:
% LIBGL_ALWAYS_INDIRECT=1 python bootstrap.py -- --opengl=software
Can get rid of 2 "libGL error" messages, but otherwise same result.

Running spyder locally I was able to see the new "rendering engine" preference.

@bscipio
Copy link
Author

bscipio commented Aug 19, 2018

@ccordoba12
I looked more closely at rstudio, and found:
https://github.com/rstudio/rstudio/blob/abc216f3ce5ac01ffb0308e88734764e3ab90a2a/src/cpp/desktop/DesktopMain.cpp#L291

So on a hunch I added equivalent lines to: spyder/app/mainwindow.py (starting with commit 900e0e6 )

from PyQt5.QtQuick import QQuickWindow, QSGRendererInterface   # New
# Note: I did find not a way to:
# from qtpy.QtQuick import QQuickWindow, QSGRendererInterface

# ~line 3123
if options.opengl_implementation == 'software':
    QCoreApplication.setAttribute(Qt.AA_UseSoftwareOpenGL)
    QQuickWindow.setSceneGraphBackend(QSGRendererInterface.Software)  # New
# and so on for CONF and opengl='desktop'

and then spyder displayed over SSH + X11
when --opengl=software was used.

@ccordoba12
Copy link
Member

ccordoba12 commented Aug 19, 2018

These are great news! Thanks @bscipio for digging deep into this one.

I'll prepare a new PR to fix this.

@ccordoba12 ccordoba12 reopened this Aug 19, 2018
@ccordoba12 ccordoba12 changed the title Display issues over ssh/X11 with Spyder 3.2.8 & 3.3.0 with Qt/PyQt (5.9.4/5.9.2) Main window is black when starting Spyder over ssh/X11 Aug 19, 2018
@ccordoba12 ccordoba12 added this to the v3.3.2 milestone Aug 19, 2018
@ccordoba12 ccordoba12 self-assigned this Aug 19, 2018
Chilipp added a commit to psyplot/psyplot-gui that referenced this issue Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants