-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does WSL support openGL? #2855
Comments
WSL runs OpenGL alright, but it is not a supported scenario. You didn't follow the issue template, but in general from a clean Ubuntu install from the store do:
On the Windows side, install VcXsrv, choose multiple windows, display 0, start no client, disable native opengl (sic). The hang out for this stuff is generally #637, but if you have a specific scenario I'll hold this open for a bit. It might be your scenario works. It might not. |
solved my problem running quantumatk in wsl it was the disable native opengl part |
Is there the same for |
For me, to make things work properly, I also had to set |
That's correct. [For one sensible definition of correct. Says as much quoth "disable native opengl (sic)" at the top.]
|
WORKS! Thanks. In addition, in WSL Ubuntu I had to add the following arguments to my .bashrc (before performing the steps above): export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
export LIBGL_ALWAYS_INDIRECT=1 |
Here is how I got this to work to use OpenGL to open GUI's (e.g. Open3D and matplotlib) in VS code. I am currently running Ubuntu 20.04.4 LTS on WSL2. Step 1: Run $ sudo apt install ubuntu-desktop mesa-utils Step 2: Follow the instructions in this comment regarding installing VcXsrv, BUT replace $ export DISPLAY=192.168.1.3:0.0 with $ export DISPLAY="$(grep nameserver /etc/resolv.conf | sed 's/nameserver //'):0" which was obtained from this comment. Step 3: Follow the instructions here regarding setting up your firewall for VcXsrv. Step 4: Run $ glxgears to test OpenGL. To get this working with VS code, in a terminal window in VS code, run $ export DISPLAY="$(grep nameserver /etc/resolv.conf | sed 's/nameserver //'):0"
$ export LIBGL_ALWAYS_INDIRECT=1 and then start running your code. |
And after running |
Interesting. So what do you use instead? Do you dual-boot? |
Dual boot yes, but because it takes a consequent part of your disk, another option, with negative points too, can be USB booting with consistence. Because it's an external booter, you have to disable the UEFI security check, and it's not really a good idea. Also, for the same reason, a USB with 300-400Mo/s on R/W is usually good to keep correct performances. |
I am running a linux software on WSL. The program crashes every time I try to make some drawings with the openGL option. I know that the WSL is not a full linux and is intended to do command line tasks. In my case, I have installed the openGL libararies and everything seems OK. I am wondering if my problem is because of the WSL is incompatible with openGL.
The text was updated successfully, but these errors were encountered: