WSL2 / dxgkrnl: GPU virtual address & memory drift under ephemeral CUDA process churn (Blackwell ARM64)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- linux
Línea de trabajo
Start by reviewing the WSL kernel's dxgkrnl GPU memory and process teardown paths; the issue provides a standalone CUDA reproducer and commands for tracking free VRAM and guest processes. Run repeated allocation and abrupt-exit cycles, then compare memory and dxg ioctl logs. Done means allocations are reclaimed after process exit without requiring wsl.exe --shutdown.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Windows Version
Microsoft Windows 11 ARM64 (Build 26100+)
WSL Version
WSL 2
Are you using WSL 1, WSL 2, or WSLC?
- WSL 2
Kernel Version
6.18.58.1-microsoft-standard-WSL2 (aarch64)
Distro Version
Ubuntu 26.04.1 LTS (Resolute Raccoon)
Other Software
- GPU: NVIDIA RTX Spark N1X (6144-core Blackwell RTX GPU, GB10, sm_121a)
- NVIDIA Windows Display Driver: 621.14 (KMD)
- WSL2 NVIDIA Driver: libcuda.so.1 (CUDA UMD 13.5, nvidia-smi 620.70.03)
- Application: llama.cpp CUDA build sm_121a, PyTorch / CUDA 13.x
Repro Steps
- On a WSL2 instance with an NVIDIA GPU (reproduced on unified memory Blackwell ARM64), record initial baseline free VRAM:
nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits - Run an ephemeral CUDA process that allocates GPU memory and unified memory buffers (e.g.
llama-serveror a standalone CUDA C program allocating 4GB device + 512MB UVM). - Terminate the process abruptly via SIGTERM or
_exit(0)without an explicit synchronouscudaDeviceReset(). - Observe free VRAM after process termination and zero surviving guest processes.
- Repeat 10-20 times.
Minimal standalone C reproducer (cuda_dirty_exit.cu):
// Compile with: nvcc -O2 -o cuda_dirty_exit cuda_dirty_exit.cu
#include <cuda_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char** argv) {
void* d_ptr = NULL;
size_t bytes = 1024ULL * 1024 * 1024 * 4; // 4 GB GPU device allocation
cudaError_t err = cudaMalloc(&d_ptr, bytes);
if (err != cudaSuccess) return 1;
void* uvm_ptr = NULL;
size_t uvm_bytes = 1024ULL * 1024 * 512; // 512 MB Unified Memory
err = cudaMallocManaged(&uvm_ptr, uvm_bytes, cudaMemAttachGlobal);
if (err != cudaSuccess) return 1;
cudaMemset(d_ptr, 0xAA, 1024 * 1024 * 64);
_exit(0); // Exit without cudaDeviceReset() to replicate server termination
}
Expected Behavior
When an ephemeral CUDA process terminates, all paravirtualized GPU virtual address mappings, page tables, and WDDM memory residency allocations should be synchronously reclaimed by dxgkrnl and host WDDM, restoring free VRAM back to the initial baseline.
Actual Behavior
- After 10 cycles, baseline free VRAM degraded from 2,352 MiB down to 2,233 MiB (a permanent net loss of 127 MiB, peaking at 190 MiB cumulative unreturned drift), despite zero surviving processes in
pgrepor/proc/[0-9]*/cmdline. - Under extended lifecycle sweeps (e.g. automated model autotuning / benchmarking), this degradation compounds at ~32 MiB unreturned per spawn until large contiguous allocations fail with
cudaErrorMemoryAllocationand the VM becomes unresponsive. dmesgaccumulates thousands ofmisc dxg: dxgk: dxgkio_escape: Ioctl failed: -22entries.- The only recovery boundary is
wsl.exe --shutdownfrom Windows; guest-side process kills, dropping caches, or running clean-up scripts recover 0 bytes.
Diagnostic Logs
Empirical run log across 10 ungraceful process terminations:
=== WSL2 GPU Virtual Address / Memory Drift Reproducer ===
Kernel: 6.18.58.1-microsoft-standard-WSL2
GPU: NVIDIA RTX Spark N1X (6144-core Blackwell RTX GPU)
Driver / CUDA UMD: 621.14
Initial Baseline VRAM: 2352 MiB free
---------------------------------------------------------
Cycle 01: Free=2192 MiB | Delta=+166 MiB | Cumulative Drift=166 MiB
Cycle 02: Free=2217 MiB | Delta=-25 MiB | Cumulative Drift=141 MiB
Cycle 03: Free=2285 MiB | Delta=-68 MiB | Cumulative Drift=73 MiB
Cycle 04: Free=2329 MiB | Delta=-44 MiB | Cumulative Drift=29 MiB
Cycle 05: Free=2325 MiB | Delta=+4 MiB | Cumulative Drift=33 MiB
Cycle 06: Free=2339 MiB | Delta=-14 MiB | Cumulative Drift=19 MiB
Cycle 07: Free=2259 MiB | Delta=+80 MiB | Cumulative Drift=99 MiB
Cycle 08: Free=2168 MiB | Delta=+91 MiB | Cumulative Drift=190 MiB
Cycle 09: Free=2176 MiB | Delta=-8 MiB | Cumulative Drift=182 MiB
Cycle 10: Free=2233 MiB | Delta=-57 MiB | Cumulative Drift=125 MiB
---------------------------------------------------------
Final Baseline Free: 2233 MiB
Total Drift across 10 cycles: 127 MiB unreturned
Active Linux Processes: 0
- Lenguaje dominante
- C++
- Estrellas
- 34.4k
- Forks
- 1.9k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 166
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/WSL
-
feature wsl2
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
microsoft/WSL#42306 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/WSL#42114 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
feature kernel wsl2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/WSL#41107 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
feature kernel
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/WSL#41054 · 9 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
feature GPU
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
microsoft/WSL#13592 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/WSL
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
HarperFast/rocksdb-js#1131 ·
Los mantenedores suelen responder en 1 día
-
area/daemon bug good first issue platform/linux priority/p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ToshiNamura/Deimos#5 ·
-
needs-format
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Niko1221/Strata#6251 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
[Bug]: NP 管理器文件编辑器里删除键无效Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
metasequoiaime/msime#11666 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
patrick-hudson/put.gd-desktop#1679 · 1 comentario ·
Los mantenedores suelen responder en 1 día