WSL: GPU resource cannot be used in wsl2: misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22/-2
Windows Version
10.0.22631.3155
WSL Version
2.1.4.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
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:
For my xgboost model running: https://discuss.xgboost.ai/t/xgboost-using-gpu-in-wsl-environment-doesnt-work/3539
Diagnostic Logs
No response
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 25
- Comments: 35
I wonder why is this still not fixed. All those issues are directly related: #9083 #9523 #9662 #10085 #11086 #11095 #11208 #11838 #11939. Intel iGPU doesn’t exist to Microsoft?
I think the current implementation on Kernel 5.15 and up is broken. I’ve tested on 6.6.36 and even on 6.6.63 by pulling latest updates from upstream stable branch and doesn’t seem to be working at all.
Or, if there’s something missing on the host side it could be stated somewhere but none that I could find.
It would be very good if someone working directly on this driver could follow up on this.
With so many people experiencing this issue it’s pretty disappointing that none of the devs have even given an explanation, let alone are working on a fix.
I use WSL often and the slow startup times are one of the reasons that I’m considering just ditching Windows altogether.
I have tested with another Distro within WSL2 - OpenSuse Leap and I found out this problem does not occur with Leap.
More info on my
wsl --version:hitting this on a clean install of windows 11 and WSL, the errors occur as soon as the wsl distro is started:
GPU acceleration is working properly on windows sandbox info:
There is a coping strategy to the slow loading problem, although it is not a fundamental solution. You can set a timeout.
I had recently upgraded from 22.04 to 24.04 and ran into hanging problems. During diagnosis, I ran into the reported errors. Your comment reminded me I had enabled it. This eliminates the logs.
I also had
autoMemoryReclaim=gradualset, which is experimental. I’ve disabled that hoping it eliminates the hanging.After disabling
systemdit’s definitely faster to wake up 😆The only workaround I was able to find thus far was to disable systemd by commenting out the following line at /etc/wsl.conf:
Then in PowerShell, shutting down the distro then launching it back again without systemd this time.
More info on my
wsl --versionafterwsl --updateandwsl --update --pre-release:Obs.: I am using Debian distro. Previously I was using systemd with https://github.com/DamionGans/ubuntu-wsl2-systemd-script.