Closed GalacticEmperor1 closed 5 months ago
I wonder if all these reports were related to GL setup on WSL2 ?
See: https://stackoverflow.com/questions/66497147/cant-run-opengl-on-wsl2
I've tested and I can definitely run the glcube example on linux on my raspberry pi - though the Pi only supports up to openGL 3.1 from what I've read so you need to set the USE_MODERN_GL
flag in the example to false.
OK, I've spent some time getting WLSL setup on my PC with Ubuntu 20.04.
There have been lots of developments since this was originally posted making the whole process a lot easier. I didn't have to export
anything or even use VcxSrv
There is now a native XServer included with WLSL since January of this year. This works, but there are clearly still some bugs being worked out as you see a lot of segmentation faults even when running basic diagnostic utilities like:
sudo glxinfo -B
...and when exiting pygame gl apps. I found lots of issue reports to Microsoft about this already so there wasn't much for me to add.
However, despite those it still works reasonably well for what is a pretty niche pygame use case
I also noticed that with the x11 driver you need to set the glcube example to:
USE_MODERN_GL = False
...then it works fine.
x11 driver:
But with the wayland video driver enabled you can have your modern GL and eat it too:
# add this near the top, before pygame.init()
os.environ['SDL_VIDEODRIVER'] = 'wayland'
...
USE_MODERN_GL = True
Wayland driver:
Anyway, overall this is still a bit of a pain to get setup, but most of that is setting up WLSL for python and openGL not really anything to do with pygame-ce. I don't think there was ever anything for us to do here, it is just WLSL slowly improving their compatibility.
Issue №3110 opened by brccabral at 2022-04-01 18:47:34
Hi, I am getting this error trying to run
examples/glcube.py
. Any ideas?Ubuntu 20.04 pygame 2.1.2 (SDL 2.0.16, Python 3.8.10)
Comments
*MyreMylar commented at 2022-04-02 07:30:24*
Anything else odd about your setup? Are you running pygame remotely, in a container on a separate thread? Apparently this error crops up when GL can't access the main thread/display.
The example runs on main right now on windows:
This is pygame 2.1.3.dev5 (SDL 2.0.20, Python 3.9.0)
*SiddhantRanade commented at 2022-04-13 02:26:31*
I'm facing the exact same issue when running pygame on Ubuntu 20.04 (WSL2 fresh install) within WSL2 on Windows 11. I verified that glxgears works.
*brccabral commented at 2022-04-13 21:30:44*
Hi @MyreMylar , it is the same problem as # 3114 , on Wayland I get the error, on Xorg it runs OK.
*thisistejaspandey commented at 2022-06-15 02:27:55*
Same issue! Please escalate!!!!
*anji993 commented at 2022-06-30 10:25:14*
Hi @SiddhantRanade have you solved this problem? I meet the same problem as yours!