PaddlePaddle / XWorld

A C++/Python simulator package for reinforcement learning
Apache License 2.0
85 stars 63 forks source link

How to solve the OpenGL problem?? #101

Closed Luomin1993 closed 6 years ago

Luomin1993 commented 6 years ago

OK when I run ./test_xworld3d.sh I got: ERROR::SHADER::COMPILATION_FAILED: simple_texturing.vert.glsl

ERROR::SHADER::PROGRAM::LINKING_FAILED ERROR::SHADER::PROGRAM::LINKING_FAILED

I find it seems like to be a .glsl file loading error,but How Can I Fix It????

Thanks

yu239-zz commented 6 years ago

Hi, this seems to be a problem of GLSL compilation which is independent of xworld3d itself. Can you try compiling a small standalone GLSL program with OpenGL?

yu239-zz commented 6 years ago

Specifically, in RoboSchool "roboschool/cpp-household/render-simple.cpp" where "simple_texturing.vert.glsl" is compiled:

219 program_tex = GLShaderProgram::load_program(
220 "simple_texturing.vert.glsl",
221 "",
222 "simple_texturing.frag.glsl");

You can take this code block to a small standalone program and test it.

Luomin1993 commented 6 years ago

Ok,thanks,Now I'm trying to recompile the project XWorld, When the make run at compiling the roboschool part, I meet "cannot find -lOpenGL" I find " LIBS =-L/usr/lib64 -lm -lOpenGL" in the Makefile.... How can I get the -lOpenGL( I only have -lGL -lGLU )

skylian commented 6 years ago

You can try replacing -lOpenGL with -lGL. libOpenGL.so contains the core functions for OpenGL, which is cleaner than libGL.so

Luomin1993 commented 6 years ago

Please tell me how can I get the "libOpenGL.so", I can't find thar by searching...

Because I get bellow when I try replacing -lOpenGL with -lGL:

among which test_xworld3d: gl_context.cpp:37: virtual void SimpleRender::GLContext::print_info(): Assertion `glGetString(GL_VERSION)' failed.

skylian commented 6 years ago

Weird. If you reach that point, EGL context should have been created without error and you should be able to get GL_VERSION string.

Can you tell us a bit more about your environment, .e.g., graphics drivers, results of locate libEGL.

libOpenGL.so is not something you can download and install. Recent Nvidia drivers usually come with one. If you want, you can use libglvnd to generate libOpenGL.so.

Luomin1993 commented 6 years ago

Oh,thanks, finally I find the libOpenGL.so in the -L/usr/lib/nvidia-384 and I recompile that but when I run './test_xworld3d.sh' I got no Graphic or 3D Windows but only some text output:

[EGL] Detected 1 devices, among which I0905 14:01:30.182032 28026 teacher.cpp:170] Task group XWorld3DNav sentences: 709383 I0905 14:01:30.182063 28026 teacher.cpp:172] Total: 709383 I0905 14:01:33.494665 28026 test_xworld3d.cpp:55] -0.01 I0905 14:01:33.510579 28026 test_xworld3d.cpp:55] -0.01 I0905 14:01:33.527221 28026 test_xworld3d.cpp:55] -0.01 ... I0905 14:01:35.072829 28026 test_xworld3d.cpp:55] -0.01 I0905 14:01:35.088318 28026 test_xworld3d.cpp:55] -0.01 I0905 14:01:35.088397 28026 teacher.cpp:184] === XWorld3DNavTargetAvoid === I0905 14:01:35.088403 28026 teacher.cpp:184] === XWorld3DNavTargetNear === I0905 14:01:35.088409 28026 teacher.cpp:184] === XWorld3DNavTarget === I0905 14:01:35.088414 28026 teacher.cpp:184] === XWorld3DNavTargetBetween === I0905 14:01:35.088420 28026 teacher.cpp:184] === XWorld3DNavTargetDirection === I0905 14:01:35.088428 28026 test_xworld3d.cpp:60] total reward -1 WorldImpl destructor

So is this normal??

skylian commented 6 years ago

Yes, it means the example runs successfully.

By default, show_screen is turned off. You can turn it on here,

Luomin1993 commented 6 years ago

Thank you for your patience. It has been successfully run :)