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

pyglet.gl.ContextException: Could not create GL context #7794

Closed
kylekam opened this issue Dec 2, 2021 · 5 comments
Closed

pyglet.gl.ContextException: Could not create GL context #7794

kylekam opened this issue Dec 2, 2021 · 5 comments

Comments

@kylekam
Copy link

kylekam commented Dec 2, 2021

Hi, my code is crashing on the following line:
r = pyrender.OffscreenRenderer(400, 800)
And the error that I'm getting is

File "/mnt/c/Users/kamky/RESEARCH/deep_emulator/code/render.py", line 52, in render_single_mesh
    r = pyrender.OffscreenRenderer(resolution[0], resolution[1])
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyrender/offscreen.py", line 31, in __init__
    self._create()
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyrender/offscreen.py", line 149, in _create
    self._platform.init_context()
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyrender/platforms/pyglet_platform.py", line 50, in init_context
    self._window = pyglet.window.Window(config=conf, visible=False,
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyglet/window/xlib/__init__.py", line 171, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyglet/window/__init__.py", line 615, in __init__
    context = config.create_context(gl.current_context)
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyglet/gl/xlib.py", line 204, in create_context
    return XlibContextARB(self, share)
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyglet/gl/xlib.py", line 314, in __init__
    super(XlibContext13, self).__init__(config, share)
  File "/home/kylekam/.local/lib/python3.8/site-packages/pyglet/gl/xlib.py", line 218, in __init__
    raise gl.ContextException('Could not create GL context')
pyglet.gl.ContextException: Could not create GL context

Following #2855 I'm able to open a new window with the little gears running on XServer.

Any ideas on why this error is happening?
I'm using WSL2, Kernel version: 5.10.16.3, and Ubuntu 20.04

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 7, 2021

Hi @kylekam, it looks like you're missing the GPU compute drivers. Which Windows build are you running ?

@kylekam
Copy link
Author

kylekam commented Dec 10, 2021

I'm using Windows 10 Home Build 19044

@ghost ghost removed the needs-author-feedback label Dec 10, 2021
@OneBlue
Copy link
Collaborator

OneBlue commented Dec 28, 2021

/logs

@ghost
Copy link

ghost commented Dec 28, 2021

Hello! Could you please provide more logs to help us better diagnose your issue? You can find instructions on how to attach logs here, please make sure to post the link to the Feedback Hub item in this chat so we can see it.

Thank you!

@ghost ghost closed this as completed Jan 5, 2022
@ghost
Copy link

ghost commented Jan 5, 2022

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants