Skip to content

WSL2: dxgkio_query_adapter_info (-22/-2) blocks CUDA init even after driver 581.80 reinstall #13734

Closed

Description

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 Will this be Open Source? #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
      1. wsl.exe --status, wsl.exe --update
      2. Removed Ubuntu NVIDIA user-space packages; copied /usr/lib/wsl/lib/libcuda.so* into /usr/lib/x86_64-linux-gnu/
      3. Driver 581.80 repair/install on Windows, reboot
      4. HAGS toggle + registry (HwSchMode), reboot
      5. wsl.exe --shutdown between tests
      6. Reinstalled torch==2.9.1+cu128 in venv

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.

wsl2 errors.txt

Activity

  1. github-actions commented on Nov 17, 2025

    @github-actions
    Contributor

    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'.

  2. BGonnermann commented on Nov 17, 2025

    @BGonnermann
    Author
  3. github-actions commented on Nov 17, 2025

    @github-actions
    Contributor
    Diagnostic information
    .wslconfig found
    Detected appx version: 2.6.1.0
    
  4. hideyukn88 commented on Dec 3, 2025

    @hideyukn88
    Contributor

    @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?

    Image
  5. BGonnermann commented on Dec 13, 2025

    @BGonnermann
    Author

    Hideyuki Nagase (@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions