Open ardunster opened 3 years ago
From https://stackoverflow.com/questions/39213757/glfw-cannot-create-a-window-glx-failed-to-create-context-glxbadfbconfig it looks like this is because your graphics driver doesn't support OpenGL 4.1.
Indeed it says 3.3 here:
OpenGL: renderer: AMD BARTS (DRM 2.50.0 / 5.4.0-42-generic LLVM 10.0.0)
v: 3.3 Mesa 20.0.8
I wonder if there are better drivers for your card? I will do some research.
There's a video here that talks about doing driver upgrades to get OpenGL 4.1 on AMD graphics. It's for older Ubuntu and newer hardware but maybe it will have useful information: https://youtu.be/M4GPgw2wyzg
I subscribed to the oibaf ppa https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers which gives me the most recent Mesa version (20.3.0-devel), however does not update my core profile version, because AMD "Barts" doesn't actually support FP64 at a hardware level, which seems to be required for any current Mesa driver to support OpenGL 4 (per the information here: https://www.phoronix.com/scan.php?page=news_item&px=R600g-Lands-FP64-Native) However it is doable at a software level and not something that is typically used.
For reference, Pygame itself has no problem opening a GL context on this machine with a Mesa driver. Neither do I have any problem with other games. After spending a bunch of time digging and troubleshooting, I found that I can launch the wasabi2d scene with an override for my Mesa context: MESA_GL_VERSION_OVERRIDE=4.3 python3 wasabi2dtest.py
(thanks to https://askubuntu.com/questions/850900/why-is-my-opengl-version-stuck-at-3-0-despite-new-hardware-software). I think the issue is that lines 135-139 in scene.py call for an openGL 4 context:
"""Create the ModernGL context."""
glconfig = {
'GL_CONTEXT_MAJOR_VERSION': 4,
'GL_CONTEXT_PROFILE_MASK': pygame.GL_CONTEXT_PROFILE_CORE,
}
Does wasabi actually require 4 or can it run on older versions? As I mentioned, pygame itself works fine without any overrides.
It seems I'll be able to work on this project using an override every time I call my script, but that seems like an awfully clunky workaround. I think the proprietary driver has support for OpenGL 4.1 but would rather not use if I can avoid it. Maybe there's a way to set a permanent override.
Are there features being used in wasabi2d that are actually exclusive to OpenGL4? I assume there's some reason you have the context require=410 set. But altering the require and glconfig lines I can get the same behavior in my test scene as I can using the Mesa override I mentioned above (that is, it will load and render, but text displays funny). If Wasabi2D requires 4.1, it may not be the best choice for our project (generally aimed at broadest possible accessibility).
I have a file with only the quickstart code:
I set up a new venv to try to work with Wasabi2d. I have tried in both Python 3.8.2 and 3.7.7 using
pip install wasabi2d
to get dependencies. Both environments gave no errors on running pip.In either venv I get the following traceback error (with different memory addresses) when attempting to run the above code:
pip freeze
on 3.7.7:pip freeze
on 3.8.2 (has a few more things I was working with in regards to the project I intended to use wasabi on):System info:
I think the key part of the error is the GL error:
pygame.error: Could not create GL context: GLXBadFBConfig
GL is working fine in other software. The quickstart code works fine in a conda environment on my OSX laptop. But it won't work on the Ubuntu desktop.