xcl run: xcl nvprofile puts xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2580
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2590"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T00:47:06Z.
NVIDIA's D3D12 driver reserves 512 MB of VA for the machine code of the pipelines in use and removes the device (
0x887a0005) when a submission needs more (#2403). Setting0x001ABC0Fin a driver profile raises that reserve; NVIDIA's own profiles use 1 or 2 GiB for big titles. This addsxcl nvprofile, which writes that one setting forxcl.exethrough NVAPI, so users don't have to find it in Profile Inspector. Part of #2403. The measurements are in my comment there.It is opt-in and changes nothing at run time: nothing happens unless the user runs the command. It moves the wall and does not replace using less code (#2526, #1901, #2496).
What is in it
crates/xcl/src/gpu/nvprofile.rs(new):nvapi64.dllthroughnvapi_QueryInterface,NvAPI_DRS_*.installputs the exe into a profile of its own,XCL (xcl-dev), holding only this setting, soremovedeletes exactly that.statusreads what the driver will use. Beforeinstallreuses a profile of that name orremovedeletes it, both check that it holds nothing butxcl.exeand this setting (NvAPI_DRS_GetProfileInfo,NvAPI_DRS_EnumApplications), and refuse otherwise, so a same-name profile someone else made is left alone. Tests: the NVAPI struct sizes, the command line, the ownership rule.crates/xcl/src/main.rs: thexcl nvprofile [status | install [--mb N] | remove]subcommand and its help text.--mbtakes 512 to 4095 (4096 MB would not fit in the setting's u32), default 1024.README.md: one line in the command list.Writing needs an elevated prompt once: without it
NvAPI_DRS_SetSettingreturns-137(NVAPI_INVALID_USER_PRIVILEGE) and nothing is saved, and the command says so. Later unelevated runs get the larger heap, because the driver matches the profile by exe name. Reading needs no elevation.Tested
RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, Rust 1.100.1 (MSVC), debug for the suite, release for the runs.
At
a00530ea(rebased onmainc53e9696), debug, with Windows' own D3D12 (XCL_D3D12_DIRset to an empty folder: with the Agility SDK 1.620 the lib test binary stops on this machine, #3488):cargo test --workspace --no-fail-fast -- --test-threads=4: 3008 passed, 0 failed, 52 ignored; 26 SKIPPED (22 no wave64, 2 no xgameruntime.dll, 2 no heap windows).Review fix (thehollowedone, 12-01): a shader heap the profile only inherits (
GetSettingreports asettingLocationother than the current profile) no longer counts as the profile's own setting, so such a profile is not taken for XCL's. Unit test: locations 1 and 2 refused, 0 accepted.At
ffc7e0ac(rebased onmain53e85fb1, conflict inmain.rsonly: both match arms kept), release:cargo test --workspace --release --no-fail-fast -- --test-threads=4: 2795 passed, 3 failed, 49 ignored; 30 SKIPPED (no wave64, no debug layer, heap windows off, per-lane f16/f32 forms refused). The failures are not from this PR, and fail the same way onmain53e85fb1alone:hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline(every run,standin.rs:459) andtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(3 of 3 runs onmain, atgpu_two_pass_cache_e2e.rs:472/:584; it passed once on each tree).Earlier, at
2f131757(onmain6089122a), debug: 1469 passed, 0 failed, 47 ignored; 28 SKIPPED.Before the rebase, at
75b72d2f(onmainb49be18):cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4: 1439 passed, 0 failed, 47 ignored; 28 SKIPPED (no wave64 and the like on this adapter). At004fa0f6, debug: 1438 passed, 0 failed, 47 ignored.Review fix (profile ownership):
ownedis unit-tested (only_a_profile_xcl_could_have_made_is_changed: a same-name profile with another app, an extra setting, or a predefined profile is refused; whatinstallleaves is accepted). Read-only against the real driver with a temporary local test: the profileinstallmade here read as 1 application (xcl.exe) and 1 setting, accepted forxcl.exeand refused when onlyother.exewas expected; nothing was saved.Review fixes:
--mb 4096is refused (it wrapped to a 0-byte heap); only NVAPI's not-found codes (-160, -163, -166, checked againstnvapi_lite_common.h) read as "no profile", any other status (e.g.NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS, -182) is an error instatus,removeandinstall. Unit tests for both; the DRS calls themselves are not mocked.28
SKIPPEDlines: the wave64 tests (no wave64 on this adapter), per-lane f16/f32 forms refused, and the const-mask case.The new tests:
gpu::nvprofile::tests::struct_sizes_match_nvapi,the_command_line_is_checked: pass.xcl nvprofileunelevated: shows the default 512 MB forxcl.exe.xcl nvprofile installunelevated: refused with the elevation message, exit 1, nothing written.The same module, from #2403's
shader_code_limit.rswith its own exe put into the profile (elevated install, then an unelevated run): removal at 262 pipelines / 448 MB without the profile, 519 / 888 MB at 1 GiB, 1,028 / 1,760 MB at 2 GiB. Reading NVIDIA's own Fortnite profile gives0x80000000, as Profile Inspector shows.Retail 1.0.2.1 in the world, with and without the profile written by this (same binary
4bf94d0, one copy namedxcl-noprofile.exeso the driver gives it no profile, back to back from the same caches;XCL_DIRECT_DXIL=1 XCL_DRED=1, 480 s, A pressed by script). Compute pipelines precompiled with--used-onlyusing #2551's precompiler, so no compute pipeline was built cold at the world start:xcl nvprofile install --mb 10240x887a0005at 102.5 s, DRED page fault at VA 0x0 with no allocations, then0x80000003)With the profile the title showed the first in-world output on this machine: world audio and on-screen text. But frames were very slow (about 70 in the 400 s after the world start), with green flashes and 17 compute + 8 graphics pipelines still built cold. So this shows the device staying alive, not a playable world. The shader code in use was not counted in these runs.
On
nvidia-devaf2cecc4+ #2551 (RTX 3090, same cache state), 1 GiB was not enough: the device was removed in 2 of 2 runs at--mb 1024(341 s, 199.6 s) and in 0 of 2 at--mb 2048(480 s each); details. @Anon64 saw the same on that tree on an RTX 3060, so--mb 2048may be the better choice onnvidia-dev.Regression run
main:
this PR:
The code here is not called at run time.
Not tested
installandremoverefusing a real same-name profile made by someone else (none was created in the driver); the DRS calls are not mocked.xcl nvprofile installandremovethroughxcl.exeitself, elevated. The same functions were tested elevated through the test above.AI use
c53e9696, thesettingLocationfix and this update were made and posted by Claude Code while I was away, under the standing approval I gave it for this session.🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:09:47Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by GXLD-N on 2026-11-26T02:36:40Z.
Tested on an RTX 4070 Ti SUPER (Ada, 16 GB):
xcl nvprofile installraises the shader-code limit from 446 MB to 885 MB, the same as the RTX 3090 in #2403.Setup
4bf94d0, release build for the runs, debug for the suite.Suite
cargo test --workspace -- --test-threads=4: 1431 passed, 0 failed, 48 ignored, 26SKIPPED(24 "no wave64", 1 "no heap windows", 1 Developer Mode for the driver cache). The 48 ignored include #2403'sshader_code_limit.rs, which I added locally for the runs below and is not in the PR. Bothgpu::nvprofiletests pass.The command
xcl nvprofile statusbefore:xcl.exe: the driver's default shader heap (512 MB on D3D12).xcl nvprofile installfrom an elevated prompt:xcl.exe is in the profile "XCL (xcl-dev)", thenxcl.exe: shader heap 1024 MB.xcl nvprofile statusafterwards from a normal prompt:xcl.exe: shader heap 1024 MB. Reading needs no elevation, as the description says.The limit (#2403's
shader_code_limit.rs, unchanged,MODE=keep COUNT=600 STMTS=3000 THREADS=5)install(1024 MB)Both ended in
0x887a0005. The profile matches by executable name and only putsxcl.exein it, so for the second row I copied the test binary to a folder of its own asxcl.exeand ran that copy. The first row is the binary under its own name. 885 MB is within 3 MB of the RTX 3090's 888 MB at 1 GiB in #2403, so the setting scales the same way on Ada.Not tested
remove(I left the profile installed),--mbother than the default, and a second install over an existing profile.nvapi64.dll; not checked).Tested and written with Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-26T03:01:37Z.
By reading only, not run, at
4bf94d07:xcl nvprofile install --mb 4096asks the driver for a shader heap of 0 bytes.parseaccepts 512–4096 (nvprofile.rs:264), then(mb as u32) << 20(:267) is 2^32 for 4096, which does not fit in au32: the result is 0, in debug and release (<<only checks the shift amount).install's only check of the value, the 64 KiB one (:185), passes 0, so 0 is what goes toNvAPI_DRS_SetSetting(:217-218).u64and refusing what does not fit in theu32setting, would fix it. The test goes no higher than 2048 (:321).AI use: Claude Code (Claude Opus 5.5) found this; Claude Fable 5.2 rechecked it; checked by a person before posting.
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T06:31:25Z.
Review: COMMENTED
remove()treats every non-NVAPI_OKresult fromFindProfileByNameas “no XCL profile,” so a miscellaneous NVAPI failure can produce a successful exit even when the profile still exists. NVIDIA documents distinctNVAPI_PROFILE_NOT_FOUNDandNVAPI_ERRORresults for this call. The same error-as-absence pattern instatus()makes an ambiguous basename match or a setting-read failure print the driver's default shader heap rather than an error. Could only the explicit profile/application/setting not-found codes map toNone/false, with the other statuses propagated throughcheck()? Mocking the DRS calls to return not-found versusNVAPI_ERROR(and ambiguous executable path forstatus) would verify the CLI exit and message without changing a real driver profile.This is an exact-head source review of
4bf94d07c280c0adb9b00c2699b6972e64fed22d. I did not invoke NVAPI or modify driver settings. AI-assisted review with Codex.Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-26T06:27:28Z.
Tested
4bf94d0on an RTX 3060 12 GB (NVIDIA 581.80, i9-14900KF, Windows 11 26200), release build:xcl nvprofile installstopped the retail title's device removal.xcl nvprofile statusbefore:xcl.exe: the driver's default shader heap (512 MB on D3D12).install --mb 1024from an elevated prompt, then unelevatedstatus:xcl.exe: shader heap 1024 MB.0x887a0005) at 81.6–84.4 s in 5 of 5 runs. With the profile, it ran to 274.8 s with no removal and reached its world, as described on #2403.nvidia-devc044dc6. The profile matches it because the launcher starts the title's host fromxcl.exe, with only the command line naming the title's exe.installwas given the title's exe name as a second entry next toxcl.exe, in case the driver matched on that. It turned out not to be needed for the reason above, and I did not testinstallwithout it.Update,
--mb 2048: onnvidia-devaf2cecc4with its shader preparation on (it builds the graphics and compute pipelines earlier runs used before the title starts), 1024 MB was not enough: the title lost the device (0x887a0005, empty DRED, video memory only ~270 MB over its budget) about 125 s in, with 3,569 pipelines built (675 of 256 KB or more). Withinstall --mb 2048(status:xcl.exe: shader heap 2048 MB) the same run built 3,934 (752 of 256 KB or more) with no removal and ended about 258 s in on the title's own watchdog while it waited for compute pipelines. One run each. So the more pipelines a run makes resident, the bigger the heap it needs; 1024 may be too small as a default once preparation is on.Not tested:
remove,--mbother than 1024 and 2048, the suite on this commit, AMD (the command should say there is no NVAPI).AI use: Claude Code (Claude Opus 5.5) built it, ran the commands and the runs, and wrote this report.
Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-11-26T07:41:44Z.
Tested
4bf94d0on an RTX 3070 Laptop 8 GB: withxcl nvprofile install --mb 1024the retail title's0x887a0005at world start is gone (removed at 281 s instead of 117 s). Behind it, though, the title is almost stopped from about 120 s, and the run ended in a TDR.Setup:
TdrDelay= 10 (set for an earlier test, see #505).mainb49be18+ this PR + #684, #751, #2385, #2097d98d2d4, #240497a70a7, #2422, #2427 + #2428c6e5af8, #24962e8ff6b, #2551, plus local diagnostics: a compute skip switch and Nsight Aftermath hooks. The skip list was empty in the 1 GiB run and in the default runs, except one default run noted below.XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WINDOW_NO_CARRY=1 XCL_DRED=1, A pressed every 5 s, 600 s.--precompile --only cs --pipelinesfor this tree.What I checked:
xcl nvprofileunelevated: the default 512 MB.xcl nvprofile install --mb 1024in an elevated prompt (run by the tester), thenxcl nvprofileunelevated:shader heap 1024 MB.Results:
551a75e)#101)0x887a0005(118.8 and 131.7 s in the others, and 124.8 s in one with 3 large compute programs left out by the skip switch), no 4101 event0x887a0006, with a Windows 4101 event and twonvlddmkm153GPU queue.Wait … did not complete within 5000 ms – released on CPUwarnings appear.TdrDelay.5 15 0 >5 15 0, on a pipeline logged as "a stand-in, or not translated".main6d12f58+ #24045ca9c23and others, see #505). So that part is not caused by the profile; the profile only lets this tree reach it.Not tested: more than one run with the profile;
--mb 2048;xcl nvprofile remove;TdrDelayunset with the profile; a count of the shader code in use.AI use: Claude Code (Claude Opus 5.5) built the tree, ran the runs, read the logs, DRED and the event log, and wrote this. The elevated
installwas run by the tester.Edit: two more runs with the 1 GiB profile, same build and settings, skip list empty.
0x887a0006, 4101 eventxcl.exe36.1 GB), no XCL error0x887a0006, 4101 event0x887a0005in any of them;TdrDelay= 10;Correction: the local compute skip switch I listed under the tree had a side effect, even with an empty list. On every dispatch
ExecuteIndirectit resolved the pipeline withpso_async::resolve_waitbefore the empty-list check, so a pending compute pipeline was waited for instead of put off to the submit. All runs above have that, on both sides of the comparison.One more run without it:
device_x.rs, both sides kept) and #2691 (conflict inreal.rs's tests, both kept), fresh precompile. The skip switch was off, with no env var.cargo test --workspace --release -- --test-threads=4: 1 476 passed, 0 failed, 48 ignored, 24 SKIPPED.0x887a0006, with a 4101 event. DRED shows a compute list at 25 of 63 operations.So the world-start stall and the TDR after it do not come from that switch.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T08:50:09Z.
Thanks @pvfreis, confirmed:
4096 << 20wraps to 0 in a u32. The range is now 512–4095, with a test that 4096 is refused (004fa0f6).AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T08:50:11Z.
Thanks @luckyteagirl, confirmed against
nvapi.h. A newfound()treats only NVAPI's three not-found codes (-160, -163, -166) as absent. Anything else, includingNVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS(-182), is now an error instatus,removeandinstall. The mapping has a unit test; the full DRS calls are not mocked (004fa0f6).AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T10:24:21Z.
Independent Windows/NVIDIA check of #2590 head
004fa0fon currentmainb49be18.Windows 11 build 26300, RTX 3080 Ti (12 GB, driver 621.35), rustc 1.99.1 MSVC. A clean exact-head checkout was used.
cargo build --offline --locked --workspace: passed.cargo test --offline --locked -p xcl --lib gpu::nvprofile -- --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored. This includes the 4096 MB limit and unexpected-NVAPI-status cases.target\debug\xcl.exe nvprofile status: exit 0, reports the driver's default 512 MB shader heap. A repeat after testing reported the same value.target\debug\xcl.exe nvprofile install --mb 4096: rejected at argument parsing with exit 2 (expected 512 - 4095); this did not attempt a driver write.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,438 passed, 0 failed, 47 ignored across 37 test executables. The output printed 25 GPUSKIPPEDnotices; those paths are not GPU coverage.Not tested here: elevated
install/remove, a profile change, a shader-heap limit probe, or a retail title run. These results verify the current head's build, tests, read-only status and input rejection on this adapter; they do not measure a larger heap or device-removal improvement.AI use: Codex (GPT-6.2 Sol) ran the commands and drafted this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T10:34:38Z.
One profile-ownership case remains on head
004fa0f.remove()looks upXCL (xcl-dev)by name, then deletes that entire profile and saves without checking its applications or settings. If a user already has a profile with that name containingother.exeor another setting,removecan discard those entries even whenxcl.exewas never associated with it.install()can reuse the same profile, addxcl.exe, and change its shader setting for the other members. NVIDIA's DRS API documents profile-wide deletion/reset and persistentSaveSettings.Could both commands refuse to alter an existing profile until XCL has verified it owns that profile and its contents? For example, mark XCL's application record at creation, then require a user-defined profile with only the expected marked application and profile-local shader setting before reuse or deletion. A focused DRS mock can supply a same-name profile with an unrelated app/setting, and one XCL-created profile later customized by the user; both
installandremoveshould return an error without callingSaveSettings. This avoids changing a real driver profile to test the collision.This is a source/API review; I did not create or change an NVIDIA profile to reproduce it. AI use: Codex (GPT-6.2 Astra) independently checked the NVAPI behavior; Codex (GPT-6.2 Sol) reviewed the code and drafted this comment.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-26T19:39:44Z.
@thehollowedone thanks, agreed:
removedeleted whatever profile had that name, andinstallwould addxcl.exeto it and change its heap for the others. Fixed in75b72d2f; the smoke block in the description is rerun at that head.installreuses the profile and beforeremovedeletes it,check_ownedreads it (NvAPI_DRS_GetProfileInfo,NvAPI_DRS_EnumApplications, IDs from NVIDIA/nvapinvapi_interface.h). It goes ahead only when the profile is not predefined, holds no application butxcl.exe, and has no setting other than the shader heap (or none, after an interrupted install). Otherwise both return an error naming what is in it, before anySetSettingorSaveSettings.xcl.exeand that one setting has nothing of anyone else's in it to lose, so it is treated as XCL's.owned, with a unit test (only_a_profile_xcl_could_have_made_is_changed): your two cases (a same-name profile with another app, and one XCL made that the user later added a setting or an app to) are refused, NVIDIA's own profiles are refused, and whatinstallleaves is accepted. I did not write a DRS mock; the NVAPI calls themselves are not covered by a test.Tested (RTX 3090 24 GB, 621.40, Windows 11 26300, release):
cargo test --release --workspace -- --test-threads=4: 1,439 passed, 0 failed, 47 ignored, with the GPU tests'SKIPPEDnotices in the passed count.installmade here,check_ownedread 1 application (xcl.exe) and 1 setting and accepted it forxcl.exe, and refused it when told the only expected app isother.exe. Nothing was saved.Not tested:
installandremoverefusing a real same-name profile that someone else made (I did not create one in the driver); elevatedremoveafter this change.AI use: Claude Code (Claude Opus 5.5) wrote the change and the test, checked the NVAPI IDs and signatures against NVIDIA's headers, ran the tests, and drafted this. Checked by me before posting.
Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-26T21:24:30Z.
Follow-up, by reading only at
75b72d2f: addressed.parsenow accepts--mb512–4095 (nvprofile.rs:324) and the test asserts that 4096 is refused (:383), so--mbcan no longer wrap the shader-heap setting to 0.AI use: Claude Code (Claude Opus 5.5) checked the new head and wrote this; Claude Fable 5.2 rechecked it; checked by a person before posting.
Imported from ivall/xcl. Originally posted by SergeAx on 2026-11-27T20:50:57Z.
Tested
2f131757on an RTX 5080:install --mb 2048works, and it stops the device removals of #1452 on this card.Setup: RTX 5080 16 GB, driver 621.14, Ryzen 5 3500X, Windows 10 22H2, release build.
Results:
cargo test --release -p xcl --lib nvprofile: 4 passed, 0 failed.xcl nvprofile statusbefore install:xcl.exe: the driver's default shader heap (512 MB on D3D12).xcl nvprofile install --mb 2048in an elevated prompt printed:xcl.exe is in the profile "XCL (xcl-dev)"xcl.exe: shader heap 2048 MBstatusfrom a normal prompt then read 2048 MB, before and after the title runs.xcl.exefrom a different worktree than the one that ran the install; the profile holds only the file name.nvprofile.rsagainst NVIDIA's public headers (nvapi.h,nvapi_interface.h,nvapi_lite_common.hfrom the R620 SDK). All 14 function IDs, the four status codes and the three struct layouts match. That includesNVDRS_SETTING_V1, whoseNvU64union members sit under#pragma pack(push, 4), so 12,324 bytes is right.Not tested:
remove.installwithout elevation.--mbvalues.AI use: Claude Code (Claude Opus 5.5) built the PR, checked the code against the headers, ran the tests and the title runs, and wrote this; I ran the elevated install.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T23:58:09Z.
Independent Windows/NVIDIA check of #2590 head
2f131757on an RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC. The checkout had no source changes.cargo build --offline --locked -j 4 --workspace: passed.cargo test --offline --locked -j 4 -p xcl --lib gpu::nvprofile -- --test-threads=1 --nocapture: 4 passed, 0 failed, 0 ignored. This includes the profile-ownership and NVAPI-status tests added after my earlier report.target\debug\xcl.exe nvprofile status: exit 0, read the driver's default 512 MB shader heap.nvprofile install --mb 4096was rejected by argument parsing (exit 2, expected 512–4095), before a driver write.cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --quiet, withXCL_DXIL_CACHEset to a fresh writable local directory: 1,469 passed, 0 failed, 47 ignored across 38 test result lines. The 25SKIPPEDnotices are included in Cargo's passing count and do not count as GPU coverage.Correction to my earlier suite result: with this sandbox's unwritable default DXIL-cache path, the suite had one failure in
console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk(cached_only console_mesh hit: "DXIL not compiled yet"). The same test failed on untouchedmain227d2cb, then passed on main whenXCL_DXIL_CACHEpointed to the writable directory. The complete PR suite also passed with that setting. The test compiles a mesh pass-through before probing its disk cache; it needs a writable cache path for that probe.I did not install or remove a driver profile, measure the larger shader heap, or run a title on this head. These checks cover the profile tests, read-only command behavior, and workspace suite on this adapter. AI use: Codex (GPT-6.2 Sol) ran the commands and wrote this report; Codex (GPT-6.2 Astra) independently traced the cache-test failure.
Current-main integration follow-up (29 Nov): I merged the unchanged head
2f131757into a temporary checkout of mainb10cc4c6. The merge andgit diff --cached --checkwere clean. With an isolated Cargo target and writable DXIL cache,cargo build --offline --locked -j 4 --workspacepassed. The workspace suite, excluding the three UMA remap tests listed below, reported 2,608 passed, 0 failed, 49 ignored across 41 test-result lines. Its 26SKIPPEDnotices (21 no wave64, 3 refused per-lane forms, 2 no heap windows) are included in the passing count; all fournvprofiletests ran and passed.The unfiltered isolated suite did not complete: the library process exited while remaking a coherent UMA window after a failed Windows remap of segment 2. An unfiltered library run on clean
mainpassed 2,468/0/29 once on this machine, so I cannot classify the merged run's stop as baseline-equivalent. The scoped passing run is additional integration coverage, not full-suite clearance or a merge-ready verdict. I did not run a title or write a driver profile in this follow-up.Exact scoped test command
cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --skip hle::d3d12x::uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip hle::d3d12x::uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip hle::d3d12x::uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_windowAI use for this follow-up: Codex (GPT-6.2 Sol) ran the integration build and tests, read the diff, and wrote this report.
Imported from ivall/xcl. Originally posted by minimalhipster990 on 2026-11-29T19:36:58Z.
RTX 4090 24 GB: with
install --mb 2048the retail title ran 600 s in the world in 3 of 3 runs, no device removal. With the default 512 MB heap, the same tree and save gave 0 of 9: 8 removals (0x887a0005, DRED state 0) at 114–437 s and one silent stall. This adds a 24 GB Ada card to the 4080 / 5080 / 5090 results in #2403, and rules out system commit as the cause here.Setup
2f131757, release:cargo test --release --locked -p xcl --lib nvprofile -- --test-threads=1: 4 passed, 0 failed.xcl nvprofile statusbefore:xcl.exe: the driver's default shader heap (512 MB on D3D12). The commandxcl nvprofile install --mb 2048was run once from an elevated prompt.statusafter:xcl.exe: shader heap 2048 MB.xcl.exe(the profile matches by exe name):main7a649b0e+ #3318f5496479+ #33440f0cc342, release, local merge966f035b. The setup and the 600 s replay are as in my #3344 comment: Series X profile, the same save and inputs, a verified copy of the same warm XCL cache,XCL_GFX_PSO_WAIT_MS=50 XCL_CS_PSO_WAIT_MS=200 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=3990 XCL_TWO_PASS_MB=3072.Results. "World" means the first 2 s interval with 10,000 or more draws.
XCL_DRED=pagefaultXCL_DRED=pagefault,XCL_THREAD_DUMP_ATXCL_COHERENT_MB=1024XCL_DRED=pagefault,XCL_THREAD_DUMP_ATSystem commit is not the cause.
Not tested: 1024 MB or other sizes,
remove(the profile is still installed), and runs interleaved in time: the 512 MB runs came first, the 2 GiB runs after them.AI use: Claude Code (Claude Opus 5.5) built the trees, ran the tests,
statusand the replays, and wrote this report. The person running these tests raninstallthemselves from an elevated prompt.Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-30T03:21:03Z.
World runs of the rebased head
ffc7e0ac(onmain53e85fb1), with and without the profile this writes, on the retail title.Setup: RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, release. One binary, copied twice:
xcl.exe(in the profile,xcl nvprofile status: 2048 MB) andxcl-noprofile.exe(no profile, the driver's 512 MB).XCL_DIRECT_DXIL=1 XCL_NETWORK=0 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_DRED=1, scripted presses, 1500 s each. A first pair warmed the caches (neither reached the world: cold world-entry compiles after the 54 newmaincommits); the pair below ran back to back from those caches.0x887a0005The removal looks like every no-profile one before it: "Dispatch with a translated pipeline skipped: whole compute pipeline (0x887a0005)", DRED device state 0, "page fault at GPU VA 0x0; allocations there: []", no list in flight. It came while the title was creating its whole-form compute pipelines on the way into the world.
One pair, so it adds to the earlier numbers here rather than standing on its own.
Not tested: more pairs on this head;
--mb 1024; AMD (the command does nothing there).AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs and wrote this.
Imported from ivall/xcl. Originally posted by AAsobu on 2026-12-01T00:14:11Z.
merge-check
base:
d0832e614fhead:
ffc7e0acb9merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps); failing: none. The 4
gpu::nvprofile::testspass.review: none. Read the whole diff (+422/-0:
gpu/nvprofile.rs,gpu/mod.rs,main.rs,README.md).statusonly reads (CreateSession, LoadSettings, FindApplicationByName, GetSetting; no SaveSettings);installandremovewrite only to the profile namedXCL (xcl-dev)and refuse one that holds other applications or settings. The NVAPI interface ids used match the public NVAPI ones I know (Initialize, DRS CreateSession / DestroySession / LoadSettings / SaveSettings / FindApplicationByName / GetSetting). Nothing runs unless the command is used.performance: the command changes nothing at run time by itself. What the profile does on this machine, retail title, release builds named
xcl.exe, same settings each time (XCL_PREPARE=0 XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=4 XCL_NETWORK=0 XCL_DRED=1 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=1000 XCL_TEXTURE_LEVEL_PAGES=1 XCL_HUGE_PSO_CONCURRENCY=4 XCL_HUGE_PSO_WANTED_CONCURRENCY=4, scripted start prompt, no input):xcl nvprofile status(this PR's head, debug) printed "xcl.exe: the driver's default shader heap (512 MB on D3D12)". In that state 13 of 13 runs that reached the world (mainabec7ce9to86e86fcband PRs on it) lost the device, at 143-816 s from start (in the 8 of them where I timed world entry, 5-50 s after it): 0x887a0005, DRED "page fault at GPU VA 0x0; allocations there: []", "no breadcrumbs" — the signature of #3277.xcl nvprofile install --mb 1024from an elevated prompt, thenstatus(unelevated): "xcl.exe: shader heap 1024 MB".mainff0c364btwice,main+ #3528 twice) stayed in the world ~220-270 s to the end with no removal; frames kept coming at about one per 2 s (GPU-bound).mainff0c364b, one run each, played until 1800 s or the removal: with 1024 MB the device was lost at 1622 s, ~24 min after world entry at 155 s, with the same DRED output as above (920 new driver blobs that run); afterxcl nvprofile install --mb 2048(status: "shader heap 2048 MB") the run stayed in the world from 139 s to the 1800 s limit, ~28 min, with no removal. Frames held at about 1.2 presents per 2 s from 300 s to the end in both runs. So on this title the removal came ~24 min into the world with 1024 MB, and not within ~28 min with 2048 MB (one run each).update (2026-12-01, same head
ffc7e0ac): thehollowedone's follow-up is right on the source:check_ownedtakeshas_heapfromGetSettingfinding the heap setting and never looks at itslocation, so a profile namedXCL (xcl-dev)holdingxcl.exe, one unrelated setting of its own and an inherited heap value passesowned(settings == 1 && has_heap), andremovewould delete that unrelated setting with it. I missed it. It needs such a same-name profile to exist already, whichinstallnever makes, and I did not reproduce it; I read it as a small guard to add (theirlocal_heapsketch), not a blocker, so my verdict stays. My in-world results with the profile at 2048 MB are unchanged.verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 621.24, wave32 only), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5), results checked by me
Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-01T02:11:49Z.
merge-check claim
head:
ffc7e0acb9Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-01T02:12:43Z.
merge-check
base:
d0832e6head:
ffc7e0amerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none
review: whole diff read (+422/-0: gpu/nvprofile.rs, gpu/mod.rs, main.rs, README.md). Opt-in: nothing changes at run time, and nvapi64.dll is loaded only by the
xcl nvprofilesubcommand. install writes the one DWORD setting 0x001ABC0F into a profile of its own and refuses a same-name profile that holds other applications or settings (owned, unit-tested); remove deletes only that profile; NVAPI codes other than not-found are errors, not "absent". The four nvprofile tests pass. Tried on this PC's real driver: from an elevated prompt,xcl nvprofile install --mb 2048succeeded andxcl nvprofile statusreports a 2048 MB shader heap for xcl.exe. A note for users: the profile matches the file name only, so a renamed binary keeps the 512 MB default (as #3277 found); the help text could say so. No duplicate: the other NVAPI PR (#1849) writes a different, temporary setting for PSO timing; #1607 lists this PR only as one where a test report helps.performance: not measured; nothing changes at run time unless the command is run.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build, suite and the nvprofile install/status on this PC; diff review by Claude Opus 5.5.
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T02:28:04Z.
A title test on a 5070 Ti, which is a card this PR did not have: the profile removes the device removal we were hitting at world load on unmodified
main.Setup
ffc7e0acmerged ontomaind0832e61(merge0f453fd9, parents checked),cargo build --release -p xclok — built only to getxcl nvprofile.statusbefore:xcl.exe: the driver's default shader heap (512 MB on D3D12).install --mb 2048from an elevated shell:xcl.exe is in the profile "XCL (xcl-dev)",shader heap 2048 MB;statusafter agrees.mainbinary, not on this PR's build —D:\Tools\xcl\target\release\xcl.exeatd0832e61, withXCL_PREPARE=0 XCL_NETWORK=0 XCL_RUN_SECONDS=330and nothing else tuned. So the only thing that differed between the two runs below is the driver profile. It also applied to that copy, which is a secondxcl.exein a different directory — the name matching works as you describe.Before the profile — ten runs today, all the same way
0x887a0005) at frames 1432-1600, wall time 49.3-83.9 s. The frame is fixed; the time is not.nvidia-smitrace: idle (2-9 %, 405-1,567 MHz, ~45 W) until 81 s, then 60→100 % for about 7 s at 3,007 MHz and 15,014-15,883 of 16,303 MB of video memory, and the removal lands inside that burst.nvlddmkmEvent ID 153,Error occurred on GPUID: a00, in the second of the removal.ExecuteIndirect (DispatchMesh)/DispatchMesh"in two passes" calls across 12 programs, inside 1,301 pipelines.With
--mb 2048— same binary, same settingsSo the removal at world load on this card was the 512 MB shader-code heap, exactly as this PR describes, and 2 GiB was enough to get past it. It is not playable at that point — ~2.3 fps while 42 pipelines still build cold — which matches your 3090 result (device alive, not playable), but it is the first time this card has stayed alive through the world load instead of being removed about 80 s in.
One caveat on picking the size: I did not measure the code bytes here, only that 1,301 pipelines were recorded at the loss, so I cannot say whether 1 GiB would have been enough on this card. I went straight to 2048 MB on your
nvidia-devnote, and it held.AI use: an agent ran the builds, read the traces and wrote this comment.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T05:03:18Z.
Follow-up to my earlier ownership review on current head
ffc7e0ac:check_ownedchecks thatGetSettingfound the shader-heap ID, but does not inspectSetting.location. NVAPI documents that field as the source of the effective value, including inherited global/base values.If a same-name profile contains
xcl.exeand one unrelated local setting, while the heap setting is inherited,num_settings == 1andGetSettingcan both be true. The ownership guard then accepts the profile;removedeletes the unrelated setting with it.installcan likewise reuse that profile. This is a source/API-contract case, not a reproduced driver-profile mutation.Please treat the heap as this profile's setting only when
GetSettingsucceeds andsettingLocation == NVDRS_CURRENT_PROFILE_LOCATION. Keep the current interrupted-install case (num_settings == 0) allowed. A focused regression should reject one unrelated local setting plus an inherited heap and accept a locally stored heap; it can pass the returned location into the pure ownership helper without writing a real profile.Candidate guard and regression sketch
I did not run builds, tests, or profile writes in this source review.
AI use: OpenAI Codex (GPT-6.2 Astra) identified the inherited-setting case; OpenAI Codex (GPT-6.2 Sol) checked the PR source and NVIDIA API documentation and drafted this note.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:25:48Z.
Triage (#1607) – head
ffc7e0aNo open or merged PR adds an NVIDIA driver-profile tool: nothing else touches NVAPI DRS or setting 0x001ABC0F. The other PRs that mention #2403 (#2469, #2496, #2526, #2641) change other code.
The parts of gpu/nvprofile.rs checked against nvapi.h look correct: the struct layouts and versions, the QueryInterface IDs, and the use of only the not-found codes as "absent".
installandremoverefuse a same-name profile with foreign apps or settings.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T23:29:11Z.
@thehollowedone thank you, right:
GetSettingalso returns a setting the profile inherits (from the global or a predefined profile), so a same-name profile with no settings of its own read as holding the shader heap. Fixed in the one commit, nowa00530ea(rebased ontomainc53e9696, force-pushed; description updated):check_ownedcounts the heap as the profile's own only whensettingLocationisNVDRS_CURRENT_PROFILE_LOCATION(0). Unit test: locations 1 and 2 are refused, 0 accepted.@brainhay5 thank you for the 5070 Ti run.
Tested on
a00530ea:cargo test --workspace --no-fail-fast -- --test-threads=43008 passed, 0 failed, 52 ignored, 26 SKIPPED; smoke pair againstmainc53e9696in the description (1580 vs 1573 frames, no removals or crashes).AI use: Claude Code (Claude Opus 5.5) made the fix, ran the tests and wrote this while I was away; posted with my standing approval for this session.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T23:34:36Z.
Follow-up review of
a00530ea, sinceffc7e0a(code reading only, not a merge-check) · no new findingsIn short: Since the triage note on
ffc7e0a,installandremovetreat the profile as XCL's only when its shader heap is stored in the profile itself. A heap inherited from the global or base profile (settingLocationother than 0) no longer counts as the profile's one setting. A test covers both cases. The rest of the commit is unchanged, and nothing blocks it.Checked and fine
Setting(nvprofile.rs~55) followsNVDRS_SETTING: version, name, id, type, thensettingLocation.NVDRS_CURRENT_PROFILE_LOCATIONis 0, with global 1, base 2, default 3.local_heap(found, location)is true only whenGetSettingfound the heap and it is stored in the profile itself. When the setting is not found,locationis not read.ownednow getslocal_heap(..), so a same-name profile whose only "setting" is an inherited heap is refused, as one with foreign settings already was. The test covers locations 1 and 2 (refused) and 0 (owned).Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.