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

Shader validation error #26

Closed
dyisaev opened this issue Jun 7, 2021 · 4 comments
Closed

Shader validation error #26

dyisaev opened this issue Jun 7, 2021 · 4 comments

Comments

@dyisaev
Copy link

dyisaev commented Jun 7, 2021

Thank you so much for an amazing work.
I'm trying to implement your code on my local machine.
at the steps where shaders are created I get an error.

shader = shaders.compileProgram(VERTEX_SHADER, FRAGMENT_SHADER)

ShaderValidationError: Validation failure (0):

package versions:
lucid 0.2.3
PyOpenGL 3.1.5

I would greatly appreciate any help. Thanks!

@dyisaev
Copy link
Author

dyisaev commented Jun 10, 2021

just in case, for those who need to run the code not in Google Colab, but locally (or, worse, through SSH) - I figured it out. can share with those that might need it.

@horanyinora
Copy link

Hey dyisaev,

I am currently having the same OpenGL.GL.shaders.ShaderValidationError. I would really appreciate it if you could share your code with me. I am planning to run this locally. Thanks in advance!

@dyisaev
Copy link
Author

dyisaev commented Jun 11, 2021

Hi @horanyinora ,

here you go: visualization gist

It assumes you have already run DensePose (I did not follow the authors' installation instruction, used DensePose docker container instead).

The main trick is that Colab uses it's own specific libraries to work with OpenGL (lucid), and by some dark magic is able to compile and run OpenGL in the cloud without the screen access.

On a regular Ubuntu machine, OpenGL requires X-window subsystem to render).

So for that you need the 'glfw' library. (I don't remember exactly what I did - but I likely installed it through pip).

Then you need some dark magic of properly working with GLFW library, such as binding arrays of data to shaders. For that I edited a bit the render_frame function, you will see it's a little bit different from Colab version.

Finally, if you want to compile and run OpenGL remotely through ssh you will need VirtualGL package (since simple X forwarding will try to render OpenGL on your local machine).

Thanks, and let me know if this code gives you a correct visualization, since I am going to use it too.

@erkil1452
Copy link
Owner

You can in principle get headless (no display) rendering working by switching the OpenGL to eGL (GPU accelerated) or OSMesa (SW only).

More info:

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

3 participants