Last verified: 2026-04-02 Hardware: AMD Ryzen AI MAX+ 395 / Radeon 8060S (gfx1151, RDNA 3.5) Windows driver: Adrenalin 26.3.1 WSL kernel: 6.6.87.2-microsoft-standard-WSL2 Distro: Ubuntu 24.04.4 LTS (Noble) ROCm: 7.2.0 (WSL runtime) / 7.2.1 (userspace tools)
-
Windows 11 with WSL2 enabled and up to date:
wsl --version wsl --update
-
AMD Adrenalin driver 26.3.1 or later from AMD Drivers
-
Windows SDK — install from Windows SDK. The default install path is:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\
- CMake >= 3.15
- GCC >= 11.4
- git
sudo apt update && sudo apt install -y cmake gcc g++ gitFollow the ROCm Installation Quick Start to add the repos and install ROCm.
Verify:
ls /opt/rocm-7.2.0/Ubuntu 24.04 ships ancient ROCm 5.7 system packages that shadow the ROCm 7.2 libraries. These must be removed:
sudo apt remove libhsa-runtime64-1 libhsakmt1Why: These install
libhsa-runtime64.so.1andlibhsakmt.so.1into/lib/x86_64-linux-gnu/, which takes precedence over/opt/rocm-7.2.0/lib/in the default library search path. The old runtime has no WSL/DXG support and will always fail with "ROCk module is NOT loaded."
The standard hsa-rocr package (from the ROCm repo) uses libdrm and talks to /dev/kfd directly — this doesn't work in WSL2. You need the WSL-specific package hsa-runtime-rocr4wsl-amdgpu, which has DXG support built in.
This package should be installed by default from the amdgpu repo (https://repo.radeon.com/amdgpu/30.30/ubuntu). Verify:
dpkg -l | grep rocr4wslExpected output:
ii hsa-runtime-rocr4wsl-amdgpu 25.30.13-2281980.24.04 amd64 AMD HSA Runtime for WSL
If missing, check that the amdgpu repo is configured in /etc/apt/sources.list.d/amdgpu.list:
deb [arch=amd64,i386 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/30.30/ubuntu noble main
Then:
sudo apt update && sudo apt install hsa-runtime-rocr4wsl-amdgpuNote: If
hsa-rocr(the standard runtime) is installed, it will conflict. Remove it first:sudo apt remove hsa-rocr
librocdxg is the bridge library that enables ROCm to communicate with the GPU via the Windows DXG interface in WSL2.
cd ~
git clone https://github.com/ROCm/librocdxg.git
cd librocdxg
git checkout developImportant: Use the
developbranch. As of 2026-04-01 it contains a fix (PR #12) for incorrect VRAM pool size reporting under WSL — without it, ROCm only sees memory up to your.wslconfiglimit instead of the full UMA allocation.
Build:
export win_sdk='/mnt/c/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/'
mkdir -p build && cd build
cmake .. -DWIN_SDK="${win_sdk}/shared"
make -j$(nproc)
sudo make installmake install places the new librocdxg.so.1.1.0 into /opt/rocm-7.2.0/lib/, but the existing symlink may still point to an older version (e.g. 1.1.1). Verify and fix:
ls -la /opt/rocm-7.2.0/lib/librocdxg.so*If librocdxg.so.1 does not point to librocdxg.so.1.1.0:
cd /opt/rocm-7.2.0/lib/
sudo ln -sf librocdxg.so.1.1.0 librocdxg.so.1
sudo ldconfigAdd to ~/.bashrc or ~/.zshrc:
# ROCm WSL2 configuration
export HSA_ENABLE_DXG_DETECTION=1
export LD_LIBRARY_PATH=/opt/rocm-7.2.0/lib:$LD_LIBRARY_PATH
export PATH=/opt/rocm-7.2.1/bin:/opt/rocm/bin:$PATHThen reload:
source ~/.zshrc # or ~/.bashrcWhat each variable does:
| Variable | Purpose |
|---|---|
HSA_ENABLE_DXG_DETECTION=1 |
Tells the HSA runtime to detect the GPU via /dev/dxg and load librocdxg |
LD_LIBRARY_PATH=/opt/rocm-7.2.0/lib:... |
Ensures the WSL HSA runtime (7.2.0) is found by ROCm 7.2.1 binaries |
PATH=... |
Makes rocminfo, hipcc, etc. available |
rocminfoExpected output includes:
Load librocdxg.so successully!
Load all DTIF APIs OK!
WSL environment detected.
...
Agent 2
Name: gfx1151
Marketing Name: AMD Radeon(TM) 8060S Graphics
Device Type: GPU
Compute Unit: 40
hipMallocManaged() returns hipErrorNotSupported on gfx1151. ROCm can only allocate in dedicated VRAM, not GTT/shared memory. This means ROCm sees ~60% less usable memory than Vulkan on the same hardware. No fix yet — tracked in ROCm#5944 and ROCm#6050.
Documented in ROCm#6034:
- Batch sizes at or below 2^13 can cause NaN
HEAD_DIM = 32causes NaN (use 64)- Network depth > 12 can crash
- Adam beta2 < 0.97 causes NaN
- These are cumulative — individually safe configs can NaN when combined
amd-smi, rocprofiler, and rocm-debugger do not work under WSL. Use Windows-side tools (Task Manager, Adrenalin) for GPU metrics.
ROCm-supported JAX is not enabled or validated under WSL.
# 19x attention speedup via AOTriton (experimental but confirmed by AMD)
export TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1
# Do NOT set PYTORCH_HIP_ALLOC_CONF — it crashes PyTorch on gfx1151When running ROCm containers under WSL2:
docker run -it \
--device=/dev/dxg \
-v /usr/lib/wsl/lib/libdxcore.so:/usr/lib/libdxcore.so \
-v /opt/rocm/lib/librocdxg.so:/usr/lib/librocdxg.so \
-e HSA_ENABLE_DXG_DETECTION=1 \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
--ipc=host \
--shm-size 8G \
rocm/pytorch:latest- librocdxg GitHub
- ROCm on Radeon/Ryzen docs
- ROCm#6022 — WSL2 VRAM pool size fix
- ROCm#6034 — gfx1151 bf16 bugs and AOTriton speedup
- ROCm#4952 — Original WSL2 support request for AI MAX+ 395