microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.06k stars 302 forks source link

GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control! #640

Open joehays opened 2 years ago

joehays commented 2 years ago

Environment

Edition Windows 11 Home
Version 21H2
Installed on    ‎1/‎18/‎2022
OS build    22000.438
Experience  Windows Feature Experience Pack 1000.22000.438.0

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

Windows Subsystem for Linux GUI WSLg Preview
1.0.26
Microsoft Corporation
1/18/2022

Steps to reproduce

sudo apt-get install -y glmark2 then run glmark2

glmark2 window opens but is black

The terminal error received is,

** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Microsoft Corporation
    GL_RENDERER:   D3D12 (Intel(R) Iris(R) Xe Graphics)
    GL_VERSION:    3.1 Mesa 21.0.3
=======================================================
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.

WSL logs: weston.log stderr.log pulseaudio.log versions.txt

Expected behavior

rendering of the glmark2 benchmark window

Actual behavior

glmark2 window opens but is black

elsaco commented 2 years ago

@joehays Wayland might be the issue. glmark2 is the X11 benchmark. Try glmark2-wayland instead. Check the environment and see if WAYLAND_DISPLAY=wayland-0 is present.

Here's output on my Ubuntu WSL:

tux@ubuntu:~$ glmark2-wayland
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Microsoft Corporation
    GL_RENDERER:   D3D12 (NVIDIA GeForce RTX 3060 Ti)
    GL_VERSION:    3.1 Mesa 21.0.3
=======================================================

and the first test is a nice spinning 3D horse rendering:

glmark2_wayland

joehays commented 2 years ago

@joehays Wayland might be the issue. glmark2 is the X11 benchmark. Try glmark2-wayland instead. Check the environment and see if WAYLAND_DISPLAY=wayland-0 is present.

@elsaco Thanks for the education. Didn't realize that glmark2 was X11 specific. I installed glmark2-wayland and verified WAYLAND_DISPLAY=wayland-0. Now, I get the following error,

Error: Error loading EGL library
Segmentation fault

I've 'wsl --shutdown' and relaunched and still get the same error.

Any other thoughts?

joehays commented 2 years ago

So, after a sudo apt install libegl-dev -y I now get,

=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Microsoft Corporation
    GL_RENDERER:   D3D12 (Intel(R) Iris(R) Xe Graphics)
    GL_VERSION:    3.1 Mesa 21.0.3
=======================================================
[build] use-vbo=false: FPS: 557 FrameTime: 1.795 ms
[build] use-vbo=true: FPS: 621 FrameTime: 1.610 ms
[texture] texture-filter=nearest: FPS: 677 FrameTime: 1.477 ms
[texture] texture-filter=linear:^C FPS: 666 FrameTime: 1.502 ms
=======================================================
                                  glmark2 Score: 630
=======================================================

Interesting thing is nothing gets rendered. It's a black frameless window. But, no error.

Update: The Intel GPU jumps up to about 40% utilization.

Ran sudo apt install glmark2-es2-wayland -y and ran glmark2-es2-wayland. Same behavior: black screen with Score of > 600.

danielbisar commented 1 year ago

Tried today with Ubuntu 22.04.1 LTS under Windows 11, WSL2, updated kernel yesterday, installed updates from store (WSL2 preview yesterday).

After a fresh install and the usual apt update && apt upgrade:

# shouldn't have any effect on the glmark, but just to be complete
sudo apt install mesa-utils

# no wayland at the end added
sudo apt install glmark2
glmark2

gl mark results (and I could see all benchmarks rendered clean)

** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Microsoft Corporation
    GL_RENDERER:   D3D12 (NVIDIA GeForce RTX 3060)
    GL_VERSION:    3.3 (Compatibility Profile) Mesa 22.0.5
=======================================================
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=false: FPS: 679 FrameTime: 1.473 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=true: FPS: 637 FrameTime: 1.570 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=nearest: FPS: 616 FrameTime: 1.623 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=linear: FPS: 614 FrameTime: 1.629 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=mipmap: FPS: 613 FrameTime: 1.631 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=gouraud: FPS: 620 FrameTime: 1.613 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=blinn-phong-inf: FPS: 617 FrameTime: 1.621 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=phong: FPS: 620 FrameTime: 1.613 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=cel: FPS: 582 FrameTime: 1.718 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[bump] bump-render=high-poly: FPS: 665 FrameTime: 1.504 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[bump] bump-render=normals: FPS: 623 FrameTime: 1.605 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[bump] bump-render=height: FPS: 603 FrameTime: 1.658 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 619 FrameTime: 1.616 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 627 FrameTime: 1.595 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[pulsar] light=false:quads=5:texture=false: FPS: 583 FrameTime: 1.715 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 529 FrameTime: 1.890 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[desktop] effect=shadow:windows=4: FPS: 570 FrameTime: 1.754 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 254 FrameTime: 3.937 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 395 FrameTime: 2.532 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 374 FrameTime: 2.674 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[ideas] speed=duration: FPS: 279 FrameTime: 3.584 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[jellyfish] <default>: FPS: 515 FrameTime: 1.942 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[terrain] <default>: FPS: 326 FrameTime: 3.067 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shadow] <default>: FPS: 563 FrameTime: 1.776 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[refract] <default>: FPS: 618 FrameTime: 1.618 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 614 FrameTime: 1.629 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 647 FrameTime: 1.546 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 650 FrameTime: 1.538 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[function] fragment-complexity=low:fragment-steps=5: FPS: 613 FrameTime: 1.631 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[function] fragment-complexity=medium:fragment-steps=5: FPS: 622 FrameTime: 1.608 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 614 FrameTime: 1.629 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 620 FrameTime: 1.613 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 623 FrameTime: 1.605 ms
=======================================================
                                  glmark2 Score: 568
=======================================================
Segmentation fault

I get the segmentation fault for every window I am closing. So it is not a glmark2 issue. The score is way to low but I guess due to "GLX_EXT_swap_control or GLX_MESA_swap_control". If I remember correct I had the same message under native Ubuntu.

danielbisar commented 1 year ago

Just tried the usual workaround for frame rate limited by refresh rate:

vblank_mode=0  glmark2

Result is about the same. My monitor refresh rate is 144 Hz if that helps. But guess here is something else wrong (an RTX 3060 shouldn't have the same or even less than a Intel(R) Iris(R) Xe Graphics...

aki-k commented 1 year ago

I was getting the same error for glmark2 but glmark2-wayland works on Ubuntu-22.04 instance (Intel UHD Graphics 620 on Dell Latitude 7490).

These symlinks must be in place though in /run/user/$(id -u):

lrwxrwxrwx 1 aki aki 31 May 12 10:54 wayland-0 -> /mnt/wslg/runtime-dir/wayland-0 lrwxrwxrwx 1 aki aki 36 May 12 10:54 wayland-0.lock -> /mnt/wslg/runtime-dir/wayland-0.lock

Edit: well this is interesting, glmark2 works also in Ubuntu-22.04 instance even though I get that error message:

** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!

Edit 2: this resolved the glmark2 startup problem when I ran glmark2 from a ubuntu:22.04 Docker container from under WSL 2 Ubuntu-22.04 instance: https://bugs.launchpad.net/cloud-images/+bug/2007555/comments/4