OpenGL on Ubuntu on WSL 2 timeline

I’m teaching a course in which students write an OpenGL game using C and C++. For the past few years, students running Windows had to install a convoluted toolchain using MinGW and MSYS2. We’d like to move to Ubuntu on WSL completely, but the OpenGL support of WSL 1 is too poor.

So my question is what the timeline is for OpenGL support on WSL 2. Is this something which would be usable by September or should we prepare for another year of fighting with MSYS2?

2 Likes

I suspect the answer is “wait until MS reveals more information” about their GUI support on WSL2. You can get OpenGL working via X11 if you export the environment variable LIBGL_ALWAYS_INDIRECT in the WSL2 and have a suitable X11 on your Windows-side, although this is limited to OpenGL 1.5 (IIRC) which is likely not helpful for your students who I imagine will be wanting much more recent capabilities (the supported OpenGL via Indirect GLX is decades old now).

1 Like

We don’t have a firm date for OpenGL support unfortunately. I do not think it will make it in time for class this semester.

OpenGL support will be dependent on work being done to optimize OpenGL over DirectX. That is being done by Microsoft and Collabora.

There is a progress update from Callabora on their blog here.

The workaround Dan may work for you, with the limitations he specified.

2 Likes

Yeah, from our testing, the indirect OpenGL support also seems to be broken for a number of GPU’s. Moreover, we often get better performance using the llvmpipe CPU renderer…

I did learn a lot about Mesa and OpenGL in the process of debugging all this, so that was nice :blush:

1 Like