wslg icon indicating copy to clipboard operation
wslg copied to clipboard

WSL2 X11 output corruption

Open deviantbit opened this issue 1 year ago • 43 comments

Windows Version

Version 10.0.22631 Build 22631

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.15.133.1-1

Distro Version

Ubuntu-22.04

Other Software

Any and all applications that use xlib or X Windows.

Repro Steps

Launch an xeyes, or emacs.

Expected Behavior

image

Actual Behavior

image

Diagnostic Logs

Nothing in logs to report.

deviantbit avatar Nov 27 '23 17:11 deviantbit

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Nov 27 '23 17:11 github-actions[bot]

I have tried multiple versions of NVIDIA drivers. Doesn't appear to be a driver issue. Appears to be and issue with the internal X window server.

deviantbit avatar Nov 27 '23 17:11 deviantbit

I'm experiencing the same issue. After a lot of reading I'm thinking that it may be because I'm running on a Surface Pro 7 with a 2560x1440 resolution display. Found some postings talking about HiDPI displays having issues with FreeRDP, an internal WSLg component.

$ wsl.exe --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

Specifically I'm (also) trying to get emacs working using the following:

$ git clone --single-branch --branch emacs-29 git://git.sv.gnu.org/emacs.git $ sudo apt install build-essential libgtk-3-dev libgnutls28-dev libtiff5-dev libgif-dev libjpeg-dev libpng-dev libxpm-dev libncurses-dev texinfo autoconf libgccjit-11-dev libsqlite3-dev xml2 libattr1-dev libacl1-dev libxml2-dev $ cd emacs $ ./autogen.sh $ ./configure --with-pgtk $ make -j4 $ sudo make install

$ emacs --version GNU Emacs 29.1.90 Development version 687c416ce9bf on emacs-29 branch; build date 2023-11-27.

All Windows 11 updates have been applied with particular attention to drivers and firmware.

gnome-tweaks and other linux gui apps all seem to have the same behavior.

etxaleku avatar Nov 27 '23 21:11 etxaleku

I plugged in a 1080p monitor. It had the same issue.

deviantbit avatar Nov 27 '23 21:11 deviantbit

I also noticed that whenever I try to run any GUI apps like emacs for example, my %AppData%\Local\Temp\DiagOutputDir\RdClientAutoTrace folder is filling up with hundreds of 4MB files...

trace-files

etxaleku avatar Nov 27 '23 23:11 etxaleku

This is rasterization problem.

image

deviantbit avatar Nov 28 '23 00:11 deviantbit

I got mine completely working! It's rock solid and I couldn't be happier... well, I guess I could win the Lotto but... :)

So I tried a ton of stuff but the one that got everything working was upgrading my video driver. So throughout Microsoft's WSL/WSLg web pages they do mention that it's very important for WSLg/Wayland to work that you update your video driver to the latest from the manufacturer. But then both Microsoft (laptop vendor) and Intel (driver vendor) warn that if you update from Intel (the driver vendor) then you risk losing any special customizations/configurations that the OEM vendor (Microsoft in this case) may have made and worst case you could even lose your video entirely (the warnings look a bit ominous). They both recommend going to the laptop vendor site and upgrading from there as the safe path - so that's what I had (previously) done. But in the case of the Surface Pro Microsoft does offer a single package that upgrades all the Surface drivers and firmware and puts everything back to "out of box" so I applied that (early on) but no joy. So armed with that as a "backup" I went ahead, held my breath, and upgraded from the Intel (driver vendor) site at www.intel.com/content/www/us/en/support/intel-driver-support-assistant.html being careful to select the right video hardware and "generation", etc. The vendor driver update went smoothly (I may have passed out holding my breath once or twice during the process, it took a while) but then after a reboot I brought up emacs and it seems rock solid. No video weirdness whatsoever, new frames are fine, splitting windows is flawless, everything is exactly as I've known emacs to be for, well, a long time. Even web browsing works (I'd never even tried that before)!

And no more trace files have shown up in my %AppData%\Local\Temp\DiagOutputDir\RdClientAutoTrace folder.

Also, all other WSL GUI apps (gnome-tweaks, octave, gnuplot, etc) are also all working smoothly now. Octave and gnuplot integrate and work from emacs smoothly.

I cannot say enough great things about WSL/WSLg - it's the environment I've always wished for and maybe a bit more!

Thanks to everyone that worked on and supports WSL/WSLg!

etxaleku avatar Nov 28 '23 23:11 etxaleku

Something else resolved it. I'm not on a laptop, and using the latest drivers. I went back several generation of drivers and it still had the problem. So you did something else.

deviantbit avatar Nov 28 '23 23:11 deviantbit

I'm on a desktop, with an external display, seeing the same thing.

image

I have an NVIDIA GeoForce RTX-4090 and the latest drivers.

ksylvan avatar Nov 28 '23 23:11 ksylvan

Hmm, I see what you mean. Are you also seeing those trace files piling up in your %AppData%\Local\Temp\DiagOutputDir\RdClientAutoTrace folder?

For me, I really feel like the driver update made the difference. But there’s a lot of components involved here so I can imagine that every situation has its own nuances. I kept pretty careful notes and I went back and reviewed my command history, and I couldn’t find anything else that looked like it really had any hope. I installed libgccjit-11-dev if that makes a difference.

etxaleku avatar Nov 29 '23 05:11 etxaleku

Hmm, I see what you mean. Are you also seeing those trace files piling up in your %AppData%\Local\Temp\DiagOutputDir\RdClientAutoTrace folder?

Yes @etxaleku

ksylvan avatar Nov 30 '23 02:11 ksylvan

I have had similar issues (on and off) for .. about the last 2 or 3 weeks. E.g. I started seeing the issue on a Friday morning(I guess after a windows update) and was having different problems but the issue disappeared .. possibly after restarting wsl. Due to other issues over the last week (can only run WSL as administrator I install a pre-release (version 2.0.11) see https://github.com/microsoft/WSL/releases and I think the problems started to appear again.

image

I have an Intel IRISxe graphics card, dell laptop and dell usb-c docking startion/multiple displays.

Update: I upgrade the 2.0.12.0 and the issue remains present form me (my intel driver is from 11/07/2023)

image

keesj avatar Dec 01 '23 07:12 keesj

I've restarted WSL (and even shutdown and restart the desktop) and can reproduce this every time, so it's a genuine WSLG bug as far as I can see.

ksylvan avatar Dec 01 '23 15:12 ksylvan

I had a bit of a regression - so my Surface Pro 7 with WSL2 initially experienced the video "fuzzing" problem and I struggled with it for a while but eventually upgraded my Intel Iris Plus driver from the intel web site and all my issues stopped. No more video "fuzz" ever, all Linux graphical apps run smoothly (gnome-tweaks, etc) and no more trace files piling up in that RdClientAutoTrace folder. Well... that is until I did some desktop screen sharing and tried to show them how it was all working... something about the desktop screen sharing caused the issue to come back - emacs and all Linux GUI apps all "fuzzed out" 100% of the time and the RdClientAutoTrace folder starting filling up with the 4MB trace files again... situation continued until I rebooted (getting out of the screen sharing session made no difference) and after the reboot everything is back to rock solid working order... no more fuzz or trace files...

So it look like I have a great working environment, but I can't ever do any screen sharing and expect it to work. :(

And probably once I do any screen sharing then I'll need to reboot to get things working again.

Oh well, it could be worse, as others have mentioned (where they don't have a "fix").

Just thought I'd document the screen sharing aspect as that might shed some insight to a WSLg developer trying to work on this issue.

etxaleku avatar Dec 03 '23 05:12 etxaleku

In my case I do not think it matters if I use an external display or not. I can boot and reproduce the issue with my laptop "standalone"

keesj avatar Dec 04 '23 12:12 keesj

I have the same issues. Updating GPU drivers didn't work (AMD Radeon Pro WX 2100, Driver 31.0.21018.6011 (2023/08/24)). RdClientAutoTrace is being filled as well, but file size is much larger than 4MB.

mahi1980 avatar Dec 04 '23 15:12 mahi1980

I have the same issue, also latest driver from today (nvidia)

Stanzilla avatar Dec 04 '23 17:12 Stanzilla

Same issue here, latest Dell-provided Nvidia drivers on a Dell laptop. I only found out about WSLg this morning after the problem occurred. I don't use GUI apps that much and thought I was still using VCXSrv, which always did the job fine. Turns out it was silently changed into using WSLg. No wonder uninstalling (and reinstalling) VCXSrv didn't help :)

lucvdv-aleacsys avatar Dec 05 '23 10:12 lucvdv-aleacsys

I have the same issue on NVIDIA 546.29 latest WHQL driver on a triple monitor desktop setup.

EDIT: problem seems solved using this : #1130

thanat0s avatar Dec 07 '23 13:12 thanat0s

Dell laptop with Dell Nvidia drivers, first boot of wsl2, same issue. Looks like a mismatch in stride or pixel format. Thanat0s' linked solution apt update, apt upgrade, wsl --shutdown fixed it for me.

bryghtlabs-richard avatar Dec 15 '23 19:12 bryghtlabs-richard

Thanat0s' linked solution fixed it for me as well. I'm running a Dell laptop with Dell Nvidia drivers. The issue popped up for me sometime last week after a few months of stable use.

brianherold avatar Dec 15 '23 21:12 brianherold

That didn't resolve it for me. Maybe there is an update being pushed down stream that hasn't arrived.

deviantbit avatar Dec 15 '23 21:12 deviantbit

I hadn't tried any GUI apps since my previous comment (2 weeks ago), so I don't know exactly when it got fixed, but the problem no longer occurs here either (see comments by brianherold and thanat0s). I remember doing an 'apt update && apt upgrade' last wednesday, so that must have fixed it.

lucvdv-aleacsys avatar Dec 18 '23 08:12 lucvdv-aleacsys

This has been resolved for me now.

deviantbit avatar Dec 18 '23 16:12 deviantbit

This should be reopened. It might be resolved for @deviantbit, but the same issue exists for a lot of other people. For me, it happens after my system has been on for a while. Rebooting temporarily fixes it, but it always happens again after some time.

av-2024 avatar Dec 27 '23 16:12 av-2024

Okay. I reopened the issue.

deviantbit avatar Dec 27 '23 18:12 deviantbit

I agree, it is working for me (very reliably) but there are times when it regresses and the issue reappears. The two situations where I have seen it reappear is -

R1. if I use Teams in a screen sharing session then I have seen it reappear. Rebooting (and avoiding screen sharing) returns it to working condition. R2. if I bring up other Windows-based apps of a "graphical" nature, like a browser, BEFORE starting WSL2 and X-based Linux apps, then the issue seems to be very reproducible - so far 100% of the time based on about 10 reiterations.

For R1 I have successfully been able to do some Teams screen sharing recently and did not have the issue reappear. That one seems to be intermittent. Given the frequency of the Teams screen sharing recurrence, I'm almost wondering if those few times that occurred that it might have actually been a reproduction of R2 as I wasn't aware of R2 initially.

For R2, that one seems very reproducible. If I reboot and the very first thing I start up is WSL2 and then emacs then everything works very reliably and I can use anything (Windows or Linux) I want for days on end without issue. But if I reboot and bring up a browser first then when I start WSL2 and then emacs the issue appears every time. A quick reboot returns everything to working order.

@avaranze, when you say that it works and then "always happens again after some time", how much time are you finding has to pass before it happens? Is it hours or days? Mine has been stable for periods on the order of 7 days or so. The main X-based "graphical" app that I'm running is emacs though I have recently started running a Linux-based version of IntelliJ (Community Edition).

I do also see the "other" issue where X-based graphical apps are "orphaned" after a Windows sleep. Basically if your machine goes to sleep for any reason (manual or automatic), then after resuming the graphical apps are still running according to "ps -ef" but they don't appear on the taskbar and cannot be rendered. But this is a different issue than the one discussed here - the video "fuzzing" issue.

etxaleku avatar Dec 28 '23 21:12 etxaleku

I am still having the issue

keesj avatar Jan 04 '24 17:01 keesj

I still have this issue. A workaround for me is to use fullscreen mode when using Emacs (M-x toggle-frame-fullscreen). But other apps still don't work now.

fuzy112 avatar Jan 09 '24 03:01 fuzy112

I ran into this issue on a fresh Windows 11 install. Double-checked and already had the latest drivers for my NVIDIA card. Using WSL and the Debian build from the Microsoft Store app.

I wound up working around it by creating a .wslgconfig file in %userprofile%, following the advice from https://github.com/microsoft/wslg/issues/1148#issuecomment-1827607993.

indigodarkwolf avatar Jan 12 '24 07:01 indigodarkwolf