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

To support old Nvidia GPUs ReText should use PyOpenGL for OpenGL rendering #399

Closed
N0rbert opened this issue Oct 13, 2018 · 6 comments
Closed

Comments

@N0rbert
Copy link

N0rbert commented Oct 13, 2018

As you may know I use ReText editor very often for Markdown editing on different GPUs platforms - I have no problems on AMD/ATI and Intel.

I have two machines with Nvidia 9600 GT (using 340.104 driver) and Nvidia GT 425M (using 384.130 driver) running Ubuntu 16.04.5 LTS. Both have correctly configured OpenGL (the outputs of glxinfo, vainfo, nvidia-settings are correct).

I installed ReText with:

sudo apt-get install python3-pip
sudo -H pip3 install retext

and got black preview window when using Edit→Use WebEngine (Chromium) renderer and two kinds of errors in the console:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Received signal 11 SEGV_MAPERR 0000000001ad

and

QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
Could not link shader program:
 ""
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 
""
QOpenGLShaderProgram::uniformLocation(qt_Matrix): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 
""
...

The complete analysis is shown on AskUbuntu Q&A.

Both errors are fixable by switching to PyOpenGL (adding from OpenGL import GL to header section):

sudo -H pip3 install PyQt5==5.9.2
sudo -H pip3 install PyOpenGL
sudo sed -i "s/^from ReText.window import ReTextWindow$/from ReText.window import ReTextWindow\nfrom OpenGL import GL/" /usr/local/bin/retext

Could you please consider to use PyOpenGL in the source code by default (or at least as fallback)?

@mitya57
Copy link
Member

mitya57 commented Oct 15, 2018

Can you try to export QT_XCB_GL_INTEGRATION=xcb_egl before running ReText and see if it helps?

@N0rbert
Copy link
Author

N0rbert commented Oct 15, 2018

Thank you for reply!
But it does not help (still have black screen after clicking <Ctrl>+<L>). Console output:

$ export QT_XCB_GL_INTEGRATION=xcb_egl
$ retext 
QApplication: invalid style override passed, ignoring it.
Using configuration file: /home/user/.config/ReText project/ReText.conf
[11052:11081:1015/150217.409374:ERROR:gl_context_egl.cc(117)] eglCreateContext failed with error EGL_BAD_CONTEXT
[11052:11081:1015/150217.410372:ERROR:gl_context_egl.cc(117)] eglCreateContext failed with error EGL_BAD_CONTEXT
[11052:11081:1015/150217.411344:ERROR:gl_context_egl.cc(117)] eglCreateContext failed with error EGL_BAD_CONTEXT
[11052:11081:1015/150217.412210:ERROR:gl_context_egl.cc(117)] eglCreateContext failed with error EGL_BAD_CONTEXT

@mitya57
Copy link
Member

mitya57 commented Oct 15, 2018

Ok. One more question: can you reproduce the bug with the latest PyQt, v5.11.3?

If it is still reproducible then I will add a workaround here.

@N0rbert
Copy link
Author

N0rbert commented Oct 15, 2018

Upgrading to 5.11.3 does not help. So workaround is needed. Thank you!

@mitya57
Copy link
Member

mitya57 commented Oct 15, 2018

Can you try the linked commit? If it works for you then I will merge it to master.

I have used a workaround from this comment that does not require PyOpenGL dependency.

@N0rbert
Copy link
Author

N0rbert commented Oct 15, 2018

Just tested this commit on both 9600 GT and GT 425M - ReText is working normally.
Thank you!
I hope you will include it in main branch and next releases (to get it officially from pip3) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants