-
Notifications
You must be signed in to change notification settings - Fork 672
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
mujoco.FatalError: gladLoadGL error #283
Comments
Fixed it I think the new mujoco implementation from deepmind make some dependencies inconsistent,(the pip install mujoco) so you need to install it the old way with paths like here https://github.com/openai/mujoco-py . |
That shouldn't be possible since our new bindings isn't relying on any path environment variable to look for any library, but perhaps I'm missing something. What environment variable did you set that made things work? |
I added the usual "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco200/bin" I didn't do things in a very scientific way so I might have changed other things that caused this but I am confident enough that it might be the one who did the fix, I first tried pip install mujoco,then pip install free-mujoco-py which both gave me the error and when I just used the open AI way with the path it worked. |
Does When you I would like to get to the bottom of this issue but I'll need your help since I cannot reproduce this on my side. Would you be able put your setup back into the configuration that caused the error and set a breakpoint in |
I met the same problem, and it cannot be solved by the easy fix. Here is the print out of render_context: "<dm_control._render.glfw_renderer.GLFWContext object at 0x7f4ed3af43d0>" |
In import ctypes
import ctypes.util
ctypes.CDLL(ctypes.util.find_library('GL'), ctypes.RTLD_GLOBAL) |
Thank you for your reply. I think it works now. Just a minor typo: "ctypes.utils"->"ctypes.util" |
Thank you, fixed the typo. I'll also try to "fix" MuJoCo itself for the next release. Some more background on what's happening: our current GLAD setup assumes that users link their choice of GL dynamic library ( In the Python use case, this isn't necessarily true. One solution would be to modify the loading code to explicitly In case anyone's interested, here's the relevant loading code that we're currently using on Linux. typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
static
int open_gl(void) {
// We try to load a GetProcAddress symbol that's already been loaded
// into the process. Since MuJoCo relies on user code to set up a working
// OpenGL environment, one of these symbols should always be present.
void* handle = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
if (handle) {
// Try EGL.
gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(handle,
"eglGetProcAddress");
if (gladGetProcAddressPtr) { return 1; }
// Try OSMesa.
gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(handle,
"OSMesaGetProcAddress");
if (gladGetProcAddressPtr) { return 1; }
// Try GLX.
gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(handle,
"glXGetProcAddressARB");
if (gladGetProcAddressPtr) { return 1; }
}
return 0; |
Can confirm this fixes the issue for me. |
MuJoCo 2.1.5 fixes this issue. |
Hi, I have tried to install mujoco using the mujoco bindings rather than using mujoco-py exactly according to the instructions mentioned in this path https://github.com/deepmind/mujoco/blob/main/python/README.md, I have tried on windows, windows subsystem for linux and google colab as well , but every time I am coming up with a new error, this time after executing "bash make_sdist.sh" , it says - MUJOCO_PLUGIN_PATH environment variable is not set, can the experts from this community suggest how to resolve this? |
@AninditaDeb Sorry about this, we need to update our documentation there. When you unpack the prebuilt MuJoCo tarball, you should find a directory in there called |
@saran-t |
@AninditaDeb You said that you were following these instructions. Step 2 says that you should download the binary release, which you should then unpack. You'll find Having said all that, reading your comments again I'm under the impression that you just want to install |
@saran-t I am not sure exactly what I am missing |
I forgot to mention when I execute MUJOCO_PATH=/home/annie07/mujoco_new pip install mujoco-2.3.1.post1.tar.gz, inside this directory /mujoco/python/dist , I get the above error |
Have you tried actually just |
Yes i did it as the first step which was basically the first step but I forgot to mention earlier. |
What happened when you |
@saran-t |
Looks like you're using this over SSH. GLFW doesn't play well over SSH since it relies on X11 (specifically glx) to render. If the machine has an Nvidia GPU, your best bet is to set the environment variable |
@saran-t I have few doubts regarding the above issue - I am working on Ubuntu20.4 LTS on windows 10 machine so as you mentioned above I executed this command (apt install libosmesa6-dev) but it seems its already installed -ss Can you please tell me exactly where do I set this variable MUJOCO_GL=osmesa? Also I was of the assumption that in Google Colab these installations will run smoothly, but after executing pip install mujoco when I run the below code Is it possible to completely avoid the rendering issues, bypass them? |
@AninditaDeb your question really has nothing to do with this issue's topic. It also has nothing to do with
We've never tested this setup, and I also don't have any expertise on how (or whether) WSL emulates X11. If you need rendering to work on Windows I reckon you'll have much better luck by just installing the Windows Python package rather than going through WSL.
This is an issue with Gym, you should ask on the authors of that package.
Again, this is a question for Gym authors. The MuJoCo bindings doesn't try to initialise the rendering stack unless someone asks it to (in this case, |
@saran-t |
hi, I have installed mujoco by |
Anyway, I resolved the error. So for those who are working on remote servers with the headless environment but have NVIDIA GPUs the following post may help: |
hi,i have the same problem, and your suggestion helps me solve it, Thanks. |
The link doesn't work. I am facing the same error with mujoco 3.1.1, while using it in singularity container on a HPC cluster. Traceback (most recent call last): |
Have you solved it? |
same here |
Hello, despite the fact that I installed all required dependencies, I get this error again and again. Does someone have any clue about how I could fix it ? Or where it comes from ?
Thank you in advance.
The text was updated successfully, but these errors were encountered: