2

I think I understand what LIBGL_ALWAYS_INDIRECT does, per this explanation: What does LIBGL_ALWAYS_INDIRECT=1 actually do?

However I am having trouble understanding when/why it is needed?

In my case, I have a homegrown dotnet core application (using Avalonia framework) which works fine on WSL2 Linux (Ubuntu Distro) when not run as sudo, but when running as sudo, it displays the window frame and no content. However specifying LIBGL_ALWAYS_INDIRECT=1 fixes the problem. So why would I be required to specify LIBGL_ALWAYS_INDIRECT only when running as sudo?

To summarize:

command line works?
./myapp yes
LIBGL_ALWAYS_INDIRECT=1 ./myapp yes
sudo ./myapp no
sudo LIBGL_ALWAYS_INDIRECT=1 ./myapp yes

sudo -E/-H do not seem to make a difference. The WSL distro Is Ubuntu 22.04, which seems to be using wayland.

Will I Am
  • 193
  • 1
  • 1
  • 4

0 Answers0