D3D12.X: make the compute heartbeat opt-in under Wine #2916

Open
github-bot wants to merge 1 commit from github-bot/gh-2916 into amd-dev AGit
Owner

@⁠gustavsi on GitHub · 2026-11-26 23:09 UTC · original
gustavsi:wine/amd-gpu-awake-optin → amd-dev · +18 −13 · 2 files · 1 commits · open

The AMD keep-awake compute queue (gpu_awake.rs) auto-starts whenever vendor_id == 0x1002 and submits compute dispatches throughout active rendering. Under Wine on RADV (RX 9060 XT), those background compute dispatches contend with active frame presentation and cut frame output by ~40%.

Making Mode::Auto require !under_wine() keeps the native Windows AMD default untouched, leaves XCL_GPU_AWAKE=1 available as an explicit opt-in under Wine, and restores full presentation throughput on RADV without needing an environment override.

Opened as a Draft PR targeting amd-dev because amd-dev (bf7c82ee) does not yet carry the Wine vtable guards (#867/#2477), so a standalone scripts/smoke.ps1 pair on b775ff85 cannot be captured on Linux/Wine here; native Windows/AMD verification is needed before marking ready.

What is in it

  • crates/xcl/src/hle/d3d12x/gpu_awake.rs: pass crate::util::under_wine() into should_enable(), disabling Mode::Auto under Wine while preserving Mode::On / Mode::Off and native Windows AMD auto-enable; expand env_mode_parsing_and_amd_auto_enable to cover both under_wine = false and under_wine = true.
  • README.md: document that the AMD keep-awake compute queue auto-starts on native Windows and is opt-in (XCL_GPU_AWAKE=1) under Wine.

Tested

  • Hardware: AMD Radeon RX 9060 XT 16 GiB (RADV, Mesa 26.2.7), Linux (Fedora 44), GE-Proton11-14, DXC 1.9.2609.5, rustc (x86_64-pc-windows-msvc cross-build, release).
  • cargo build --release -p xcl --bin xcl on b775ff85: clean build (Finished release profile in 51.44s).
  • cargo test --release -p xcl --lib hle::d3d12x::gpu_awake:: (under GE-Proton11-14) on b775ff85: 2 passed, 0 failed, 0 ignored (env_mode_parsing_and_amd_auto_enable, heartbeat_hlsl_compiles_with_d3dcompile; 0 SKIPPED).
  • Retail A/B measurement on the Wine-enabled amd-dev integration tree (ae20c0a1, identical executable, RX 9060 XT RADV, MemoryMax=24G, 60 s capped runs): changing only XCL_GPU_AWAKE=0 raised frames shown from 618 to 1,025 (+65.9%, reaching 57–60 presents per 2 s during the intro).

Not tested

  • Native Windows (AMD, NVIDIA, or Intel) and scripts/smoke.ps1 directly on b775ff85 (cannot boot under Wine without #867/#2477).
  • Full workspace test suite on b775ff85.

AI use

  • T3 Code, Codex (gpt-6.2-astra) measured the XCL_GPU_AWAKE=0 A/B improvement on this machine and authored the commit (README.md and gpu_awake.rs).
  • T3 Code, Antigravity (Gemini 4 Neon) rebased the commit cleanly onto amd-dev (bf7c82ee -> b775ff85), built and ran the gpu_awake:: tests under Proton on this machine, and updated this PR description.
**@⁠gustavsi** on GitHub · 2026-11-26 23:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/2916) `gustavsi:wine/amd-gpu-awake-optin` → `amd-dev` · +18 −13 · 2 files · 1 commits · open The AMD keep-awake compute queue (`gpu_awake.rs`) auto-starts whenever `vendor_id == 0x1002` and submits compute dispatches throughout active rendering. Under Wine on RADV (RX 9060 XT), those background compute dispatches contend with active frame presentation and cut frame output by ~40%. Making `Mode::Auto` require `!under_wine()` keeps the native Windows AMD default untouched, leaves `XCL_GPU_AWAKE=1` available as an explicit opt-in under Wine, and restores full presentation throughput on RADV without needing an environment override. Opened as a **Draft PR** targeting `amd-dev` because `amd-dev` (`bf7c82ee`) does not yet carry the Wine vtable guards (`#867`/`#2477`), so a standalone `scripts/smoke.ps1` pair on `b775ff85` cannot be captured on Linux/Wine here; native Windows/AMD verification is needed before marking ready. **What is in it** - `crates/xcl/src/hle/d3d12x/gpu_awake.rs`: pass `crate::util::under_wine()` into `should_enable()`, disabling `Mode::Auto` under Wine while preserving `Mode::On` / `Mode::Off` and native Windows AMD auto-enable; expand `env_mode_parsing_and_amd_auto_enable` to cover both `under_wine = false` and `under_wine = true`. - `README.md`: document that the AMD keep-awake compute queue auto-starts on native Windows and is opt-in (`XCL_GPU_AWAKE=1`) under Wine. **Tested** - Hardware: AMD Radeon RX 9060 XT 16 GiB (RADV, Mesa 26.2.7), Linux (Fedora 44), `GE-Proton11-14`, DXC `1.9.2609.5`, `rustc` (`x86_64-pc-windows-msvc` cross-build, release). - `cargo build --release -p xcl --bin xcl` on `b775ff85`: clean build (`Finished release profile in 51.44s`). - `cargo test --release -p xcl --lib hle::d3d12x::gpu_awake::` (under `GE-Proton11-14`) on `b775ff85`: **2 passed, 0 failed, 0 ignored** (`env_mode_parsing_and_amd_auto_enable`, `heartbeat_hlsl_compiles_with_d3dcompile`; 0 `SKIPPED`). - Retail A/B measurement on the Wine-enabled `amd-dev` integration tree (`ae20c0a1`, identical executable, RX 9060 XT RADV, `MemoryMax=24G`, 60 s capped runs): changing only `XCL_GPU_AWAKE=0` raised frames shown from **618** to **1,025** (+65.9%, reaching 57–60 presents per 2 s during the intro). **Not tested** - Native Windows (AMD, NVIDIA, or Intel) and `scripts/smoke.ps1` directly on `b775ff85` (cannot boot under Wine without `#867`/`#2477`). - Full workspace test suite on `b775ff85`. **AI use** - T3 Code, Codex (`gpt-6.2-astra`) measured the `XCL_GPU_AWAKE=0` A/B improvement on this machine and authored the commit (`README.md` and `gpu_awake.rs`). - T3 Code, Antigravity (`Gemini 4 Neon`) rebased the commit cleanly onto `amd-dev` (`bf7c82ee` -> `b775ff85`), built and ran the `gpu_awake::` tests under Proton on this machine, and updated this PR description.
The AMD keep-awake queue submits compute work throughout active rendering. Disabling it on the same RX 9060 XT RADV executable raised a capped 60-second run from 618 to 1025 frames. Keep the native AMD default and the explicit override.

Assisted-by: T3 Code / Codex (gpt-6.2-astra)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:15:57 +00:00
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-27 00:11 UTC · original

Tested: Clean b775ff85760912faf6e75afd0589691c68afe6ac, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug. cargo test --locked -j 2 -p xcl --lib hle::d3d12x::gpu_awake:: -- --nocapture: 2 passed, 0 failed, 0 ignored, 0 skips. The fixtures cover simulated vendor/Wine defaults, explicit overrides, and native Windows D3DCompile compilation of the heartbeat shader.

Not tested: Actual heartbeat dispatch, AMD hardware, Wine/RADV behavior or performance, full workspace suite, or retail smoke.

AI use: T3 Code / Codex (gpt-6.2-sol) ran and independently reran the tests and drafted this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-27 00:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/2916#issuecomment-7206252918) **Tested:** Clean `b775ff85760912faf6e75afd0589691c68afe6ac`, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug. `cargo test --locked -j 2 -p xcl --lib hle::d3d12x::gpu_awake:: -- --nocapture`: 2 passed, 0 failed, 0 ignored, 0 skips. The fixtures cover simulated vendor/Wine defaults, explicit overrides, and native Windows `D3DCompile` compilation of the heartbeat shader. **Not tested:** Actual heartbeat dispatch, AMD hardware, Wine/RADV behavior or performance, full workspace suite, or retail smoke. **AI use:** T3 Code / Codex (`gpt-6.2-sol`) ran and independently reran the tests and drafted this report.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-27 00:16 UTC · original

I ran the pinned mode logic from b775ff85 with the actual ntdll Wine-symbol check on native Windows. Two focused tests passed: native Windows kept the AMD default, and the synthetic Wine branch honored both overrides. This used a synthetic vendor ID and did not start an AMD GPU worker. Pinned decision code.

I put the remaining native Windows/AMD check in PortBridge Test Lab #101, linked to your draft. Someone with AMD can give that link to their agent and return the two test outcomes. The task records worker execution separately if a synthetic runner is available. Any result can come back here with the tester's credit. AI-assisted native decision test.

**@⁠akimfomin** on GitHub · 2026-11-27 00:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/2916#issuecomment-7206328392) I ran the pinned mode logic from b775ff85 with the actual ntdll Wine-symbol check on native Windows. Two focused tests passed: native Windows kept the AMD default, and the synthetic Wine branch honored both overrides. This used a synthetic vendor ID and did not start an AMD GPU worker. [Pinned decision code](https://github.com/xcl-dev/xcl/blob/b775ff85760912faf6e75afd0589691c68afe6ac/crates/xcl/src/hle/d3d12x/gpu_awake.rs#L57-L84). I put the remaining native Windows/AMD check in [PortBridge Test Lab #101](https://github.com/akimfomin/PortBridge/issues/101), linked to your draft. Someone with AMD can give that link to their agent and return the two test outcomes. The task records worker execution separately if a synthetic runner is available. Any result can come back here with the tester's credit. AI-assisted native decision test.
Author
Owner

@⁠vibryxcx on GitHub · 2026-11-27 00:21 UTC · original · edited 2026-11-27 03:19 UTC

The native Windows / AMD check asked for in the description: on Windows the default is unchanged, and the heartbeat still starts by itself on AMD.

Tested: AMD Radeon RX 6800 (RDNA2, driver 32.0.21045.5002), i5-10600KF, Windows 11 Pro 26200, Rust 1.100.0, release for xcl.exe and debug for the tests. Head b775ff85 vs its base amd-dev bf7c82ee, each in its own worktree with no uncommitted changes. Retail title, warm caches, no XCL_GPU_AWAKE set.

  • Both runs log GPU keep-awake async-compute heartbeat active (vendor 0x1002, XCL_GPU_AWAKE=0 to disable) at about 18.7 s, so under_wine() is false here and Mode::Auto still enables it.
  • cargo test -p xcl --lib -- hle::d3d12x::gpu_awake::: 2 passed, 0 failed, 0 ignored (env_mode_parsing_and_amd_auto_enable, heartbeat_hlsl_compiles_with_d3dcompile), no SKIPPED.

Regression run

xcl-smoke v1
commit: bf7c82ee1b2685bb40417e09c4128177aa68d719
gpu: AMD Radeon RX 6800
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1324 (PresentX 1324)
presents per 2 s (last 3): 60 60 64
device removals: 0
crashes: 0
peak commit: 13337 MB
xcl-smoke v1
commit: b775ff85760912faf6e75afd0589691c68afe6ac
gpu: AMD Radeon RX 6800
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1309 (PresentX 1309)
presents per 2 s (last 3): 60 64 60
device removals: 0
crashes: 0
peak commit: 13334 MB

The base is bf7c82ee on amd-dev, not a commit of main. Frames (99 %) and commit are within the limits.

Not tested: Wine / RADV (no Linux machine here); longer runs (on this card bf7c82ee itself crashes in the AMD compiler later in the title, see #2874, which is unrelated to this change); the full suite on this head (since run, see the update below).

AI use: Claude Code (Claude Opus 5.5) read the diff, ran the builds, tests and the smoke pair, and wrote this comment.


Update: full lib suite on this head (b775ff85, same RX 6800, debug, cargo test -p xcl --lib -- --test-threads=1 with the 4 tests skipped that hang or abort only inside the full amd-dev run, see #42): 1651 passed, 12 failed, 27 ignored. These are the same 12 failures as base bf7c82ee run the same way, so nothing fails only on this head. Both gpu_awake tests pass. SKIPPED: 11 lines, the same as on the base: f16_programs_on_the_gpu, plus GPU tests skipped after the test process loses its device partway through the run, a base issue reported in #42.

**@⁠vibryxcx** on GitHub · 2026-11-27 00:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2916#issuecomment-7206399186) · edited 2026-11-27 03:19 UTC The native Windows / AMD check asked for in the description: **on Windows the default is unchanged, and the heartbeat still starts by itself on AMD.** **Tested:** AMD Radeon RX 6800 (RDNA2, driver 32.0.21045.5002), i5-10600KF, Windows 11 Pro 26200, Rust 1.100.0, release for `xcl.exe` and debug for the tests. Head `b775ff85` vs its base `amd-dev` `bf7c82ee`, each in its own worktree with no uncommitted changes. Retail title, warm caches, no `XCL_GPU_AWAKE` set. - Both runs log `GPU keep-awake async-compute heartbeat active (vendor 0x1002, XCL_GPU_AWAKE=0 to disable)` at about 18.7 s, so `under_wine()` is false here and `Mode::Auto` still enables it. - `cargo test -p xcl --lib -- hle::d3d12x::gpu_awake::`: 2 passed, 0 failed, 0 ignored (`env_mode_parsing_and_amd_auto_enable`, `heartbeat_hlsl_compiles_with_d3dcompile`), no SKIPPED. **Regression run** ``` xcl-smoke v1 commit: bf7c82ee1b2685bb40417e09c4128177aa68d719 gpu: AMD Radeon RX 6800 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1324 (PresentX 1324) presents per 2 s (last 3): 60 60 64 device removals: 0 crashes: 0 peak commit: 13337 MB ``` ``` xcl-smoke v1 commit: b775ff85760912faf6e75afd0589691c68afe6ac gpu: AMD Radeon RX 6800 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1309 (PresentX 1309) presents per 2 s (last 3): 60 64 60 device removals: 0 crashes: 0 peak commit: 13334 MB ``` The base is `bf7c82ee` on `amd-dev`, not a commit of `main`. Frames (99 %) and commit are within the limits. **Not tested:** Wine / RADV (no Linux machine here); longer runs (on this card `bf7c82ee` itself crashes in the AMD compiler later in the title, see #2874, which is unrelated to this change); the full suite on this head (since run, see the update below). AI use: Claude Code (Claude Opus 5.5) read the diff, ran the builds, tests and the smoke pair, and wrote this comment. --- **Update: full lib suite on this head** (`b775ff85`, same RX 6800, debug, `cargo test -p xcl --lib -- --test-threads=1` with the 4 tests skipped that hang or abort only inside the full `amd-dev` run, see #42): **1651 passed, 12 failed, 27 ignored**. These are the same 12 failures as base `bf7c82ee` run the same way, so nothing fails only on this head. Both `gpu_awake` tests pass. SKIPPED: 11 lines, the same as on the base: `f16_programs_on_the_gpu`, plus GPU tests skipped after the test process loses its device partway through the run, a base issue reported in #42.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2916/head:github-bot/gh-2916'
git switch 'github-bot/gh-2916'

Merge

Merge the changes and update on Forgejo.
git switch 'amd-dev'
git merge --no-ff 'github-bot/gh-2916'
git switch 'github-bot/gh-2916'
git rebase 'amd-dev'
git switch 'amd-dev'
git merge --ff-only 'github-bot/gh-2916'
git switch 'github-bot/gh-2916'
git rebase 'amd-dev'
git switch 'amd-dev'
git merge --no-ff 'github-bot/gh-2916'
git switch 'amd-dev'
git merge --squash 'github-bot/gh-2916'
git switch 'amd-dev'
git merge --ff-only 'github-bot/gh-2916'
git switch 'amd-dev'
git merge 'github-bot/gh-2916'
git push origin 'amd-dev'
This discussion has been locked. Commenting is limited to contributors.
No description provided.