WSL icon indicating copy to clipboard operation
WSL copied to clipboard

[BUG] WSL2 CUDA sequence preceded by dxgkio make_resident -12 ends in host NVIDIA PCIe SRAM ECC/TDR and display loss

Open kutaelee opened this issue 4 months ago • 16 comments

Windows Version

Windows 11 version 25H2, build 26200.8875

WSL Version

  • WSL: 2.7.10.0
  • Kernel: 6.18.33.2-2
  • WSLg: 1.0.73.2
  • Direct3D: 1.611.1-81528511
  • DXCore: 10.0.26100.1-240331-1435.ge-release

Are you using WSL 1 or WSL 2?

WSL 2

Kernel Version

6.18.33.2-2

Distro Version

Ubuntu under WSL2

Other Software

  • NVIDIA GeForce RTX 5090, 32 GB
  • NVIDIA Windows driver 610.62
  • Python/PyTorch CUDA workload through AI Toolkit
  • Host-side GPU workload scheduler serializing all model-loading jobs
  • Models and datasets on mounted NTFS volumes; AI Toolkit source and venv on the WSL ext4 filesystem

Repro Steps

This is a high-risk, currently non-deterministic failure that removes the physical display, so I have not intentionally reproduced it after recovery.

Observed sequence on 2026-08-01 KST:

  1. Run a large FLUX.2 Klein Base 9B BF16 probe under WSL2 from about 14:06:57 to 15:02:34.
  2. WSL kernel log records dxgkio_make_resident: Ioctl failed: -12 at 14:10:22 and again at 15:02:02.
  3. Run a serialized qfloat8 rank-64 LoRA training workload. The first subject completes successfully in 97m59s with peak host-reported GPU usage about 19.3 GB.
  4. Start the matching second-subject job with the same model/training contract.
  5. During model initialization, at 16:46:24 KST, Windows begins a 153.851-second NVIDIA driver/TDR burst.
  6. The physical display reports No Signal, and nvidia-smi returns exit code 6: GPU is lost; reboot required.

The earlier make_resident -12 messages are 1h44m before the host driver crash, so I am reporting them as possible precursor state, not claiming they were simultaneous or the direct trigger. This differs from issue #41176, where every userspace failure coincided with make_resident -12.

Expected Behavior

A failed GPU residency request or resource exhaustion should fail the requesting CUDA process without corrupting the shared Windows display/GPU state. A later WSL CUDA model load should not cause the Windows NVIDIA driver to enter a TDR storm or remove the physical display.

Actual Behavior

Windows System log contained:

  • 60 x nvlddmkm Event ID 14
  • 709 x Event ID 153
  • 4 x PCIE P2PREQ, Uncorrectable SRAM Error
  • 4 x corresponding An uncorrectable ECC error has been detected on GPU in the PCIE P2PREQ unit
  • 4 x PCIE REORDER, Uncorrectable SRAM Error
  • 4 x corresponding REORDER ECC messages
  • 708 x GpuRcReset TDR occurred on GPUID:100
  • 1 x UCode reset

The event burst ran from 16:46:24.836 to 16:48:58.688 KST. Host-reported VRAM use at failure was about 9.3 GB, so this was not an ordinary CUDA device-memory OOM. Windows kernel event recording effectively stopped during the failure, the physical monitor lost signal, and only a Windows reboot restored the GPU.

After reboot:

  • Windows and WSL again detected the RTX 5090 at PCI 01:00.0, PCIe Gen4 x16.
  • A controlled 30-second BF16 CUDA preflight sustained 100% utilization and approximately 450 W, remained finite, and produced no new nvlddmkm or WHEA event.
  • The exact failed training configuration passed transformer/text-encoder quantization, latent caching, and the previous failure point.

This recovery makes persistent application configuration failure less likely and suggests accumulated WSL GPU-PV/WDDM/NVIDIA state may be involved. However, the direct PCIe SRAM/ECC payload also means a driver, firmware, power, PCIe, or hardware fault remains possible.

Diagnostic Logs

A local incident bundle has been preserved with:

  • Windows System/Application event exports and normalized event JSON
  • raw nvlddmkm payload counts
  • WSL kernel excerpts
  • GPU scheduler job/telemetry records
  • post-reboot health and CUDA preflight results
  • environment/version inventory

Bundle name: v277_gpu_lost_incident_evidence_20260801.zip
SHA-256: 1a8bc18376df25df10f5281adc0fd33739bafec56e452928c6640443df2bc290

I have not attached the full bundle publicly because Windows/WSL diagnostic exports may contain machine-specific paths. I can provide a sanitized subset or email the full WSL diagnostics to [email protected] after an issue number is assigned.

Because the event was not intentionally reproduced after recovery, an incident-time collect-wsl-logs.ps1 ETL was not running. Please advise which trace providers should be armed in a bounded circular capture for a natural recurrence; intentionally reproducing the fault risks another physical display loss.

kutaelee avatar Aug 01 '26 08:08 kutaelee

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-wsl-logs.ps1 -LogProfile networking instead, 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'.

github-actions[bot] avatar Aug 01 '26 08:08 github-actions[bot]

Official collect-wsl-logs.ps1 output has been collected after the mandatory Windows reboot, while the exact training retry is healthy. This is a post-reboot baseline, not an incident-time ETL; the original fault was not intentionally reproduced because it removed the physical display.

  • File: WslLogs-2026-08-01_17-47-17.tar.gz
  • Bytes: 1,283,985
  • SHA-256: e6fda7c2041e5145f61c2dd265b9545e567c951444dc96a8f5083d8600e84db8
  • Collector script SHA-256: 74dbd7c3d882cf963b71a2e57d54731fd6d4ce7c1f089ec9d96d776a1b8a6b96

I will email this archive to [email protected] with this issue number and comment link, then reply with /emailed-logs as requested.

kutaelee avatar Aug 01 '26 08:08 kutaelee

Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

github-actions[bot] avatar Aug 01 '26 08:08 github-actions[bot]

/emailed-logs

kutaelee avatar Aug 01 '26 08:08 kutaelee

Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

github-actions[bot] avatar Aug 01 '26 08:08 github-actions[bot]

Second recurrence update (2026-08-01 18:35 KST):

  • FLUX.2 Klein 9B LoRA training had completed successfully at 18:33:18.
  • Last healthy GPUQ sample at 18:36:09: 2,733 MiB, 2% utilization, 41 C, 38.12 W, PCIe Gen1 x16.
  • At 18:36:19, nvidia-smi exited 6: GPU is lost. Reboot the system.
  • Windows then bugchecked 0x116 VIDEO_TDR_FAILURE; the immediate next boot bugchecked 0x7F, parameter 1 0x8 DOUBLE_FAULT (second dump creation failed).
  • The intended ComfyUI output directory was never created and no new prompt/model-load appears in its log, so this happened before the next generation workload began.

WinDbg !analyze -v of the successful first minidump:

  • IMAGE_NAME: nvlddmkm.sys
  • FAILURE_BUCKET_ID: 0x116_IMAGE_nvlddmkm.sys
  • FAILURE_ID_HASH: {c89bfe8c-ed39-f658-ef27-f2898997fdbd}
  • stack includes dxgkrnl!TdrBugcheckOnTimeout and dxgkrnl!ADAPTER_RENDER::Reset
  • Arg3 0xC000009A STATUS_INSUFFICIENT_RESOURCES

The new evidence archive (minidump, WinDbg output, EVTX/JSON, GPUQ telemetry and workload logs, DXDiag/system data, SHA-256 manifest) was emailed to [email protected] in the existing microsoft/WSL#41224 thread.

Archive SHA-256: a33bed42b37efbcbd136732b8e99e1af47c296e16cd58c72edad297844b54966
Minidump SHA-256: 998dc6730c31f15a8a907f40f938007519658e1bf8cd3ec22528e8db0cc016d6
WER report ID: f02fb1b3-5784-4aee-9f29-866ffd04dd6c
NVIDIA bug: 6546168

Containment applied: Windows PCIe Link State Power Management disabled, GPUQ scheduled startup disabled, no GPU workload restart/reproduction.

/emailed-logs

kutaelee avatar Aug 01 '26 10:08 kutaelee

Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

github-actions[bot] avatar Aug 01 '26 10:08 github-actions[bot]

Cross-vendor public reference (2026-08-01 KST):

I published the sanitized NVIDIA technical report for the same RTX 5090 GPU-loss/TDR incidents here:

https://forums.developer.nvidia.com/t/bug-report-rtx-5090-gpu-lost-0x116-tdr-and-failed-warm-reboot-after-pcie-sram-ecc-events-windows-11-610-62/378873

The report separates confirmed host TDR evidence from unresolved fault domains. It includes the prior dxgkio_make_resident: -12 observations as possible precursor/state-contributor evidence only; it does not claim WSL2 GPU-PV was the direct or sole cause. Original WSL and host diagnostic bundles remain in the previously emailed private submissions.

NVIDIA tracking: Bug 6546168.

kutaelee avatar Aug 01 '26 12:08 kutaelee

Additional recurrence with a narrowed, repeatable trigger (2026-08-02 KST)

This is a third incident and a near-direct recurrence of the first active-load failure. I am not intentionally reproducing it again because the previous occurrence escalated to physical display loss, 0x116, and a failed warm reboot.

Reproduction matrix

  • v277: second WSL AI Toolkit FLUX.2 Klein Base 9B qfloat8/rank64 model load stopped at 25/32 transformer blocks.
  • v278: the same groom workload completed as the first heavy job after reboot, then the GPU was lost about 181 seconds later while almost idle, followed by 0x116 VIDEO_TDR_FAILURE and a next-boot 0x7F double fault.
  • v288: second WSL AI Toolkit FLUX.2 Klein Base 9B qfloat8/rank64 model load stopped at 23/32 transformer blocks.

v277 and v288 surfaced from exactly the same statement and stack:

toolkit/util/quantize.py:414
block.to(base_model.device_torch, dtype=base_model.torch_dtype, non_blocking=True)
torch.AcceleratorError: CUDA error: unknown error

The loop moves each of 32 transformer blocks CPU -> CUDA in BF16, quantizes to qfloat8, then returns it to CPU. v277 failed before the 26th block and v288 before the 24th, after approximately 12.6-13.4 GiB of cumulative block transfer. Dataset loading and training forward had not started, so the dataset, target steps, LoRA rank, and AI Toolkit PR #837 residual clamp are not causal for this failure.

v288 state immediately before failure

  • Peak observed VRAM during the failed model load: 6,171 MiB
  • Peak power in the incident interval: 93.5 W
  • Peak temperature: 44 C
  • Last relevant normal sample near the driver event: 44.14 W, 38 C, 3% utilization, PCIe Gen4 x16
  • Configured power limit: 450 W

This was not a CUDA OOM, sustained thermal event, or full-power PSU event.

Exact Windows event relationship

The unique (EventID, payload) sets in v277 and v288 are identical (28/28). Twenty-seven payload counts are also identical; only the number of GpuRcReset TDR records differs (708 vs 516).

Both contain:

  • Event 14 total: 60
  • PCIE P2PREQ, Uncorrectable SRAM Error: 4
  • matching P2PREQ uncorrectable ECC payload: 4
  • PCIE REORDER, Uncorrectable SRAM Error: 4
  • matching REORDER uncorrectable ECC payload: 4
  • UCodeReset TDR: 1
  • the same CMDre register payload family

In v288, the first Event 14 (CMDre...) occurred at 00:08:26.633 KST and the Event 153 reset storm began 0.214 s later. The first explicit REORDER SRAM payload appeared 18.3 s after the first Event 14; P2PREQ appeared 27.4 s after it. Therefore the SRAM/ECC payload is real, but the retained public events do not prove whether it is the primary syndrome or a consequence exposed during repeated reset failure.

There was no incident-time dxgkio_make_resident -12 entry in v288. An earlier-boot dxgkrnl field-spanning-write warning exists, but I am not claiming it caused this incident.

Requests to the WSL/DxgKrnl team

  1. Please provide or identify a bounded WPR/ETW profile that captures the WSL GPU-PV/DxgKrnl residency, context teardown/reload, and reset path. The public collect-wsl-logs.ps1 script does not expose a GPU-specific LogProfile, and postmortem collection is insufficient for this transition.
  2. Please assess whether the second-process block H2D/quantize/D2H lifecycle can leave stale GPU-PV residency or synchronization state that prevents host KMD/GSP recovery.
  3. Please correlate this with #41176 without assuming they are identical; v288 has no incident-time make_resident -12 evidence.
  4. Please confirm whether microsoft/WSL2-Linux-Kernel commit 1dda0bd6b031fec40afb3c6c9d59b8b89fd9e8db is only a FORTIFY layout-warning cleanup or whether it changes runtime GPU-PV behavior, and whether it will be included in a packaged WSL kernel.
  5. Please coordinate with NVIDIA on whether a guest allocation/context failure can be contained without physical display loss and a host reset storm.

Local containment now treats this FLUX.2 Klein9B qfloat8 workload family as one heavy WSL lifecycle per Windows boot, stops NVIDIA queries after terminal process detection, and latches the first NVIDIA timeout/GPU-lost result without a second query. AI Toolkit has also been locally changed to optionally quantize these blocks on CPU, eliminating the repeated BF16 H2D/D2H quantization cycle. These are mitigations, not proof of the lower-level root cause.

Evidence package for this recurrence:

  • local archive: v288_gpu_lost_handoff_incident_20260802_0008_v2.zip
  • SHA-256: 4503076d66f1ea80200b7532fa1e65d3126b0e2bb2a454de8e4e2556b0b6bc44

Please tell me which new ETL/dump capture you want before any vendor-approved reproduction attempt.

kutaelee avatar Aug 01 '26 18:08 kutaelee

Hi @kutaelee , I went through the same pain as you did. my setup is almost identical to yours, and I encountered tons of exact same errors (nvlddmkm 153/14, uncorrectable SRAM error in the PCIE reorder / P2PREQ unit). My GPU would constantly fall off the bus for no reason. From my hundreds of hours of experimenting, these error signatures typically come from power transitions. My theory is that the Super Flower 1200W/1300W models are either faulty or simply don't have enough head room to handle these massive power transitions properly. I have a Super Flower Leadex VII XG 1300W. I haven't had a crash in two days after replacing it with a Corsair HX1500i.

Personally, I spent countless of hours troubleshooting, trying everything I could find online. At first I thought I got a faulty GPU unit, so I went for RMA and got a replacement, which also crashes. Then I bought a new MSI Suprim 5090 which also exhibit the same crash pattern. I was truly lost because the display loss happens almost entirely randomly, some times during heavy use, other times during idle, though most occurred after a significant power transition (e.g. idle to heavy load, or the inverse). The cards I got were usually stable for some time, then the nightmare began.

I was using Super Flower Leadex VII XG 1300W 80 Gold. I never doubted the PSU because Super Flower is a highly regarded brand. Yesterday, more out of desperation than anything else, I bought a Corsair HX1500i, figuring I had nothing to lose to replace the PSU as I've tried anything else I could. I even bought replacement motherboard and CPU thinking if the issue was still not resolved, I would replace the entire PC. To my surprise, since I've replaced the PSU, I haven't had black screen / crash / nvlddmkm in two days. I know it's still a short period, but previously I had almost 10+ black screen crashes per day, some times as frequent as 5 crashes per hour, so being stable for 2 days is a significant shift in statistics.

My theory is that this is caused by boosting algorithm of the 9950X3D together with a powerful GPU. The PSU has to be extremely capable in handling the transient current spikes. It is also better to give the system more head room by choosing a higher wattage one (e.g. >= 1500W). In my case, the crash happens usually after a power transition (such as heavy load to idle, or idle to heavy load) - the GPU would fall off the bus in a few minutes after the transition. A more powerful PSU has better headroom to handle these cases.

I hope this could help someone who is going through the same pain that I've been through.

Best of luck, David

runningdavid avatar Aug 14 '26 04:08 runningdavid

@runningdavid Thank you for sharing your experience. Our hardware configuration and the P2PREQ/REORDER SRAM error symptoms are very similar.

Following NVIDIA's request, I updated the Windows host driver from 610.62 to 610.74 before replacing any hardware. I then repeated the same WSL AI Toolkit qfloat8 second-load sequence that had failed on 610.62, using two separate processes, and also tested idle-to-full-load power transitions up to about 575 W. Both tests completed without GPU loss, TDR, display loss, or new nvlddmkm/WHEA events.

So, on my system, the problem currently appears to have been resolved by the 610.74 driver update. I will continue normal use and update this issue if it recurs. Thank you again for taking the time to share what worked on your system.

kutaelee avatar Aug 14 '26 06:08 kutaelee

I am in awe of your diligent investigation and reporting skillz @kutaelee ! 👏

Unfortunately, I'm also been experiencing this issue with ComfyUI workflows on an HP Omen 45L (Intel Core Ultra9 285K + 64GB DDR5 RAM + NVIDIA GeForce RTX 5090 32GB DDR7 VRAM). Running Windows 11 Pro. I've tested it on a new ComfyUI v0.34.6 install with PyTorch v2.12.1+cu130.

I've managed to stop Windows rebooting when it happens by turning off HAGS. But I have to quit Comfy, then disable the 5090 in Device Manager and re-enable it again, and then run ComfyUI again, for it to detect the 5090 GPU again. (Yes, I guess just restarting Windows could be faster :) )

I'm actually on the latest Nvidia Studio Driver, v.616.56, installed as a "clean installation" after using DDU to remove any previous drivers for the 5090 in Windows safe mode. So, the fix that was deployed in 610.74 should be in 616.56, right?

The PSU in the Omen 45L is an "1200 W 80 Plus Gold certified ATX power supply".

Is my only option here to upgrade my PSU? (The PC is still under its first year warranty, but I suspect I'll have a hard time justifying to HP that this behavior is a "hardware failure" under their warranty, given the specific scenario in which it occurs.)

raffetazarius avatar Sep 09 '26 00:09 raffetazarius

@raffetazarius There could be many reasons to this problem, including a faulty GPU card. However replacing the PSU is cheap and easy so worth ruling that out first. DDU is the first step if it doesn't fix the issue then most likely there's a hardware fault.

runningdavid avatar Sep 09 '26 00:09 runningdavid

@raffetazarius Thanks for sharing this. One potentially useful piece of context from my NVIDIA bug report (6546168):

After I retested the original failure case on 610.74 and could no longer reproduce it, NVIDIA told me:

“This largely confirms our assumption that the issue is fixed in driver version 610.74.”

They also said they were still reviewing what details about the fix could be shared externally.

So NVIDIA did appear to have a specific fix in mind for the issue I reported, rather than 610.74 simply being a generic “try the latest driver” recommendation.

That said, I don't have any information confirming that the exact fix from 610.74 is necessarily present unchanged in 616.56, nor can I confirm that the failure you're seeing is the same underlying issue as mine.

I just wanted to share the NVIDIA-side context in case it's useful. I don't have enough information to recommend replacing the PSU or other hardware based on this alone.

kutaelee avatar Sep 09 '26 02:09 kutaelee

Thanks for sharing this detailed context @kutaelee . In my case, I upgraded to 610.74 but it did not help, so later on I replaced the PSU. I believe it is worthwhile to try installing stable drivers first.

With this new info my recommendation for @raffetazarius would be DDU clean install the 610.74 first.

I've managed to stop Windows rebooting when it happens by turning off HAGS

There's a possibility that the latest driver conflicts with Windows HAGS setting, causing driver to stop responding to Windows and GPU to fall off the bus. It could be the reason why turning off HAGS fixed it. Using an older version of the stable driver would likely help.

Hopefully you don't have to touch hardware to fix the issue.

runningdavid avatar Sep 09 '26 02:09 runningdavid

For anyone else coming across this, switching from the latest Studio Driver (616.56) to the Game Ready Driver (616.64) resolved these GPU loss issues for me. Seems like Nvidia only pushed the “fix” that went into 610.74 to the Game Ready driver channel, up until and including the 616.64 Game Ready release anyway. I mistakenly thought the Studio driver was supposed to be more stable and reliable for Creators.

I see that 616.92 has released today (Studio and Game Ready channels), but I have not updated to that yet to know if the Studio Driver is patched with the "fix" that went into 610.74.

raffetazarius avatar Sep 10 '26 14:09 raffetazarius