Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

GL ERROR: src=33350,id=20,sev=37190 GL_INVALID_VALUE in glUseProgram #51

Closed
p-e-w opened this issue Dec 9, 2018 · 6 comments
Closed

Comments

@p-e-w
Copy link
Contributor

p-e-w commented Dec 9, 2018

Describe the bug
Sometimes, when running a simple Curv program like cube, the viewer displays the shape, but the following lines appear in the terminal, repeated on every frame:

GL ERROR: src=33350,id=20,sev=37190 GL_INVALID_VALUE in glUseProgram
GL ERROR: src=33350,id=20,sev=37190 GL_INVALID_OPERATION in glUniform1("u_resolution"@1 has 2 components, not 1)

This does not always happen and there is no apparent pattern to when it does.

Curv Program

cube

To Reproduce
Cannot be reliably reproduced, although after it happens with one expression it generally happens for all expressions that are subsequently evaluated in the same Curv session.

System Information (please complete the following information):

  • Operating System: Fedora 28
  • CPU manufacturer, model, version, and # of cores: Intel® Core™ i5-6440HQ CPU @ 2.60GHz × 4
  • Amount of system memory: 15.5 GiB
  • GPU manufacturer, model and version: Intel® HD Graphics 530 (Skylake GT2)
  • GPU driver, if on Linux: Open source
  • Are you running the curv command using a remote viewing protocol like VNC or NX? No
  • Are you running the curv command inside a VM? No
  • Curv Version: run the command curv --version and paste the output here.
$ curv --version
Curv: 0.3-128-g3521724
Compiler: gcc 8.2.1 20181105 (Red Hat 8.2.1-5)
Kernel: Linux 4.19.3-200.fc28.x86_64 x86_64
GPU: Intel Open Source Technology Center, Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2) 
OpenGL: 3.0 Mesa 18.0.5
@doug-moen
Copy link
Member

I'm testing using Intel HD 2500 graphics and Ubuntu 16.04. So far, I am unable to reproduce this just by repeatedly running cube. At this point, I am unsure if this is a bug in Curv or a bug in your graphics driver.

If there is an error printed on every frame, then the OpenGL program is in a bad state, and there was probably a more meaningful error printed initially, before the cascade of per-frame messages started spewing. I can probably do a better job of managing the OpenGL error messages.

doug-moen added a commit that referenced this issue Dec 19, 2018
Less noise means better error reporting.
Once a severe OpenGL error occurs while rendering a frame, rendering stops,
the Viewer window goes black, and we won't print any more error messages.
Loading a new shape resets the Viewer window.
@doug-moen
Copy link
Member

The latest version of Curv will not go into a loop, printing OpenGL error messages on each frame. This means you should see higher quality error messages the next time this bug occurs, and those error messages should help in narrowing down what the problem is.

@doug-moen
Copy link
Member

The bug report says "Cannot be reliably reproduced, although after it happens with one expression it generally happens for all expressions that are subsequently evaluated in the same Curv session."

This suggests that the OpenGL context has got into a bad state. And the bad state seems to persist even after loading a new shape.

One of the error messages is:

GL ERROR: src=33350,id=20,sev=37190 GL_INVALID_VALUE in glUseProgram

In previous versions of Curv, after loading a shader program, I used to call glUseProgram to run the program, even if the program was invalid (because it had failed to compile). And that could lead to this error being displayed. The new version of Curv stops rendering after a shader program has failed to compile, or if OpenGL errors are reported when rendering a frame. These changes are intended to make Curv more robust, because I'm trying not to ask OpenGL to render things if the context is in an error state. These changes might even fix this bug, although I can't verify that.

I suggest you try again with the new version, and see if the bug persists. At the very least, we should get a better error message.

@doug-moen
Copy link
Member

@p-e-w: I'm going to close this for now. If you can reproduce the problem with the new version of Curv, please reopen the issue and post the error messages that are generated.

@p-e-w
Copy link
Contributor Author

p-e-w commented Dec 22, 2018

@doug-moen This still happens with the latest master. And now I have found a reliable way to reproduce:

$ curv
curv> cube
3D shape 2×2×2      <-- close the preview window
curv> cube
3D shape 2×2×2
curv> GL ERROR: src=33350,id=20,sev=37190 GL_INVALID_VALUE in glUseProgram
GL ERROR: src=33350,id=20,sev=37190 GL_INVALID_OPERATION in glUniform1("u_resolution"@1 has 2 components, not 1)

That's it, just evaluate cube, close the preview window, then evaluate cube again. The preview window is black and the above error message (and nothing else) is printed.

@doug-moen
Copy link
Member

Thank you for giving me a reproducible test case. It happens for me as well, now I can fix this.

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

No branches or pull requests

2 participants