microsoft / microsoft/WSL

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

Open
#11,293 48 comments 41 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

GPU
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

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:
image


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

Diagnostic Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing with Windows 10.0.22631.3155, WSL 2.1.4.0, kernel 5.15.146.1-2, and Ubuntu 20.04, then inspect dmesg after wsl -d Ubuntu-20.04 and the reported dxg ioctl failures. Done requires identifying a verified resolution for GPU access, but the issue does not define a specific code change.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, ubuntu
Domain
operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.