-
Notifications
You must be signed in to change notification settings - Fork 813
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
Offscreen render does not work (GLEW initalization error: Missing GL version) #408
Comments
I am having the same problem. |
Have you already looked at #268 ? |
At least, I already tried the solution for
|
It seems like if you have it render in 'window' mode for the first time, there will be no error. But the following offscreen render will be all zeros (black) matrix. (So, I still didn't fix it.) |
After gained some insight from my several tests, I found that letting the system render on screen or make a 'window' mode render context will get rid of the problem. But that would lead to a serious buffer problem and get only all zero numpy arrays if you keep using that context viewer, which might due to some OpenGL buffer problems. Solution
|
I face exactly the same issue. |
This solved my issue in Ubuntu 18.04.3 LTS: |
Issue's been solved!!See #408 (comment) I was having the same problem. I tried below yet, none of them had worked.
Spec
import gym
from gym.wrappers import Monitor
env = gym.make('HalfCheetah-v2')
env = Monitor(env, './video', force=True)
env.reset()
while True:
obs, r, done, info = env.step([0, 0, 0, 0, 0, 0])
if done: break |
Recently while installing mujoco-py in a new conda environment to use tensorflow-gpu 1.13.1, I faced the same problem again. My problem was resolved by installing tensorflow-gpu and glew using conda instead of pip. This will also install the supported cuda version in the conda and it might have solved my issue. |
@RajK853 So, after I created the empty dir named Edit: I am running scripts on PyCharm, which requires some tricky bit in terms of |
Hi, I have the folder $ ll /usr/lib/nvidia-410
total 196224
drwxr-xr-x 6 root root 4096 Jul 30 11:34 ./
drwxr-xr-x 188 root root 20480 Jan 13 23:30 ../
-rw-r--r-- 1 root root 0 Nov 15 2018 alt_ld.so.conf
drwxr-xr-x 2 root root 4096 Jul 30 11:34 bin/
-rw-r--r-- 1 root root 42 Nov 15 2018 ld.so.conf
lrwxrwxrwx 1 root root 23 Nov 15 2018 libEGL_nvidia.so.0 -> libEGL_nvidia.so.410.78
-rw-r--r-- 1 root root 1031552 Nov 11 2018 libEGL_nvidia.so.410.78
lrwxrwxrwx 1 root root 16 Nov 15 2018 libEGL.so -> libEGL.so.410.78
lrwxrwxrwx 1 root root 16 Nov 15 2018 libEGL.so.1 -> libEGL.so.410.78
-rw-r--r-- 1 root root 73328 Nov 11 2018 libEGL.so.1.1.0
-rw-r--r-- 1 root root 23392 Nov 11 2018 libEGL.so.410.78
-rw-r--r-- 1 root root 732408 Nov 11 2018 libGLdispatch.so.0
lrwxrwxrwx 1 root root 29 Nov 15 2018 libGLESv1_CM_nvidia.so.1 -> libGLESv1_CM_nvidia.so.410.78
-rw-r--r-- 1 root root 60200 Nov 11 2018 libGLESv1_CM_nvidia.so.410.78
lrwxrwxrwx 1 root root 17 Nov 15 2018 libGLESv1_CM.so -> libGLESv1_CM.so.1
lrwxrwxrwx 1 root root 21 Jul 30 11:34 libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.2.0
-rw-r--r-- 1 root root 43696 Nov 11 2018 libGLESv1_CM.so.1.2.0
lrwxrwxrwx 1 root root 26 Nov 15 2018 libGLESv2_nvidia.so.2 -> libGLESv2_nvidia.so.410.78
-rw-r--r-- 1 root root 111400 Nov 11 2018 libGLESv2_nvidia.so.410.78
lrwxrwxrwx 1 root root 14 Nov 15 2018 libGLESv2.so -> libGLESv2.so.2
lrwxrwxrwx 1 root root 18 Jul 30 11:34 libGLESv2.so.2 -> libGLESv2.so.2.1.0
-rw-r--r-- 1 root root 83280 Nov 11 2018 libGLESv2.so.2.1.0
lrwxrwxrwx 1 root root 10 Nov 15 2018 libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root 15 Nov 15 2018 libGL.so.1 -> libGL.so.410.78
-rw-r--r-- 1 root root 685848 Nov 11 2018 libGL.so.1.7.0
-rw-r--r-- 1 root root 1270576 Nov 11 2018 libGL.so.410.78
lrwxrwxrwx 1 root root 23 Nov 15 2018 libGLX_indirect.so.0 -> libGLX_nvidia.so.410.78
lrwxrwxrwx 1 root root 23 Nov 15 2018 libGLX_nvidia.so.0 -> libGLX_nvidia.so.410.78
-rw-r--r-- 1 root root 1270576 Nov 11 2018 libGLX_nvidia.so.410.78
lrwxrwxrwx 1 root root 11 Nov 15 2018 libGLX.so -> libGLX.so.0
-rw-r--r-- 1 root root 65168 Nov 11 2018 libGLX.so.0
lrwxrwxrwx 1 root root 15 Nov 15 2018 libnvcuvid.so -> libnvcuvid.so.1
lrwxrwxrwx 1 root root 20 Nov 15 2018 libnvcuvid.so.1 -> libnvcuvid.so.410.78
-rw-r--r-- 1 root root 2807440 Nov 11 2018 libnvcuvid.so.410.78
-rw-r--r-- 1 root root 370984 Nov 11 2018 libnvidia-cbl.so.410.78
lrwxrwxrwx 1 root root 18 Nov 15 2018 libnvidia-cfg.so -> libnvidia-cfg.so.1
lrwxrwxrwx 1 root root 23 Nov 15 2018 libnvidia-cfg.so.1 -> libnvidia-cfg.so.410.78
-rw-r--r-- 1 root root 179528 Nov 11 2018 libnvidia-cfg.so.410.78
lrwxrwxrwx 1 root root 23 Nov 15 2018 libnvidia-compiler.so -> libnvidia-compiler.so.1
lrwxrwxrwx 1 root root 28 Nov 15 2018 libnvidia-compiler.so.1 -> libnvidia-compiler.so.410.78
-rw-r--r-- 1 root root 47842480 Nov 11 2018 libnvidia-compiler.so.410.78
-rw-r--r-- 1 root root 25215360 Nov 11 2018 libnvidia-eglcore.so.410.78
lrwxrwxrwx 1 root root 30 Nov 15 2018 libnvidia-egl-wayland.so.1 -> libnvidia-egl-wayland.so.1.1.0
-rw-r--r-- 1 root root 32904 Nov 11 2018 libnvidia-egl-wayland.so.1.1.0
lrwxrwxrwx 1 root root 21 Nov 15 2018 libnvidia-encode.so -> libnvidia-encode.so.1
lrwxrwxrwx 1 root root 26 Nov 15 2018 libnvidia-encode.so.1 -> libnvidia-encode.so.410.78
-rw-r--r-- 1 root root 168184 Nov 11 2018 libnvidia-encode.so.410.78
-rw-r--r-- 1 root root 292840 Nov 11 2018 libnvidia-fatbinaryloader.so.410.78
lrwxrwxrwx 1 root root 18 Nov 15 2018 libnvidia-fbc.so -> libnvidia-fbc.so.1
lrwxrwxrwx 1 root root 23 Nov 15 2018 libnvidia-fbc.so.1 -> libnvidia-fbc.so.410.78
-rw-r--r-- 1 root root 119048 Nov 11 2018 libnvidia-fbc.so.410.78
-rw-r--r-- 1 root root 27018280 Nov 11 2018 libnvidia-glcore.so.410.78
-rw-r--r-- 1 root root 580856 Nov 11 2018 libnvidia-glsi.so.410.78
-rw-r--r-- 1 root root 13792536 Nov 11 2018 libnvidia-glvkspirv.so.410.78
lrwxrwxrwx 1 root root 18 Nov 15 2018 libnvidia-ifr.so -> libnvidia-ifr.so.1
lrwxrwxrwx 1 root root 23 Nov 15 2018 libnvidia-ifr.so.1 -> libnvidia-ifr.so.410.78
-rw-r--r-- 1 root root 206888 Nov 11 2018 libnvidia-ifr.so.410.78
lrwxrwxrwx 1 root root 17 Nov 15 2018 libnvidia-ml.so -> libnvidia-ml.so.1
lrwxrwxrwx 1 root root 22 Nov 15 2018 libnvidia-ml.so.1 -> libnvidia-ml.so.410.78
-rw-r--r-- 1 root root 1528152 Nov 11 2018 libnvidia-ml.so.410.78
lrwxrwxrwx 1 root root 34 Jul 30 11:34 libnvidia-ptxjitcompiler.so.1 -> libnvidia-ptxjitcompiler.so.410.78
-rw-r--r-- 1 root root 12129192 Nov 11 2018 libnvidia-ptxjitcompiler.so.410.78
-rw-r--r-- 1 root root 27151728 Nov 11 2018 libnvidia-rtcore.so.410.78
-rw-r--r-- 1 root root 13080 Nov 11 2018 libnvidia-tls.so.410.78
lrwxrwxrwx 1 root root 23 Jul 30 11:34 libnvidia-wfb.so.1 -> libnvidia-wfb.so.410.78
-rw-r--r-- 1 root root 295416 Jun 4 2018 libnvidia-wfb.so.410.78
lrwxrwxrwx 1 root root 20 Jul 30 11:34 libnvoptix.so.1 -> libnvoptix.so.410.78
-rw-r--r-- 1 root root 35398672 Nov 11 2018 libnvoptix.so.410.78
lrwxrwxrwx 1 root root 14 Nov 15 2018 libOpenGL.so -> libOpenGL.so.0
-rw-r--r-- 1 root root 215824 Nov 11 2018 libOpenGL.so.0
drwxr-xr-x 2 root root 4096 Jul 30 11:34 tls/
drwxr-xr-x 2 root root 4096 Jul 30 11:34 vdpau/
drwxr-xr-x 2 root root 4096 Jul 30 11:34 xorg/ And echo $LD_LIBRARY_PATH
/home/cong/ros_ws/dual_ws/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/usr/local/cuda-10.0/lib64:/home/cong/.mujoco/mujoco200/bin:/usr/lib/nvidia-410 When I run the code import gym
from gym.wrappers import Monitor
env = gym.make('HalfCheetah-v2')
env = Monitor(env, './video', force=True)
env.reset()
while True:
obs, r, done, info = env.step([0, 0, 0, 0, 0, 0])
if done: break I also get the error: ERROR: GLEW initalization error: Missing GL version
Press Enter to exit ... |
@wangcongrobot did you find the solution? |
@seyeeet I use Unity3d to render. |
Has anyone been able to come up with a solution to this problem? |
To sum up: do not link the libraries provided by system packages (e.g., libglew-dev and libegl1-mesa)
Instead, link the libraries provided by mujoco and nvidia:
A proper environment setup may look like this:
ExplanationInside mujoco-py/mujoco_py/gl/eglshim.c Lines 113 to 119 in 4830435
If the glew library provided by system (libglew-dev) is linked, the /* query opengl version */
s = glGetString(GL_VERSION);
dot = _glewStrCLen(s, '.');
if (dot == 0)
return GLEW_ERROR_NO_GL_VERSION; Which results in the error in the issue. It seems that the EGL is correctly initialized, but the system glew library cannot correctly detect it. However, mujoco's Also, Above code comes from
A working machine reports the dependency like this:
A non-working machine will typically include dependencies like:
And once you added |
When I reinstall my OS system from Ubuntu16.04 to Ubuntu18.04, the solution above works fine. |
Hi @Vigilans! Thank you for coming up with what seems to be a viable solution. 😄 However, I am not very proficient at modifying linked packages etc on Ubuntu and I am therefore terrified of messing something up. I would therefore be thrilled if you could make a step-by-step guide for us dummies 😅 What I have previously tried is to create an empty folder
and added the following to
When I then ran
the package recompiled. Trying to use offscreen rendering with the robosuite framework then yields
Environment
|
and how to know the 000? |
Maybe it's the nvidia driver version installed in your Ubuntu. |
Sad, it does not work for me. |
Sad to hear that. I am not sure if this will help but recently I reinstalled the packages again in my conda environment and I was able to solve the issue with the mujoco with these settings. Hope it helps |
I will try it. It is so difficult for me. |
Describe the bug
Rendering with off screen fails to initialize.
To Reproduce
Error Messages
ERROR: GLEW initalization error: Missing GL version
It seems like the error occurs at the first line of this function (
mjr_makeContext(self._model_ptr, &self._con, mjFONTSCALE_150)
)mujoco-py/mujoco_py/mjrendercontext.pyx
Lines 83 to 93 in 1aeb02e
(found by print debug)
Furthermore when I add "None" argument at mysterious position
mujoco_py.MjRenderContextOffscreen(sim, None,device_id=0)
images are correctly rendered, though black winodow appears.
Desktop (please complete the following information):
Environment
echo $LD_LIBRARY_PATH
/home/user/.mujoco/mujoco200/bin
Additional context
OpenGL version: 4.6.0
Nvidia Driver: 418.67
The text was updated successfully, but these errors were encountered: