microsoft / wslg

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

Glitches in GUI applications #1148

Open azegas opened 1 year ago

azegas commented 1 year ago

Windows build number:

10.0.22631.0

Your Distribution version:

22.04

Your WSL versions:

WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715

Steps to reproduce:

  1. activate wsl on windows
  2. install ubuntu distro either from MS store or from terminal by wsl --install or wsl --install ubuntu
  3. update ubuntu distro sudo apt update && upgrade
  4. install emacs, vlc or nautilus
  5. launch one of those, I get this behavior as described in the screenshots

WSL logs:

stderr.log weston.log pulseaudio.log

WSL dumps:

No response

Expected behavior:

WSL should run gui applications without the glitches.

Actual behavior:

I had wsl working just fine until yesterday! Everything I am about to eplain about was working fine yesterday.

Yesterday I have installed another ubuntu version on my wsl, alongside fully working wsl version(was testing out different emacs versions). So I had 2x ubuntu versions + the default docker wsl's.

This strange gui glitch started to happen when I launch emacs gui application. If I launch it in the terminal - all is good. emacs gui with glitches: emacs

emacs over terminal: emacs_terminal

When I move the emacs gui screen - the glitch dissapears. When I stop moving it - it reappears.

I thought okay I can not work like this, I need to start fresh. I then unregistered both ubuntu distros and went to "add remove programs" to uninstall those ubuntu versions.

I installed ubuntu from terminal by wls --install ubuntu or wsl --install or from ms store, restarts...- same problem.

I then disabled WSL feature. Restarts... installed wsl again, did wsl --set-default-version 2 - same problem.

I then tried to install another GUI application - nautilus and VLC - same probelm with those: nautilus vlc

I then thought thanks god its not related with emacs, its a gui bug in general with all linux applications over wsl. Nothing similar happens on my windows apps.

That helped me to narrow the problem down. Insead of googling "emacs gui glitches in wsl", I started to google for "wsl gui glitches".

I then found out about wslg and that it is responsible for launching gui applications over wsl.

I then installed mobaxterm since I guess it does not use wslg, but uses xserver. I then tried to launch emacs with it:

x server off - emacs launched in terminal mode:

xserver_off

x server on - emacs launched in gui mode:

xserver_on

Finally emacs has no glitches!!!

I dont really want to reset my windows to make wsl not glitch anymore, can you help me find a way what to update/remove/reinstall to make these glitches go away?

Thank you!

p.s. this is everything I have installed right now that I know regarding wsl, hope that helps:

versions

azegas commented 1 year ago

Addition with some videos:

Sometimes it works:

https://github.com/microsoft/wslg/assets/78803192/98f11bb5-a0d6-4760-8f49-4840dca11719

Sometimes it does not work:

https://github.com/microsoft/wslg/assets/78803192/729bae6c-db4b-4771-8698-3743e79ce57a

vielhuber commented 1 year ago

I have exactly the same problem.

This is gedit:

image

vielhuber commented 1 year ago

Downgrading to 2.0.4 seems to be an option:

https://github.com/microsoft/wslg/issues/1130

azegas commented 1 year ago

Downgrading to 2.0.4 seems to be an option:

1130

Amazing @vielhuber, that sounds promsing. good detective work!

How would one go about with downgrading wsl? Did you succeed? Is the glitching gone for you?

vielhuber commented 1 year ago

I tried:

Then it worked until a restart.

Identified that after boot I manually once always need to run wsl --shutdown, then reopen wsl and it works from then on until the next restart.

I can't downgrade at the moment and am waiting for an official fix (see https://github.com/microsoft/wslg/issues/1130).

azegas commented 1 year ago

Will wait for an official fix then also.

Untl then I will run my wsl gui applications over https://mobaxterm.mobatek.net/ . Give it a try, it's cool!

salarmehr commented 12 months ago

The exact issue here. @arvydasg could you try the downgrading suggestion?

azegas commented 12 months ago

Surprisingly the issue does not repeat anymore. Will try it if it happens again.

nikosandreou commented 12 months ago

Same issue here. Windows 11 with following WSL info

WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715

I did an update in Intel Drivers update and Windows Update simultaneously so not sure what broke it. However, I tried the following:

-In .wslgconfig I added

[system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1

-Restarted wsl. Worked. -Restarted laptop, the fix still works.

Maybe other people try this and post their feedback.

MarcosRguez commented 12 months ago

¡Worked for me!

bluejoyq commented 12 months ago

Same issue here. Windows 11 with following WSL issue

WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715

I did an update in Intel Drivers update and Windows Update simultaneously so not sure what broke it. However, I tried the following:

-In .wslgconfig I added

[system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1

-Restarted wsl. Worked. -Restarted laptop, the fix still works.

Maybe other people try this and post their feedback.

Worked For Me! Thanks!

joeyoropesa-dev commented 12 months ago

Same issue unfortunatelly with latest installation in wsl 2 (Ubuntu)

And it's still not fixed..

Benargee commented 12 months ago

I had a similar problem. I installed Kali in WSL then I installed x11-apps just for a simple test.
When I launched xeyes and xcalc it was glitching out. All I had to do to fix it was restart Windows 11.

PS C:\Users\benargee>wsl -v
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2715
joeyoropesa-dev commented 12 months ago

I had a similar problem. I installed Kali in WSL then I installed x11-apps just for a simple test.
When I launched xeyes and xcalc it was glitching out. All I had to do to fix it was restart Windows 11.

PS C:\Users\benargee>wsl -v
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2715

Well that didn't helped me... Probably it's an bug in the code since I'm not the only person who have these issues so I hope that WSLg developers will look into this case and at least try to fix it from their side.

vielhuber commented 12 months ago

-In .wslgconfig I added [system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1 -Restarted wsl. Worked. -Restarted laptop, the fix still works.

This does not work for me after pc restart. Is the path in %USERPROFILE%/.wslgconfig (not %USERPROFILE%/.wslconfig)?

nikosandreou commented 12 months ago

-In .wslgconfig I added [system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1 -Restarted wsl. Worked. -Restarted laptop, the fix still works.

This does not work for me after pc restart. Is the path in %USERPROFILE%/.wslgconfig (not %USERPROFILE%/.wslconfig)?

It is .wslgconfig

clavnico commented 12 months ago

[system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1

Thanks it worked on windows 11 pro 22H2 with Ubuntu. For the one wondering you can create the file .wslgconfig directly in you home folder on windows and copy bluejoyq solution (type %USERPROFILE% as a path in explorer if you dont know where it is). Strangely the solution did not work for my OpenSUSE environment (15.5)

palapapa commented 11 months ago

FYI I had to put the .wslgconfig file in C:\ProgramData\Microsoft\WSL. The WSL folder didn't exist so I had to create it manually.

BiruBear commented 11 months ago

So I was having this problem as well, nothing above worked so, identifying the problem in wslg, I disabled it by adding in C:\Users\youruser\ .wslconfig [wsl2] guiApplications=false as suggested in https://github.com/microsoft/wslg/discussions/523 and restarted.

Then I used MobaXterm as X server, exported its display destination in the $DISPLAY variable and all solved.

analytic-garden commented 11 months ago

Same problem. It is intermittent. I have updated NVIDIA and Intel drivers, but that had no effect. The problem still arises, seemingly at random.

olliollio commented 11 months ago

Same problem. After windows launch stopping wsl and restarting it helps for the day

llanc commented 11 months ago

When I installed xfce4, I encountered this issue. There was no problem before this.

HenriqueCA commented 11 months ago

The same happened to me today. Used wsl --shutdown and it worked for now.

rjackson6 commented 11 months ago

I just ran into this as well on a fresh install of WSL2. wsl --v output:

WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2715

Running on a Vega 56 GPU, and didn't experience it on the older version of WSL2 I had installed previously. Updating the AMD drivers didn't resolve it. Following the suggestion in the thread to add the LIBGL_ALWAYS_SOFTWARE=1 to .wslgconfig seems to fix it for me.

What are the implications of setting the LIBGL_ALWAYS_SOFTWARE variable? Just want to make a note if it can (or should) be removed from the configuration if a fix is released.

nikosandreou commented 11 months ago

I just ran into this as well on a fresh install of WSL2. wsl --v output:

WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2715

Running on a Vega 56 GPU, and didn't experience it on the older version of WSL2 I had installed previously. Updating the AMD drivers didn't resolve it. Following the suggestion in the thread to add the LIBGL_ALWAYS_SOFTWARE=1 to .wslgconfig seems to fix it for me.

What are the implications of setting the LIBGL_ALWAYS_SOFTWARE variable? Just want to make a note if it can (or should) be removed from the configuration if a fix is released.

Well, GPU acceleration in WSLg has been a bit questionable. You can read this:

https://github.com/microsoft/wslg/issues/469

However, there are apps that may expect the GPU acceleration to be on so in case something crashes, you may have to turn it on. From my side, since I do mostly development in WSLg, having it on or off, doesn't bother me. I had it on for a couple of apps that were 'nice-to-use/have', but since this bug, I turned it off. I may turn it on if they fix the bug, but leaving it off won't hurt my daily programming life in WSLg.

dtramer commented 11 months ago

Unlike seemingly everyone else here ... I don't have this issue when wsl starts up. But if I shut wsl down and restart it only then do I start seeing the issue, until I reboot my computer. I figure I must be doing something wrong when I shut it down and restart it.

Benja1972 commented 11 months ago

Have same issue

PS C:\Users\*****> wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2715
Cyterafle commented 11 months ago

Same issue here with latest WSL image

Version WSL : 2.0.14.0
Version du noyau : 5.15.133.1-1
Version WSLg : 1.0.59
Version MSRDC : 1.2.4677
Version direct3D : 1.611.1-81528511
Version de DXCore : 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Version de Windows : 10.0.19045.3758
Spencillian commented 11 months ago

Same issue running the Quartus installer image My versions for everything are the same as above, except for windows version which is slightly updated

WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22635.2850

I've noticed that if I drag and move the window around, it briefly returns the normal expected screen. Not sure how much that helps. If I can be of any other help please let me know.

birdue commented 11 months ago

This reddit post solved it for me.

I can now run GUI apps without any glitches. Not sure if the issue will reoccur, though

vielhuber commented 11 months ago

This reddit post solved it for me.

  • In the Windows directory C:\Users\<username> (also accessible by pasting %USERPROFILE% in the address bar in Explorer), create a file named .wslconfig
  • Open the file and paste the following:
    [wsl2]
    guiApplications = true
  • Restart WSL.

I can now run GUI apps without any glitches. Not sure if the issue will reoccur, though

Didn't work for me after restarting the computer.

38leinaD commented 11 months ago

Same issue for me. Worked at some previous WSL version but now is broken. image

WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.3693

Nothing described above helped yet. Updated to latest nvidia driver. LIBGL_ALWAYS_SOFTWARE=1,...

Any idea is appreciated as it makes it virtually unusable for most of my workflow.

Current .wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=false
WESTON_RDP_WINDOW_SNAP_ARRANGE=true
WESTON_RDPRAIL_SHELL_LOCAL_MOVE=true
;disable GPU in system-distro
LIBGL_ALWAYS_SOFTWARE=1

Using the Debian distro in WSL. Graphics card is NVIDIA GeForce RTX 2060.

BiruBear commented 11 months ago

Same issue for me. Worked at some previous WSL version but now is broken. image

WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.3693

Nothing described above helped yet. Updated to latest nvidia driver. LIBGL_ALWAYS_SOFTWARE=1,...

Any idea is appreciated as it makes it virtually unusable for most of my workflow.

Current .wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=false
WESTON_RDP_WINDOW_SNAP_ARRANGE=true
WESTON_RDPRAIL_SHELL_LOCAL_MOVE=true
;disable GPU in system-distro
LIBGL_ALWAYS_SOFTWARE=1

Using the Debian distro in WSL. Graphics card is NVIDIA GeForce RTX 2060.

Have you tried to deactivate wslg completely, like I have suggested above?

FaheemM1020 commented 11 months ago

I guess this might work: End task of WSL from task manager and open Ecmas or whatever app you want to use from start menu (not through terminal)

38leinaD commented 11 months ago

Same issue for me. Worked at some previous WSL version but now is broken. image

WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.3693

Nothing described above helped yet. Updated to latest nvidia driver. LIBGL_ALWAYS_SOFTWARE=1,... Any idea is appreciated as it makes it virtually unusable for most of my workflow. Current .wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=false
WESTON_RDP_WINDOW_SNAP_ARRANGE=true
WESTON_RDPRAIL_SHELL_LOCAL_MOVE=true
;disable GPU in system-distro
LIBGL_ALWAYS_SOFTWARE=1

Using the Debian distro in WSL. Graphics card is NVIDIA GeForce RTX 2060.

Have you tried to deactivate wslg completely, like I have suggested above?

No. I am interested in getting wslg working. I assume that might work as that was the approach when wslg was not yet available. Or will this bring any insight for the wslg issue you mean?

38leinaD commented 11 months ago

I guess this might work: End task of WSL from task manager and open Ecmas or whatever app you want to use from start menu (not through terminal)

i dont understand. how can i open a wsl app from the hosts start menu?

nikosandreou commented 11 months ago

@38leinaD

Like this

start_menu

BiruBear commented 11 months ago

Same issue for me. Worked at some previous WSL version but now is broken. image

WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.3693

Nothing described above helped yet. Updated to latest nvidia driver. LIBGL_ALWAYS_SOFTWARE=1,... Any idea is appreciated as it makes it virtually unusable for most of my workflow. Current .wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=false
WESTON_RDP_WINDOW_SNAP_ARRANGE=true
WESTON_RDPRAIL_SHELL_LOCAL_MOVE=true
;disable GPU in system-distro
LIBGL_ALWAYS_SOFTWARE=1

Using the Debian distro in WSL. Graphics card is NVIDIA GeForce RTX 2060.

Have you tried to deactivate wslg completely, like I have suggested above?

No. I am interested in getting wslg working. I assume that might work as that was the approach when wslg was not yet available. Or will this bring any insight for the wslg issue you mean?

Not many insights, it just proves that wslg is the source of this problem. You are correct, I always used WSL with a third-party X server. WSLg is convenient, but I can survive without it, I never checked the eventual advantages.

x0wllaar commented 11 months ago

I can add to this issue with my comment on #1025:

Can reproduce on Win11 with cool-retro-term

To reproduce (on Ubuntu 22.04):

sudo apt install cool-retro-term
cool-retro-term

Screenshot 2023-12-19 195032

A fully transparent window will appear, mouse events will go to the window below.

When running as LIBGL_ALWAYS_SOFTWARE=1 cool-retro-term, everything works as expected: Screenshot 2023-12-19 195248

This is fairly similar to this issue in CRT's repo: https://github.com/Swordfish90/cool-retro-term/issues/217, which turned out to be a driver issue, so this suggests that it's some incompatibility between QML and WSLg.

Running QSG_INFO=1 cool-retro-term shows the empty window and prints the following in the terminal:

qt.scenegraph.general: threaded render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.68 ms
Both point size and pixel size set. Using pixel size.
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.68 ms
qt.scenegraph.general: opengl texture atlas dimensions: 1024x1024
qt.scenegraph.general: R/G/B/A Buffers:   8 8 8 8
qt.scenegraph.general: Depth Buffer:      24
qt.scenegraph.general: Stencil Buffer:    8
qt.scenegraph.general: Samples:           -1
qt.scenegraph.general: GL_VENDOR:         Microsoft Corporation
qt.scenegraph.general: GL_RENDERER:       D3D12 (Intel(R) Iris(R) Xe Graphics)
qt.scenegraph.general: GL_VERSION:        4.1 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~22.04.1
qt.scenegraph.general: GL_EXTENSIONS:    GL_AMD_conservative_depth GL_AMD_draw_buffers_blend GL_AMD_multi_draw_indirect GL_AMD_shader_stencil_export GL_AMD_shader_trinary_minmax GL_AMD_texture_texture4 GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_APPLE_packed_pixels GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conditional_render_inverted GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_draw_parameters GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_stencil_export GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_filter_anisotropic GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_blend_equation_separate GL_ATI_draw_buffers GL_ATI_fragment_shader GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_EGL_image_storage GL_EXT_EGL_sync GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_texture GL_EXT_debug_label GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_separate_specular_color GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texture GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_IBM_multimode_draw_arrays GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_INGR_blend_func_separate GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_KHR_parallel_shader_compile GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_sliced_3d GL_MESA_pack_invert GL_MESA_shader_integer_functions GL_MESA_texture_signed_rgba GL_MESA_window_pos GL_NV_ES1_1_compatibility GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_image GL_NV_depth_clamp GL_NV_fog_distance GL_NV_half_float GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_vdpau_interop GL_OES_EGL_image GL_OES_read_format GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays
qt.scenegraph.general: Max Texture Size: 16384
qt.scenegraph.general: Debug context:    false

Forcing OpenGL version to 3.1 does not help.

Here's my glxinfo | grep -i opengl:

OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (Intel(R) Iris(R) Xe Graphics)
OpenGL core profile version string: 4.1 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1
OpenGL core profile shading language version string: 4.10
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.1 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~22.04.1
OpenGL shading language version string: 4.10
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 23.0.4-0ubuntu1~22.04.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

Here's my wsl --version:

WSL version: 2.0.15.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2861

I have Iris Xe on i7-1360P, Intel Driver version 31.0.101.5081 (updated to the latest one yesterday, still did not fix the issue)

I think that the problem is with the Intel Driver somehow

At the same time, glxgears works perfectly well.

Leojangh commented 11 months ago

I had this glitch after I moved my distro to annother disk(using wsl --export and then wsl --import),but it cannot repreduce when i restarted my PC.

Majixed commented 11 months ago

I had this problem after exporting my WSL distro to an external disk, and it would only occur after I closed the terminal, waited for a bit, and reopened it again. Then when I start a GUI application, it would show [WARN: COPY MODE] in the title bar when I hover over it in the taskbar, and said corruption would occur when I try to perform any action in the GUI app. Today I set my HDD to stop automatically sleeping after 1 minute of inactivity, and this problem seems to have disappeared completely. So I think it had something to do with the HDD going to sleep while WSL was still running in the background.

Edit: Never mind, issue is still present

Frumious commented 11 months ago

I just installed a fresh copy of WSL on a new laptop with the default Ubuntu 22.04 and ran into this with emacs in a gui window.

I upgraded to ubuntu 23.04 (sudo do-release-upgrade), rebooted, and the problem was fixed. I normally run the latest Ubuntu, so this was just a pitstop on the way to 23.10. If you really need 22.04, you'll need another solution, but if you just want it to work, upgrading ubuntu seems to do the trick.

jonkerw85 commented 10 months ago

I also encounter this problem on my laptop with up-to-date windows Intel arc driver (v31.0.101.5084), on Ubuntu 22.04. For example, running xeyes resulted in glitches. During movements or resizing of xeyes window the glitches temporarily stop.

WSL-versie: 2.0.9.0 Kernelversie: 5.15.133.1-1 WSLg-versie: 1.0.59 MSRDC-versie: 1.2.4677 Direct3D-versie: 1.611.1-81528511 DXCore-versie: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows-versie: 10.0.19045.3693

markeissler commented 10 months ago

Just setting up a brand new Windows 11 Pro workstation and I'm seeing this problem with Ubuntu 22.04 as well.

Screenshot 2024-01-05 102725 Screenshot 2024-01-05 104747

Haven't tried upgrading to 23.04 as I'm waiting to see more feedback on that from others.

UPDATE: I stopped and restarted wsl and so far I don't seem to be experiencing this issue even after a sleep/wake cycle. Hrmm.

PikalaxALT commented 10 months ago

I tried:

  • Updated nvidia drivers (via "GeForce Experience")
  • sudo apt update
  • sudo apt upgrade
  • wsl --shutdown via PowerShell (Admin)

Then it worked until a restart.

Identified that after boot I manually once always need to run wsl --shutdown, then reopen wsl and it works from then on until the next restart.

I can't downgrade at the moment and am waiting for an official fix (see #1130).

Experiencing the same issue. This works as a temporary fix.

torzdf commented 10 months ago

I'll add a "me too" to this.

In my testing, this impacts all WSL2 distros, but it does not always happen (it just happens most of the time).

I have tested the fixes above, and whilst it sometimes appears to have fixed the issue, the reality (for me) was that it was just coincidence, and the glitch had not happened to hit on that occasion. When I re-open the app later, then the issue may or may not have returned, but at some point it will return.

It would be great if there was some acknowledgement here that there is an issue and whether it will or will not be addressed. My usecase is I need to package an app that uses WSL2, and I cannot realistically release unless this issue gets fixed (or unless there is acknowledgement that it won't be fixed and I will need to look for a workaround with a 3rd party X-client).

rudeq commented 10 months ago

Another me too added. Come on Microsoft, you break it, you fix it. It's been more than 2 months

arti5an commented 10 months ago

Another "me too". I seem to be able to launch QT applications reliably however, so thankfully was able to swap out my pinentry from the gtk to qt flavour. I'm using NixOS under WSL too, which demonstrates (as others have found) that it's not just Ubuntu. Annoyingly it breaks VS Code within WSL, and in fact anything I've tried that I know uses Electron. Weirdly when it does happen, moving the affected window about seems to fix it temporarily while moving, then it breaks once you drop it.

All seems to suggest it's a host level problem to me, but QT (probably an old version) pinentry working suggests maybe that's a modern graphics acceleration feature that's broken maybe...?

snowgato commented 10 months ago

running wsl2 on ubuntu22.04 adding LIBGL_ALWAYS_SOFTWARE=1 to .wslconfig just temporarly solved the issue, now it's back

I've finally installed mobaXterm on windows, then modified ~/.bashrc adding the following line: export DISPLAY="$(/sbin/ip route | awk '/default/ { print $3 }'):0"

on mobaXterm, I did Setttings>Configuration>X11tab>Set X11 remote access to full to skip dialog confirmationsto enable X11 connection

with mobaXterm connections allowed only on private network

and that works, 10 min to do it

arti5an commented 10 months ago

Thanks for the pointer/idea @snowgato. I did a bit of digging around the wslg repo and found mention of various config options in the wiki. Near the bottom is the option to force software rendering, which seems to at least circumvent the issue for me. These options don't belong in .wslconfig however; they should be in .wslgconfig (note the g). In my case I entered the following, and after restarting WSL it seems to work:

[system-distro-env]
LIBGL_ALWAYS_SOFTWARE=1