[PR #873] [CLOSED] Fix first-kernel-launch crash on Windows (ROCm/Adrenalin WDDM startup race) #2887

Closed
opened 2026-11-04 02:03:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/873
Author: @unimo-chan
Created: 10/5/2026
Status: ❌ Closed

Base: main ← Head: fix-windows-wddm-crash


📝 Commits (1)

  • 6232b14 Fix first-kernel-launch crash on Windows (ROCm/Adrenalin WDDM startup race)

📊 Changes

2 files changed (+52 additions, -6 deletions)

View changed files

📝 src/core/device.cu (+39 -5)
📝 src/core/device_main.cpp (+13 -1)

📄 Description

Problem
On Windows with an AMD card (gfx1100, Adrenalin driver), the ROCm runtime can race the WDDM driver at startup. When it loses the race, hipMemGetInfo fails and the engine crashed at the first kernel launch (0xC0000005 in amdhip64_7.dll).

Fix

  • device.cu: mem_get_info() now retries hipMemGetInfo a few times (giving the driver time to settle); if it still fails it returns the error cleanly instead of crashing. The Windows/HIP path in device_info() uses this retrying mem_get_info instead of cudaMemGetInfo.
  • device_main.cpp: device init + selftest are wrapped in a retry loop (5 attempts) so a transient startup failure recovers.

Verified
selftest 5/5, server + chat OK, no first-kernel-launch crash on a RX 7900 XT / Adrenalin 32.0.32015.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/873 **Author:** [@unimo-chan](https://github.com/unimo-chan) **Created:** 10/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-windows-wddm-crash` --- ### 📝 Commits (1) - [`6232b14`](https://github.com/Niko1221/Strata/commit/6232b14d47c342030aac163ccb0cfee9d73e4c01) Fix first-kernel-launch crash on Windows (ROCm/Adrenalin WDDM startup race) ### 📊 Changes **2 files changed** (+52 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/core/device.cu` (+39 -5) 📝 `src/core/device_main.cpp` (+13 -1) </details> ### 📄 Description **Problem** On Windows with an AMD card (gfx1100, Adrenalin driver), the ROCm runtime can race the WDDM driver at startup. When it loses the race, `hipMemGetInfo` fails and the engine crashed at the first kernel launch (`0xC0000005` in `amdhip64_7.dll`). **Fix** - `device.cu`: `mem_get_info()` now retries `hipMemGetInfo` a few times (giving the driver time to settle); if it still fails it returns the error cleanly instead of crashing. The Windows/HIP path in `device_info()` uses this retrying `mem_get_info` instead of `cudaMemGetInfo`. - `device_main.cpp`: device init + selftest are wrapped in a retry loop (5 attempts) so a transient startup failure recovers. **Verified** selftest 5/5, server + chat OK, no first-kernel-launch crash on a RX 7900 XT / Adrenalin 32.0.32015. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:03:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2887
No description provided.