WSL2: dxgkio_query_adapter_info (-22/-2) blocks CUDA init even after driver 581.80 reinstall
Ubuntu on WSL2 can’t initialize CUDA because the dxg kernel bridge repeatedly returns dxgkio_query_adapter_info: Ioctl failed: -22/-2 right after boot and again whenever PyTorch probes the GPU. Despite reinstalling NVIDIA driver 581.80, toggling Hardware‑accelerated GPU Scheduling, and relinking CUDA libs to /usr/lib/wsl/lib, torch.cuda.is_available() still hangs, indicating the dxg interface never comes up.
- Environment
- Windows 11 host, WSL2 (Ubuntu 22.04)
- NVIDIA driver 581.80 (clean reinstall + reboot)
- Kernel: Linux 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025
- PyTorch: torch==2.9.1+cu128; CUDA libs relinked to /usr/lib/wsl/lib
- Hardware-accelerated GPU Scheduling toggled off/on, rebooted
- Troubleshooting Done
- wsl.exe --status, wsl.exe --update
- Removed Ubuntu NVIDIA user-space packages; copied /usr/lib/wsl/lib/libcuda.so* into /usr/lib/x86_64-linux-gnu/
- Driver 581.80 repair/install on Windows, reboot
- HAGS toggle + registry (HwSchMode), reboot
- wsl.exe --shutdown between tests
- Reinstalled torch==2.9.1+cu128 in venv
- Troubleshooting Done
Key Logs/Commands
dmesg | grep -i dxg
[ 0.529547] hv_vmbus: registering driver dxgkrnl
[ 4.005108] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[ 4.007417] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4.007712] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4.008037] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4.008409] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
...
[ 42.049849] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 42.050176] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
cat /proc/version
Linux version 6.6.87.2-microsoft-standard-WSL2 (root@439a258ad544) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP
PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025
CUDA probe (hangs until Ctrl+C, no output):
python - <<'PY'
import torch
print(torch.version.cuda, torch.cuda.is_available())
if torch.cuda.is_available():
print(torch.cuda.get_device_name(0))
PY
Ive also included the whole error file. 513-line dmesg with dxg failures at lines 370, 459-495.
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 in Collect WSL logs for networking issues
Once completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
Diagnostic information
.wslconfig found
Detected appx version: 2.6.1.0
@BrennanNVA, I don't have that particular version of NVIDIA driver, but the same scenario is working for me with same Ubuntu and WSL kernel version. To rule out other factors, have you tried with different (aka older) version of NVIDIA driver?
@hideyukn88 Thats exactly what I did and i should have closed this. I wasnt as informed on how to use WSL as I am now. What I did was match CUDA from pytorch to my current GPU. Once I found a stable version for my GPU I merged that onto my workspace.
The current combo thats working for me on my 5070Ti and 6000 is:
NVIDIA Driver | 591.44 -- | -- CUDA (Driver/Runtime) | 13.1 NVCC (Compiler) | 12.8.93 PyTorch | 2.9.1+cu128 PyTorch CUDA Build | 12.8 cuDNN | 9.1.0.02