Skip to content

WSL2 下无法直通 AMD Radeon RX 7800 XT (RDNA3),lspci 无输出,/dev/dri 不存在。 #40464

@lin636

Description

@lin636

Windows Version

Windows 11 版本 10.0.26200.8037

WSL Version

WSL 2.6.3 + Ubuntu 24.04

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

6.6.87.2-1

Distro Version

Ubuntu 24.04.4 LTS

Other Software

No response

Repro Steps

  1. 全新安装 Windows 11 版本 26200.8037,开启 Hyper-V 和虚拟机平台。
  2. 在 BIOS 中启用 SVM、IOMMU、Above 4G Decoding、ReBAR。
  3. 安装 AMD Adrenalin 26.2.2 驱动(非 AI 捆绑包)。
  4. 安装 WSL 2.6.3,设置 WSL 2 为默认版本。
  5. 安装 Ubuntu 24.04:
    wsl --install -d Ubuntu-24.04
  6. 在 Ubuntu 中安装 ROCm 7.2(WSL 专用模式):
    wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb
    sudo apt install ./amdgpu-install_7.2.70200-1_all.deb
    sudo amdgpu-install --usecase=wsl,rocm --no-dkms
  7. 重启 WSL(wsl --shutdown)后重新进入 Ubuntu。
  8. 执行:
    lspci | grep -i vga
    ls /dev/dri/
    sudo dmesg | grep -i dxg
    rocminfo

Expected Behavior

  • lspci | grep VGA 应该显示 AMD Radeon RX 7800 XT
  • /dev/dri 目录应当存在,且包含 card0renderD128
  • rocminfo 正常输出 GPU 信息,不崩溃
  • python3 -c "import torch; print(torch.cuda.is_available())" 输出 True

Actual Behavior

  • lspci | grep VGA 无任何输出
  • /dev/dri 目录不存在
  • dmesg 显示错误:
    PCI: System does not support PCI
    misc dxg: dxgkio_query_adapter_info: Ioctl failed: -22
    misc dxg: dxgkio_query_adapter_info: Ioctl failed: -2

text

  • rocminfo 崩溃并报错:
    Assertion \props.EngineId.ui32.Major && "HSA_OVERRIDE_GFX_VERSION may be needed"' failed.`
  • python3 -c "import torch; print(torch.cuda.is_available())" 输出 False

Diagnostic Logs

Windows 版本
cmd /c ver
Microsoft Windows [版本 10.0.26200.8037]

WSL 版本
wsl --version
WSL 版本: 2.6.3.0
内核版本: 6.6.87.2-1
WSLg 版本: 1.0.66
MSRDC 版本: 1.2.5716
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1655.ge-release
Windows 版本: 10.0.26200.8037

Ubuntu 版本
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 24.04.4 LTS
Release: 24.04
Codename: noble

ROCm 安装方式
sudo amdgpu-install --usecase=wsl,rocm --no-dkms

dmesg 完整错误
[ 0.588472] PCI: System does not support PCI
[ 0.868579] AMD-Vi: AMD IOMMUv2 functionality not available on this system
[ 2.320100] misc dxg: dxgkio_query_adapter_info: Ioctl failed: -22
[ 2.324405] misc dxg: dxgkio_query_adapter_info: Ioctl failed: -2

环境变量已设置
echo $HSA_OVERRIDE_GFX_VERSION
11.0.0

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