Use accelerated graphics on Windows 10 Linux subsystem with Xming?

12,009

Run export LIBGL_ALWAYS_INDIRECT=1 in WSL to force rendering to happen on the Windows side of things.

Share:
12,009

Related videos on Youtube

geofurb
Author by

geofurb

Updated on September 18, 2022

Comments

  • geofurb
    geofurb over 1 year

    I've got Ubuntu 16.04 running in Windows 10 16251.0 as a Linux subsystem, and I've got Xming-mesa 6.9.0.31 installed.

    I launch Xming using Xming :0 -multiwindow -clipboard

    Then in my Ubuntu bash shell I type export DISPLAY=:0 and I can launch graphical applications in Xming.

    However, I do not get accelerated graphics, so when I launch an editor (e.g. sudo spyder3), I have to deal with the jerky scrolling and such that you get without acceleration.

    How do I fix this? I'm sure my video card (AMD RX480 latest drivers) supports OpenGL, but for some reason I'm not activating it correctly.

  • geofurb
    geofurb almost 7 years
    export LIBGL_ALWAYS_INDIRECT=1 export DISPLAY=:0 sudo spyder3 No change :(
  • Yoko Hailemariam
    Yoko Hailemariam almost 7 years
    @geofurb What if you try it with glxgears?
  • geofurb
    geofurb almost 7 years
    How would I do that?
  • Yoko Hailemariam
    Yoko Hailemariam almost 7 years
    glxgears isn't realted to spyder3, I want you to see if LIBGL_ALWAYS_INDIRECT impacts glxgears.
  • geofurb
    geofurb almost 7 years
    ~1300FPS, but it jolts every so often. (Unless that's part of the intended behavior?)
  • Yoko Hailemariam
    Yoko Hailemariam almost 7 years
    What's the difference when LIBGL_ALWAYS_INDIRECT is and isn't set.
  • geofurb
    geofurb almost 7 years
    Similar performance after executing export LIBGL_ALWAYS_INDIRECT=0
  • Yoko Hailemariam
    Yoko Hailemariam almost 7 years
    Did you unset LIBGL_ALWAYS_INDIRECT before running it the first time?
  • geofurb
    geofurb almost 7 years
    Negative; confirmed with export -p that LIBGL_ALWAYS_INDIRECT was set for the first run and unset for the second run.
  • Yoko Hailemariam
    Yoko Hailemariam almost 7 years
    I don't know, then. Sorry.
  • geofurb
    geofurb almost 7 years
    What's the reasoning there?
  • Yoko Hailemariam
    Yoko Hailemariam almost 7 years
    @geofurb Oh I just remembered, it's an option in XMing as well, or at least VcXsrv has it.
  • geofurb
    geofurb almost 7 years
    So setting LIBGL_ALWAYS_INDIRECT=0 doesn't refert the framerate from glxgears to software accelerated speeds; HOWEVER, rebooting the machine restores it to software acceleration, and you get ~60fps instead of ~1300fps. What's going on that Spyder isn't benefiting from this graphical acceleration?
  • geofurb
    geofurb almost 7 years
    Would XDMCP offer better performance or worse, since I'm rendering on the Windows computer?
  • user541686
    user541686 about 5 years
    When I use this with -wgl it makes glxgears far slower. The only smooth animation is no -wgl and no LIBGL_ALWAYS_INDIRECT.
  • Tropilio
    Tropilio about 4 years
    @user541686 I had to do the same. See this related question for more info: superuser.com/questions/1487555/…