microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.34k stars 814 forks source link

GPU resource cannot be used in wsl2: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22/-2 #11293

Open WenyuMolly opened 7 months ago

WenyuMolly commented 7 months ago

Windows Version

10.0.22631.3155

WSL Version

2.1.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.146.1-2

Distro Version

Ubuntu20.04

Other Software

NVIDIA-SMI 550.60.01 Driver Version: 551.76 CUDA Version: 12.4

Repro Steps

I have a RTX3070Ti type GPU in my laptop, and I am using wsl2 with nvidia driver and cuda installed.

Initially, after I run my wsl -d Ubuntu-20.04, I saw "libcuda.so.1 is not a symbolic link" in my dmesg log, after I deleted the orignal libcuda.so.1 and libcuda.so files by running the following code in my powershell:

cd C:\Windows\System32\lxss\lib
rm libcuda.so
rm libcuda.so.1
wsl -e /bin/bash
ln -s libcuda.so.1.1 libcuda.so.1
ln -s libcuda.so.1.1 libcuda.so

I still get this error message in my dmesg log: [ 0.593906] EXT4-fs (sdc): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered. Quota mode: none. [ 0.868684] FS-Cache: Duplicate cookie detected [ 0.868920] FS-Cache: O-cookie c=00000008 [p=00000002 fl=222 nc=0 na=1] [ 0.869171] FS-Cache: O-cookie d=00000000f48f82d2{9P.session} n=0000000041b2bec2 [ 0.869359] FS-Cache: O-key=[10] '34323934393337333737' [ 0.869533] FS-Cache: N-cookie c=00000009 [p=00000002 fl=2 nc=0 na=1] [ 0.869739] FS-Cache: N-cookie d=00000000f48f82d2{9P.session} n=00000000254caff7 [ 0.869983] FS-Cache: N-key=[10] '34323934393337333737' [ 1.019739] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22 [ 1.020297] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22 [ 1.020621] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22 [ 1.021025] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2 [ 1.021994] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22 [ 1.022328] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22 [ 1.022633] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22 [ 1.023063] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2 [ 1.121705] FS-Cache: Duplicate cookie detected [ 1.122075] FS-Cache: O-cookie c=0000000f [p=00000002 fl=222 nc=0 na=1] [ 1.122362] FS-Cache: O-cookie d=00000000f48f82d2{9P.session} n=00000000afce7235 [ 1.122634] FS-Cache: O-key=[10] '34323934393337343032' [ 1.122871] FS-Cache: N-cookie c=00000010 [p=00000002 fl=2 nc=0 na=1] [ 1.123121] FS-Cache: N-cookie d=00000000f48f82d2{9P.session} n=00000000f2f4c832 [ 1.123445] FS-Cache: N-key=[10] '34323934393337343032'

Expected Behavior

My was trying to use gpu acceleration for my xgboost model in a wsl2 environment, and here is what I posted in their forum: https://discuss.xgboost.ai/t/xgboost-using-gpu-in-wsl-environment-doesnt-work/3539

Actual Behavior

In side my dmesg log: image


For my xgboost model running: https://discuss.xgboost.ai/t/xgboost-using-gpu-in-wsl-environment-doesnt-work/3539

Diagnostic Logs

No response

gmonte commented 6 months ago

Occurring the same here when I start the android emulator from avd cli on WSL2. After some seconds the emulator closes and this error happens. If I start the emulator with -gpu off flag everything works fine - but veeeeeeeery slowly image

LuanVSO commented 6 months ago

hitting this on a clean install of windows 11 and WSL, the errors occur as soon as the wsl distro is started:

[    0.245739] hv_vmbus: registering driver dxgkrnl
[    0.955213] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    0.955615] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    0.955991] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    0.956428] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2

GPU acceleration is working properly on windows sandbox info:

 WSL: 2.2.2.0
 kernel: 5.15.150.1-2
 WSLg: 1.0.61
 MSRDC: 1.2.5105
 Direct3D: 1.611.1-81528511
 DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
 Windows: 10.0.22631.3374
 distro: Ubuntu 22.04.3 LTS
 gpu: 7800x3d igpu
amd driver version: 23.40.27.01-240313a-401413C-AMD-Software-Adrenalin-Edition
wsh-01 commented 4 months ago

I have the same issue. does anyone have a solution for this?

JohnSmithToYou commented 3 months ago

Same here

CSZongzi commented 3 months ago

Same here

honeybadger26 commented 3 months ago

Same issue here. Would be nice to get this fixed since this and FS-Cache: Duplicate cookie detected cause the startup of WSL to be slow.

dmesg logs from Alpine:

[    0.704654] sd 0:0:0:2: [sdc] 4096-byte physical blocks
[    0.704975] sd 0:0:0:2: [sdc] Write Protect is off
[    0.705230] sd 0:0:0:2: [sdc] Mode Sense: 0f 00 00 00
[    0.705610] sd 0:0:0:2: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.707656] sd 0:0:0:2: [sdc] Attached SCSI disk
[    0.731817] EXT4-fs (sdc): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered. Quota mode: none.
[    1.089170] FS-Cache: Duplicate cookie detected
[    1.089510] FS-Cache: O-cookie c=0000000b [p=00000002 fl=222 nc=0 na=1]
[    1.089826] FS-Cache: O-cookie d=00000000c32a5c61{9P.session} n=000000002adfe9ce
[    1.090199] FS-Cache: O-key=[10] '34323934393337333938'
[    1.090511] FS-Cache: N-cookie c=0000000c [p=00000002 fl=2 nc=0 na=1]
[    1.090838] FS-Cache: N-cookie d=00000000c32a5c61{9P.session} n=000000001e8a64ee
[    1.091212] FS-Cache: N-key=[10] '34323934393337333938'
[    1.101315] WSL (1) ERROR: ConfigApplyWindowsLibPath:2537: open /etc/ld.so.conf.d/ld.wsl.conf
[    1.101319]  failed 2
[    1.105784] FS-Cache: Duplicate cookie detected
[    1.106185] FS-Cache: O-cookie c=0000000d [p=00000002 fl=222 nc=0 na=1]
[    1.106590] FS-Cache: O-cookie d=00000000c32a5c61{9P.session} n=00000000791852b8
[    1.107089] FS-Cache: O-key=[10] '34323934393337343030'
[    1.107462] FS-Cache: N-cookie c=0000000e [p=00000002 fl=2 nc=0 na=1]
[    1.107844] FS-Cache: N-cookie d=00000000c32a5c61{9P.session} n=00000000f798b43a
[    1.108352] FS-Cache: N-key=[10] '34323934393337343030'
[    1.258635] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[    1.269130] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.269611] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.270267] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x33e466b4ab4, max_idle_ns: 440795242338 ns
[    1.270275] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.272423] clocksource: Switched to clocksource tsc
[    1.272613] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.023448] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.145317] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.145822] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.146236] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.146635] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.147025] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.147419] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.147809] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.148199] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.148595] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.148986] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.149386] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.149776] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.150165] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.150610] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.420417] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Cyp9715 commented 3 months ago

In my case, if I call gnome-logs from wsl2 and run the GUI, I get that error.

# start gnome-logs
Jul 07 16:27:56 * systemd-resolved[166]: Clock change detected. Flushing caches.
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgvmb_send_create_sync_object: failed -75
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_create_sync_object: Ioctl failed: -75
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgvmb_send_create_sync_object: failed -75
Jul 07 16:28:05 * kernel: misc dxg: dxgk: dxgkio_create_sync_object: Ioctl failed: -75
Jul 07 16:28:31 * systemd-resolved[166]: Clock change detected. Flushing caches.

The gnome-logs window works, but there is a margin area different from the actual window size.

Sarisan commented 1 month ago

I wonder why is this still not fixed. All those issues are directly related: #9083 #9523 #9662 #10085 #11086 #11095 #11838 #11939. Intel iGPU doesn't exist to Microsoft?

smitty1eGH commented 2 days ago

Still an issue with 6.6.36.6-microsoft-standard-WSL2+.