Graphics artifacts when using SDL
Windows Version
Microsoft Windows [Version 10.0.22621.2428]
WSL Version
2.0.6.0
Are you using WSL 1 or WSL 2?
- [X] WSL 2
- [ ] WSL 1
Kernel Version
5.15.133.1
Distro Version
Ubuntu 22.04
Other Software
Custom application using SDL graphics api
Repro Steps
Open the app, UI is completely distorted and the UI is drawn out of the window bounds. Looks like this is the root cause as the actual drawn content looks correct, just shifted.
The correct image is rendered when dragging the window (flickering).
I did not have this issue in previous WSL 2 versions, but I don't know on which exact version it still was working.
Expected Behavior
Actual Behavior
Diagnostic Logs
Please let me know if you need additional logs
@davidgiga1993 the issue was introduced with the 2.0.6 release. After upgrading to 2.0.6 I've upgraded the Nvidia graphics driver also and wasn't sure what causes the artifacts. Building WSLg and replacing the system distro the artifacts are gone so it's not the Nvidia driver.
elsaco@mantic:/mnt/wslg$ cat versions.txt
WSLg ( x86_64 ): <current>
Mariner: VERSION="2.0.20230630"
DirectX-Headers: cf123266ce6f1e9a6e700642edb6356bff1e3d55
mesa: be4f7fb656180ab55a50eff01f36672b0bf5f146
pulseaudio: 6f045ff0dca233a939a2aba815f84d177e294122
FreeRDP: c4030980b29322a9cb2190711a5fadeeeb8b6a33
weston: 1c19fc5ecdd4552f36f77256e1fb53225801aff0
WSLg build instructions: https://github.com/microsoft/wslg/blob/main/CONTRIBUTING.md#building-the-wslg-system-distro
same graining issue for me after updating to 2.0.6 on windows 11. any fix in the working?
User suggests that replacing system distro fixes the issue, so I suspect something in a recent WSLg update?
I can confirm this behavior on WSLg v1.0.59. If I downgrade to WSL version 2.0.4 which uses WSLg v1.0.58, linux applications work fine.
Currently experiencing the same with an app called Bruno, here's the version of WSL I'm using:
WSL version: 2.0.7.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.25880.1000-230602-1350.main
Windows version: 10.0.22635.2700
I had a similar issue. See: https://github.com/microsoft/wslg/issues/1128
I somehow fixed it but I'm not sure how. Do you maybe use a custom kernel?
@davidgiga1993 the issue was introduced with the
2.0.6release. After upgrading to 2.0.6 I've upgraded the Nvidia graphics driver also and wasn't sure what causes the artifacts. BuildingWSLgand replacing the system distro the artifacts are gone so it's not the Nvidia driver.elsaco@mantic:/mnt/wslg$ cat versions.txt WSLg ( x86_64 ): <current> Mariner: VERSION="2.0.20230630" DirectX-Headers: cf123266ce6f1e9a6e700642edb6356bff1e3d55 mesa: be4f7fb656180ab55a50eff01f36672b0bf5f146 pulseaudio: 6f045ff0dca233a939a2aba815f84d177e294122 FreeRDP: c4030980b29322a9cb2190711a5fadeeeb8b6a33 weston: 1c19fc5ecdd4552f36f77256e1fb53225801aff0WSLg build instructions: https://github.com/microsoft/wslg/blob/main/CONTRIBUTING.md#building-the-wslg-system-distro
This actually worked for me.
@davidgiga1993 the issue was introduced with the
2.0.6release. After upgrading to 2.0.6 I've upgraded the Nvidia graphics driver also and wasn't sure what causes the artifacts. BuildingWSLgand replacing the system distro the artifacts are gone so it's not the Nvidia driver.elsaco@mantic:/mnt/wslg$ cat versions.txt WSLg ( x86_64 ): <current> Mariner: VERSION="2.0.20230630" DirectX-Headers: cf123266ce6f1e9a6e700642edb6356bff1e3d55 mesa: be4f7fb656180ab55a50eff01f36672b0bf5f146 pulseaudio: 6f045ff0dca233a939a2aba815f84d177e294122 FreeRDP: c4030980b29322a9cb2190711a5fadeeeb8b6a33 weston: 1c19fc5ecdd4552f36f77256e1fb53225801aff0WSLg build instructions: https://github.com/microsoft/wslg/blob/main/CONTRIBUTING.md#building-the-wslg-system-distro
This actually worked for me.
Did you follow the instructions in the link (where does the text elasco provide go?)
I had this issue, and I found simply updating my Nvidia drivers fixed the issue. Something to check.
I had this issue, and I found simply updating my Nvidia drivers fixed the issue. Something to check.
This worked for me, thanks for the advice.
Edit: FYI, I updated both wsl nvidia drviers and windows nvidia drivers and this issue went away.
Same here newest intel drivers are installed. The app on the screenshot is nautilus.
Intel gfx driver: 31.0.101.2125 (24.05.2023)
WSL-Version: 2.0.9.0
Kernelversion: 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
NAME STATE VERSION
* Ubuntu-18.04 Running 2
docker-desktop-data Stopped 2
I had the same issue. Installing the newest Nvidia drivers alone didn't work, however I was able to fix it by additionally running sudo apt update + sudo apt upgrade and then completely restarting wsl using wsl --shutdown.
Maybe, need to "wsl --shutdown" and start wsl.
~I updated and upgraded, then updated my intel graphics drivers, then closed wsl, and restarted my windows machine, and the graphics errors are gone.~ This comment on the below linked ticket seems to have helped as well: https://github.com/microsoft/wslg/issues/1148#issuecomment-1827607993
I can confirm this behavior on WSLg v1.0.59. If I downgrade to WSL version 2.0.4 which uses WSLg v1.0.58, linux applications work fine.
Same for me. Updating both the intel and Nvidia drivers did not fix the problem. Downgraded WSL to 2.0.4 until this is resolved.
I had to reboot the system after installing latest Nvidia drivers for my 3060 based laptop. The problems I think started after Windows updated WSL to 2.0.9.0, and I updated the Ubuntu 22.04 distro with latest updates. Updating graphics drivers was the last thing to do, and that seems to have solved the issues
This is easy to reproduce by using emacs or xterm. For me I can use the latest wsl2 but only on ubuntu 20.04. Ubuntu 22 shows the issue. If install the latest nvidia driver then even ubuntu 20.04 shows the issue.
Same issue here. WSL (default version provided by windows) + ubuntu + latest nvidia drivers.
I also found that even after applying the fixes given above, the bug still somehow reappears after some time.
Workaround: Every time windows starts, I know it's going to have a 50/50 on the graphical tearing, so I always run wsl --shutdown and then restart wsl and then it works. I have idea why sometimes it tears and sometimes it doesn't, but this is a sure fire way to make it always work.
I also faced the issue and it was resolved after sudo apt update + wsl --shutdown. It updated few packages, the most important is:
[UPGRADE] linux-libc-dev:amd64 6.1.66-1 -> 6.1.76-1
wsl --version
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.3930
I also faced the issue and it was resolved after
sudo apt update+wsl --shutdown. It updated few packages, the most important is:[UPGRADE] linux-libc-dev:amd64 6.1.66-1 -> 6.1.76-1wsl --version 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.3930
Are you sure the library upgrade had any affect here?
For me the issue just goes away temporarily by doing wsl --shutdown, and stays working as long as you have at least one wslg window up
I'm not sure that GUI glitches are related to libs, it was the only important lib in the update (among 20 packages)...
Probably restart of WSL subsystem helps with problems but I did it few times and the problem persisted till I run apt upgrade.
Install 'dbus-x11' and this problem, will be fixed. Not sure why WSL2 distros do not install dbus-x11 when you install an x11/GUI app, but the problem is dbus-x11 is missing.
@TheNavyBear I'm not convinced dbus-x11 package is the issue. I'm running xterm and dbus-x11 is not installed and there are no artifacts. I did run into the issue previously but after so many updates & upgrades I can't tell what fixed it:
@TheNavyBear I'm not convinced
dbus-x11package is the issue. I'm runningxtermanddbus-x11is not installed and there are no artifacts. I did run into the issue previously but after so many updates & upgrades I can't tell what fixed it:
Fair enough, I know I installed 'dbus-x11' on my Debian WSL2 systems and my GUI issues went away, and two apps that wouldn't open at all now run fine.
Installing dbus-x11 makes/made no difference. I apparently already had it installed and still get the artifacts. The only way to not get the artifacts is to start a wslg application sufficiently quickly after wsl has started. As long as 1 wslg app remains up, all subsequent wslg apps are good.
I regularly run into this. Shutdown trick seems to work well.
I just started to experience the same. Didn't update anything.
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.3155
What helped? After shutting down the WSL, I started the Nautius using the shortcut in start menu.
