Open dhirschfeld opened 6 years ago
This probably means you do not have good enough (or any?) opengl drivers installed for your GPU.
Can you try running some opengl software?
Can you also see if you have C:\Windows\System32\D3DCompiler_47.dll (or maybe some other number) present on your computer?
I'll check in the morning. It's a Citrix Win7 VDI so that may complicate things. I'm trying to get the VDi updated to Win10 and if that fixes it I'll be happy enough...
Interesting, it might yeah. I don't know anything about Citrix, is there anywhere I can see the OpenGL and DirectX support level documented? Was Qt 5.6 problem-free here? (I guess so).
The way 3D works in Qt works these days (but this has been the same since 5.6 and even before) is that it tries to use OpenGL (called 'desktop' mode) via your GPU vendors drivers and if those fail to provide the necessary features then it falls back to something by Google called ANGLE (almost native GL emulation) which builds on top of DirectX (11 I believe).
I wouldn't expect a lot to have changed about this setup between 5.6 and 5.9 (perhaps QtWebEngine - which now replaces QtWebKit - needs richer framebuffers that your OpenGL drivers do not support, or perhaps ANGLE needs DirectX 11 instead of 9).
If you can run Spyder against 5.6 and use process hacker 2 to view the loaded DLLs we should be able to determine whether it's falling back to ANGLE or not. You can also force ANGLE in cmd.exe by doing:
set QT_OPENGL=angle
and you can force 'desktop' mode with:
set QT_OPENGL=desktop
It would be interesting to know whether either of these work / do not work with spyder on both 5.6 and 5.9 if you have time to do these tests?
Finally you could try moving C:\Windows\System32\D3DCompiler_47.dll beside the python executable to see if that changes things. If you don't have this file (you may be able to get away with a different version of it, perhaps try renaming it to _47.dll though?) then there's no chance that ANGLE mode will work.
Another thing to try is to run C:\Windows\System32\dxdiag.exe
and see what output it gives.
As a final fallback, I could provide opengl32sw.dll
(it comes as part of mesa) but when it's used the performance will be terrible since it's a software rasteriser so before I consider that I'm afraid you are a useful test-case to figure out these compatibility issues; we want the best performance for as many people as possible.
Thanks for looking into it @mingwandroid - debug output is given below...
λ $env:QT_OPENGL='angle'
C:\dev\src\spyder [master ≡]
λ python .\bootstrap.py
Executing Spyder from source checkout
Revision cf6cbaec0, Branch: master
01. Patched sys.path with C:\dev\src\spyder
02. PyQt5 is detected, selecting
03. Imported Spyder 4.0.0.dev0
[Python 3.6.5 64bits, Qt 5.9.4, PyQt5 5.9.2 on Windows]
04. Running Spyder
Bootstrap completed in 00:00:02.1761
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile)) .
This is most likely caused by not having the necessary graphics drivers installed.
Install a driver providing OpenGL 2.0 or higher, or, if this is not possible, make sure the ANGLE Open GL ES 2.0 emulation libraries (libEGL.dll, libGLESv2.dll and d3dcompiler_*.dll) are available in the application executable's directory or in a location listed in PATH.
λ $env:QT_OPENGL='desktop'
C:\dev\src\spyder [master ≡]
λ python .\bootstrap.py
Executing Spyder from source checkout
Revision cf6cbaec0, Branch: master
01. Patched sys.path with C:\dev\src\spyder
02. PyQt5 is detected, selecting
03. Imported Spyder 4.0.0.dev0
[Python 3.6.5 64bits, Qt 5.9.4, PyQt5 5.9.2 on Windows]
04. Running Spyder
Bootstrap completed in 00:00:02.0952
C:\dev\src\spyder [master ≡]
...so with 'desktop'
there is no output in the console - just a python segfault in Qt5WebEngineCore.dll
. With 'angle'
the segfault is in ucrtbase.dll
I do appear to have C:\Windows\System32\D3DCompiler_47.dll
:
Copying that dll into my sys.prefix
didn't appear to change anything - same output as for angle and ucrtbase.dll
exception
Output from dxdiag.exe
I enabled faulthandler
but it didn't seem to give any further useful info:
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile)) .
This is most likely caused by not having the necessary graphics drivers installed.
Install a driver providing OpenGL 2.0 or higher, or, if this is not possible, make sure the ANGLE Open GL ES 2.0 emulation libraries (libEGL.dll, libGLESv2.dll and d3dcompiler_*.dll) are available in the application executable's directory or in a location listed in PATH. Fatal Python error: Aborted
Thread 0x000048d8 (most recent call first):
File "C:\Miniconda3\lib\socket.py", line 205 in accept
File "C:\dev\src\spyder\spyder\app\mainwindow.py", line 2771 in start_open_files_server
File "C:\Miniconda3\lib\threading.py", line 864 in run
File "C:\Miniconda3\lib\threading.py", line 916 in _bootstrap_inner
File "C:\Miniconda3\lib\threading.py", line 884 in _bootstrap
Current thread 0x00004450 (most recent call first):
File "C:\dev\src\spyder\spyder\plugins\ipythonconsole.py", line 1579 in add_tab
File "C:\dev\src\spyder\spyder\plugins\ipythonconsole.py", line 1051 in create_new_client
File "C:\dev\src\spyder\spyder\plugins\ipythonconsole.py", line 760 in toggle_view
File "C:\dev\src\spyder\spyder\plugins\base.py", line 175 in <lambda>
File "C:\dev\src\spyder\spyder\utils\qthelpers.py", line 456 in newfunc
File "C:\dev\src\spyder\spyder\app\mainwindow.py", line 2100 in create_plugins_menu
File "C:\dev\src\spyder\spyder\app\mainwindow.py", line 1237 in post_visible_setup
File "C:\dev\src\spyder\spyder\app\mainwindow.py", line 3091 in run_spyder
File "C:\dev\src\spyder\spyder\app\mainwindow.py", line 3205 in main
File "C:\dev\src\spyder\spyder\app\start.py", line 162 in main
File ".\bootstrap.py", line 180 in <module>
[23192:20880:0412/113452.009:ERROR:broker_win.cc(59)] Error reading broker pipe: The pipe has been ended. (0x6D)
[24676:18948:0412/113452.010:ERROR:broker_win.cc(59)] Error reading broker pipe: The pipe has been ended. (0x6D)
Can you try the DLLs from here please?
Some Qt bug references:
https://bugreports.qt.io/browse/QTBUG-44756 https://bugreports.qt.io/browse/QTBUG-57004
And some documentation:
In case it helps below are the loaded DLLs from Process Explorer for the working conda-forge qt=5.6.2
Testing out opengl32sw-64.7z
...
BTW, we've been a little lucky with out PyQt based applications in that they work with PyQt 5.6 and also with PyQt 5.9 and our dependencies are set so as to allow either to work so you should be able to still use new versions of spyder, navigator and orange3 with PyQt 5.6.
You will run into trouble with the upcoming RStudio 1.2 which absolutely needs Qt 5.9 (for QtWebEngine which is basically Chromium).
A Kivy
bug related to using ANGLE
on Citrix VM
with some hints about multisampling/antialiasing but I suspect we are first of all running into a need for OpenGL >= 3 and Citrix providing only 2 (if any at all) - if you can figure a way to check the GL level that Citrix provides here I'd appreciate it. I think the subsequent ANGLE
failure could be the multisampling/antialiasing issue.
I put the opengl32sw.dll
from that link in my Python folder and spyder works fine. The console output is:
λ python .\bootstrap.py
Executing Spyder from source checkout
Revision cf6cbaec0, Branch: master
01. Patched sys.path with C:\dev\src\spyder
02. PyQt5 is detected, selecting
03. Imported Spyder 4.0.0.dev0
[Python 3.6.5 64bits, Qt 5.9.4, PyQt5 5.9.2 on Windows]
04. Running Spyder
Bootstrap completed in 00:00:02.1512
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
@mingwandroid, I'm almost sure the PyQt wheel comes with opengl32sw.dll
because we haven't heard of this bug in a long time.
I'll get our Citrix engineers to look into it. Thanks again for your help! I'll report back whatever I find out...
Hey Carlos, no it doesn't, at least our builds do not and have not (at least none I have built or seen). I need to add it to the qt package anyway. It should be safe enough to do since it's only used when two better (hardware accelerated) options fail to work.
This bug is likely due to needing a more modern graphics stack for Qt 5.9 than Citrix VM provides (I've provided a good amount of links here if you want to verify or dispute this claim).
@dhirschfeld, can I trouble you to also try the other opengl DLLs in that link I provided? I would like to use the most recent one (the 2016 one I think) but need to know that it works well enough, so if you can test as many Qt apps as possible I'd be very grateful. I have RStudio 1.2 pre release builds on anaconda.org/rdonnelly too.
I know it's cheeky to ask for so much from you but if you can also run these tests in a 32 bit install with the 32 bit DLLs (obviously!) that would be really great. I don't know how else I can test this unfortunately.
Thanks for asking Citrix about this too!
The qt apps I know of are anaconda-navigator, spyder, orange3 and RStudio. Conda-forge may have some others but they may be incompatible for other reasons (pyqt ones might work, C++ ones stand no chance without recompilation).
@ccordoba12:
PyQt wheel comes with opengl32sw.dll
I didn't read this right first time. Ah yes, I expect they probably do.
Spyder also worked fine with both the mesa 11.2.2 and 12.0.rc2 versions on my Citrix desktop.
Will see what I can do about 32bit testing...
Hello again @dhirschfeld, sorry to revive such an old thread. Did you manage any 32-bit tests here?
Hi Ray, sorry I never did get around to testing with 32bit. I can't use my current desktop to do so but I can probably get a different VDI to test with. Will try to do so this week and let you know there results...
After updating to the latest qt spyder is now broken (win64/py36):
Issue moved from spyder-ide/spyder#6938
@ccordoba12 suggested the issue to be with the qt package which should be packaging the missing
opengl32sw.dll