GWSL-Source icon indicating copy to clipboard operation
GWSL-Source copied to clipboard

Modify VcxSrv launch options?

Open Nearoo opened this issue 3 years ago • 7 comments

When trying to create an OpenGL context, I get the following error:

GLFW error 65543: GLX: Failed to create context: GLXBadFBConfig Could not create an OpenGL 3.2 context!

According this SO thread, this issue can be resolved by modifying VcxSrv launch options. Is there a way to do this for gWSL?

Thanks!

Nearoo avatar Dec 01 '21 10:12 Nearoo

Yes. Simply start GWSL, right click the GWSL systray icon, Xserver Profiles, Add a Profile. Create a profile with the vcxsrv flags you want and save it. Then go to the right click menu again and switch to the newly created profile.

Pololot64 avatar Dec 01 '21 16:12 Pololot64

Thanks. I tried it, but it turns out, that wasn't the problem. I couldn't create an OpenGL 3.2 context because the highest version supported was 1.4. The reason for that was that LIBGL_ALWAYS_INDIRECT was set.

To check if you have this problem, run:

glxinfo | grep 'direct rendering:'

If this returns: direct rendering: No (LIBGL_ALWAYS_INDIRECT set), you have the same problem. You can't use indirect rendering, because indirect only supports opengl up to version 1.4; I need 3.2. Edit .bashrc or config.fish to not define this variable (just setting to 0 didn't work for me); in my case, I had to erase it becaus it was defined elsewhere (in fish: set -e LIBGL_ALWAYS_INDIRECT).

This wasn't enough yet though, I also had to upgrade opengl to a newer version. Info's from here, which links to source command here; instructions are:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt update
sudo apt upgrade

This will add a new apt repository with a newer opengl (and other) version, which get installed once you do update & upgrade.

At your own risk.

Nearoo avatar Dec 02 '21 13:12 Nearoo

Note that the first source says

From the link you are using LIBGL_ALWAYS_INDIRECT=1. The person (if any) who directed you to do that was proffering dubious guidance.

Your tool enabled LIBGL_ALWAYS_INDIRECT. Don't now enough about the topic to make judgements, though.

Nearoo avatar Dec 02 '21 13:12 Nearoo

Huh. It does not enable libgl indirect by default, however. There is a button for it for convenience (and for some reason some tutorials I don't control say you have to click it) but I intentionally leave it off. Maybe I'll make a note in the manual saying it is not required

Pololot64 avatar Dec 02 '21 17:12 Pololot64

True. I think I actually pressed that button. It enables LIBGL_ALWAYS_INDIRECT, but there's no way to disable it afterwards, which made me think that it is probably something that is a no-brainer to enable... perhaps a way to disable it again would be useful? Thanks for the work you're doing btw, this app is great!

Nearoo avatar Dec 04 '21 11:12 Nearoo

I could actually do it for you & create a PR if you're interested :) Just point me in the general direction of which files to modify.

Nearoo avatar Dec 04 '21 11:12 Nearoo

No worries. I can put it on my list to try to do next update (maybe later this month)

Pololot64 avatar Dec 04 '21 18:12 Pololot64