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

GLEW initalization error: Missing GL version #268

Closed
LiterallyUniqueLogin opened this issue Jul 5, 2018 · 6 comments
Closed

GLEW initalization error: Missing GL version #268

LiterallyUniqueLogin opened this issue Jul 5, 2018 · 6 comments

Comments

@LiterallyUniqueLogin
Copy link

I'm getting this issue when running
import gym
env = gym.make('Ant-v2')

Mujoco works fine on my machine, I can get the simulations up and running. I've seen this thread but none of the suggestions seem to help.

Any debugging suggestions? What .so files should I expect to have? Where should I expect to find them? What packages should I have installed via apt-get? I'm wondering if one of my installations went wrong somehow.

I'm running on Ubuntu 16.04 with an NVIDIA GeForce GTX 980M graphics card and graphics drivers installed, though I'm not sure that's relevant to this problem.

@LiterallyUniqueLogin
Copy link
Author

The solution at the bottom of this thread on the openaigym repo seems to work. (The key part being export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so)

@Isaac009
Copy link

Isaac009 commented Mar 5, 2020

The solution at the bottom of this thread on the openaigym repo seems to work. (The key part being export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so)

If you still have some issues try this out (for Ubuntu, I use Ubuntu 18.04)
Step 1
Run update command to update package repositories and get the latest package information.
sudo apt-get update -y
Step 2
Run the install command with -y

flag to quickly install the packages and dependencies.
sudo apt-get install -y libglew-dev

Got these from : https://zoomadmin.com/HowToInstall/UbuntuPackage/libglew-dev
and then
Step 3:
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so

This worked for me. Hope it works for you.

@monacv
Copy link

monacv commented Jun 3, 2021

sudo reboot worked for me in Ubuntu 20.04

@HesNobi
Copy link

HesNobi commented Nov 14, 2021

The solutions explained here may work for some installations. However, I am using different simulation environments and can't employ the methods mentioned here. I came up with a quick fix by initializing a dummy GL window before rendering! it is patchy but gets the job done.

I added this to the GYM's own observation wrapper PixelObservationWrapper:

import OpenGL.GLUT as gl
def __init__(....
          # Creating a dummy GL Windows to bupas the Error: "GLEW initalization error: Missing GL version"
          gl.glutInit()
          gl.glutInitWindowSize(10, 10)
          gl.glutCreateWindow('GLEW Testing')
....

@JamesKCS
Copy link

JamesKCS commented May 6, 2022

The export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so solution above initially fixed the problem for me. Something changed in the months since then (no idea what), and I started getting the error again.

The solution was to remove the export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so line from the .bashrc (or from the PyCharm env variables). Hopefully this hint saves someone else the hours it took me to figure this out :)

@Kallinteris-Andreas
Copy link

On arch Linux
export LD_PRELOAD=/usr/lib/libGLEW.so worked for me

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

6 participants