wslg icon indicating copy to clipboard operation
wslg copied to clipboard

MESA ERROR

Open Perdixky opened this issue 1 year ago • 16 comments
trafficstars

Windows Version

Microsoft Windows [version 10.0.26120.1542]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

  • [x] WSL 2
  • [ ] WSL 1

Kernel Version

6.6.36.6

Distro Version

Ubuntu 24.04

Other Software

No response

Repro Steps

When I use the GUI, I usually see error messages related to rendering, but they don't generally affect usage:

> gz sim
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: Some incorrect rendering might occur because the selected Vulkan device (Microsoft Direct3D12 (NVIDIA GeForce RTX 3070)) doesn't support base Zink requirements: feats.features.logicOp have_EXT_custom_border_color have_EXT_line_rasterization
> emacs
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: Some incorrect rendering might occur because the selected Vulkan device (Microsoft Direct3D12 (NVIDIA GeForce RTX 3070)) doesn't support base Zink requirements: feats.features.logicOp have_EXT_custom_border_color have_EXT_line_rasterization

However, recently when using gnome-font-viewer, I encountered the following:

libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: Some incorrect rendering might occur because the selected Vulkan device (Microsoft Direct3D12 (NVIDIA GeForce RTX 3070)) doesn't support base Zink requirements: feats.features.logicOp have_EXT_custom_border_color have_EXT_line_rasterization
MESA: error: Failed to attach to x11 shm

It displays a transparent box, making it unusable.

Expected Behavior

I hope there is a solution to open gnome-font-viewer. In fact, I don't really understand graphic rendering and am not sure whether the problem lies with OPENGL, MESA, dzn, or Vulkan.

Actual Behavior

MESA: error: Failed to attach to x11 shm

Diagnostic Logs

No response

Perdixky avatar Sep 07 '24 04:09 Perdixky

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

github-actions[bot] avatar Sep 07 '24 04:09 github-actions[bot]

Diagnostic information
.wslconfig found
	Custom kernel found: 'C:\Windows\System32\lxss\tools\kernel'
Detected appx version: 2.2.4.0

github-actions[bot] avatar Sep 08 '24 07:09 github-actions[bot]

Diagnostic information

.wslconfig found
	Custom kernel found: 'C:\Windows\System32\lxss\tools\kernel'
Detected appx version: 2.2.4.0

The kernel was compiled and installed by me using the kernel from https://github.com/microsoft/WSL2-Linux-Kernel. Detailed version information:

commit e458890574d4b6d635880180ef9e5d2b621ff577 (HEAD -> linux-msft-wsl-6.6.y, tag: linux-msft-wsl-6.6.36.6, origin/linux-msft-wsl-6.6.y, origin/HEAD)
Merge: 149cbd13f7c0 6cb123f853df
Author: Mitchell Levy <[email protected]>
Date:   Tue Sep 3 14:23:23 2024 -0700

    Merge tag 'rolling-lts/wsl/6.6.36.6' into linux-msft-wsl-6.6.y

    Linux rolling-lts/wsl/6.6.36.6

    Signed-off-by: Mitchell Levy <[email protected]>

Perdixky avatar Sep 08 '24 07:09 Perdixky

don't run wslg stuff as root

uureel avatar Sep 08 '24 22:09 uureel

don't run wslg stuff as root

Thank you for your suggestion! However, I am not using the root account. The problem is still there

Perdixky avatar Sep 09 '24 11:09 Perdixky

don't run wslg stuff as root

Thank you for your suggestion! However, I am not using the root account. The problem is still there

try ln -sf /mnt/wslg/runtime-dir/wayland* /run/user/0/ dbus-run-session gnome-font-viewer

uureel avatar Sep 09 '24 12:09 uureel

don't run wslg stuff as root

Thank you for your suggestion! However, I am not using the root account. The problem is still there

try ln -sf /mnt/wslg/runtime-dir/wayland* /run/user/0/ dbus-run-session gnome-font-viewer

I have only one folder named 1002 under my /run/user directory, so I used the following command:

> noglob sudo ln -sf /mnt/wslg/runtime-dir/wayland* /run/user/1002/
> dbus-run-session gnome-font-viewer

However, the following error was still thrown:

libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: Some incorrect rendering might occur because the selected Vulkan device (Microsoft Direct3D12 (NVIDIA GeForce RTX 3070)) doesn't support base Zink requirements: feats.features.logicOp have_EXT_custom_border_color have_EXT_line_rasterization
dbus-daemon[1149]: [session uid=0 pid=1149] Activating service name='org.a11y.Bus' requested by ':1.0' (uid=0 pid=1150 comm="gnome-font-viewer" label="kernel")
dbus-daemon[1149]: [session uid=0 pid=1149] Successfully activated service 'org.a11y.Bus'
MESA: error: Failed to attach to x11 shm
dbus-daemon[1183]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=0 pid=1150 comm="gnome-font-viewer" label="kernel")
dbus-daemon[1183]: Successfully activated service 'org.a11y.atspi.Registry'
SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
MESA: error: Failed to attach to x11 shm

Perdixky avatar Sep 12 '24 04:09 Perdixky

don't run wslg stuff as root

Thank you for your suggestion! However, I am not using the root account. The problem is still there

try ln -sf /mnt/wslg/runtime-dir/wayland* /run/user/0/ dbus-run-session gnome-font-viewer

Thanks. It seems to work for me.

ACGNnsj avatar Oct 14 '24 12:10 ACGNnsj

Any updates on this ? I am getting this warning on python3 matlib plot.

WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: Some incorrect rendering might occur because the selected Vulkan device (Microsoft Direct3D12 (NVIDIA GeForce RTX 3070 Ti)) doesn't support base Zink requirements: feats.features.logicOp have_EXT_custom_border_color have_EXT_line_rasterizatio

skemo12 avatar Oct 23 '24 10:10 skemo12

The same warnings (without errors):

WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: Some incorrect rendering might occur because the selected Vulkan device (Microsoft Direct3D12 (NVIDIA GeForce GTX 1050 Ti)) doesn't support base Zink requirements: feats.features.logicOp have_EXT_custom_border_color have_EXT_line_rasterization

tms320 avatar Nov 16 '24 15:11 tms320

Same warning when using isaac_gym and gazebo. I wonder if this is the reason why my isaac_gym runs so slow? Only 15 fps seems little too low.

LiuDingchuan avatar Feb 10 '25 14:02 LiuDingchuan

I had the same issue: MESA: error: Failed to attach to x11 shm Fixed it by simply doing export GALLIUM_DRIVER=d3d12, suggested here

MarcusVH98 avatar Mar 21 '25 15:03 MarcusVH98

Any solution? I have the same problems when using gnome-text-editor or nautilus in ubuntu 24.04 wsl 2.

liudonghua@LDH-DESKTOP:/usr/local/etc$ sudo nautilus recursor.yml

** (org.gnome.Nautilus:26747): WARNING **: 14:09:58.221:
========================================================
This app cannot work correctly if run as root (not even
with sudo). Consider running `nautilus admin:/` instead.
========================================================
** Message: 14:10:05.266: Connecting to org.freedesktop.Tracker3.Miner.Files
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen

** (org.gnome.Nautilus:26747): WARNING **: 14:10:05.600: Unable to get contents of the bookmarks file: Error opening file /root/.gtk-bookmarks: No such file or directory

** (org.gnome.Nautilus:26747): WARNING **: 14:10:05.601: Unable to get contents of the bookmarks file: Error opening file /root/.gtk-bookmarks: No such file or directory
MESA: error: Failed to attach to x11 shm
MESA: error: Failed to attach to x11 shm

(org.gnome.Nautilus:26747): GLib-GIO-CRITICAL **: 14:10:07.983: g_app_info_get_commandline: assertion 'G_IS_APP_INFO (appinfo)' failed

(org.gnome.Nautilus:26747): GLib-CRITICAL **: 14:10:07.983: g_str_match_string: assertion 'potential_hit != NULL' failed
MESA: error: Failed to attach to x11 shm

(org.gnome.Nautilus:26747): GLib-GIO-CRITICAL **: 14:10:08.008: g_app_info_get_commandline: assertion 'G_IS_APP_INFO (appinfo)' failed

(org.gnome.Nautilus:26747): GLib-CRITICAL **: 14:10:08.008: g_str_match_string: assertion 'potential_hit != NULL' failed

(org.gnome.Nautilus:26747): GLib-GIO-CRITICAL **: 14:10:08.008: g_app_info_get_commandline: assertion 'G_IS_APP_INFO (appinfo)' failed

(org.gnome.Nautilus:26747): GLib-CRITICAL **: 14:10:08.008: g_str_match_string: assertion 'potential_hit != NULL' failed
MESA: error: Failed to attach to x11 shm
MESA: error: Failed to attach to x11 shm

(org.gnome.Nautilus:26747): GLib-GIO-CRITICAL **: 14:10:08.121: g_app_info_get_commandline: assertion 'G_IS_APP_INFO (appinfo)' failed

(org.gnome.Nautilus:26747): GLib-CRITICAL **: 14:10:08.121: g_str_match_string: assertion 'potential_hit != NULL' failed

(org.gnome.Nautilus:26747): GLib-GIO-CRITICAL **: 14:10:08.121: g_app_info_get_commandline: assertion 'G_IS_APP_INFO (appinfo)' failed

(org.gnome.Nautilus:26747): GLib-CRITICAL **: 14:10:08.121: g_str_match_string: assertion 'potential_hit != NULL' failed

(org.gnome.Nautilus:26747): GLib-GIO-CRITICAL **: 14:10:08.124: g_app_info_get_commandline: assertion 'G_IS_APP_INFO (appinfo)' failed

(org.gnome.Nautilus:26747): GLib-CRITICAL **: 14:10:08.124: g_str_match_string: assertion 'potential_hit != NULL' failed
MESA: error: Failed to attach to x11 shm
MESA: error: Failed to attach to x11 shm
^C
liudonghua@LDH-DESKTOP:/usr/local/etc$
liudonghua@LDH-DESKTOP:/usr/local/etc$ gnome-text-editor recursor.yml
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen

(gnome-text-editor:27429): Gtk-WARNING **: 15:35:22.438: Unable to acquire session bus: Could not connect: Connection refused
MESA: error: Failed to attach to x11 shm
MESA: error: Failed to attach to x11 shm
MESA: error: Failed to attach to x11 shm
^C
liudonghua@LDH-DESKTOP:/usr/local/etc$ export GALLIUM_DRIVER=d3d12
liudonghua@LDH-DESKTOP:/usr/local/etc$ gnome-text-editor recursor.yml
libEGL warning: DRI3: Screen seems not DRI3 capable

(gnome-text-editor:27456): Gtk-WARNING **: 15:36:03.573: Unable to acquire session bus: Could not connect: Connection refused
MESA: error: Failed to attach to x11 shm
MESA: error: Failed to attach to x11 shm
^C
liudonghua@LDH-DESKTOP:/usr/local/etc$ 

reference: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

liudonghua123 avatar Jun 09 '25 07:06 liudonghua123

I found a solution via using the following two envs.

export GSK_RENDERER=cairo
export GDK_BACKEND=x11

See also https://github.com/microsoft/wslg/issues/1250#issuecomment-2671499702.

Image

liudonghua123 avatar Jun 09 '25 07:06 liudonghua123

**上面的方法都没有什么用呢?

user目录下是空的,根本没有1002或者0 目录,因为这是wsl下。 root@WESTPC:~# ls /run/user/ 另外wsl下,程序会优先查找这个目录,不需要ln操作。 root@WESTPC:~# ls /mnt/wslg/runtime-dir/ pulse wayland-0 wayland-0.lock root@WESTPC:~#**

duyongze avatar Aug 31 '25 02:08 duyongze