GPU: pin internal GPU helper threads to fastest CPU core class #3303
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3303"
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 Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-26T16:32:02Z.
Summary
Pins VIctory's internal GPU helper threads (such as
texture-refreshparallel upload/refresh workers) onto the highest-efficiency CPU core class on hybrid processors usingGetSystemCpuSetInformationandSetThreadSelectedCpuSets(VICTORY_FAST_CORES=0to disable,1for critical threads only,2default including helpers).Root Cause
On hybrid-architecture CPUs (such as Intel P-core/E-core processors and asymmetric multi-CCD systems), Windows can schedule frame-critical GPU helper threads onto slower efficiency cores, adding frame-time variance during texture uploads and refreshes.
Changes
crates/victory-gpu/src/cores.rs:cpu_sets(),fast_of(),keep_on_fast_cores(), andkeep_helper_on_fast_cores()(adapted from fxceless/victory-forkframelog.rs, GPL-3.0-or-later).the_fast_cores_are_those_of_the_best_class_if_there_is_a_worse_one.crates/victory-gpu/src/lib.rs:#[cfg(windows)] mod cores;.crates/victory-gpu/src/texture.rs:crate::cores::keep_helper_on_fast_cores("texture-refresh")onin_parallelworker threads.Testing & Verification
the_fast_cores_are_those_of_the_best_class_if_there_is_a_worse_oneincrates/victory-gpu/src/cores.rs.VICTORY_FAST_CORES.No game files used.
AI-assisted: yes (Gemini 4 Neon)
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T16:48:24Z.
Review: COMMENTED
Reviewed the diff and ran local verification on Windows 11 x64:
cargo test -p victory-gpu --lib cores:: -- --test-threads=1: 1 passed, 0 failed.cargo test -p victory-gpu --lib texture:: -- --test-threads=1: 2 passed, 0 failed.cargo xtask policy: 192 files ok.cargo clippy -p victory-gpu --all-targets -- -D warnings: failed with adead_codeerror:crates/victory-gpu/src/cores.rs:79:15:error: function keep_on_fast_cores is never usedRemoving the unused
keep_on_fast_coresfunction (or wiring it up to its intended caller) will make clippy pass.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:48:41Z.
Windows 11,
63bcca4+ this PR — CI's own clippy command fails, and the reason looks structural rather than cosmetic:cargo clippy --workspace --all-targets --locked -- -D warnings: fails (exit 101)--all-features: failscargo test -p victory-gpu --lib: passes (232 passed / 0 failed / 1 ignored), because undercfg(test)the function is used bycores::tests(cores.rs:132).gh pr checks 3303agrees: thecheckjob failed (run 45859654443).The tree has exactly one caller of
keep_on_fast_cores: the test. Production callskeep_helper_on_fast_coresfromtexture.rs:572. So the stage-1 call sites — "the threads a frame waits for one by one", which the doc comment describes — are missing from this PR. Either add them, or#[cfg(test)]/#[expect(dead_code)]the helper so the build gate passes.Synthetic only. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T23:55:04Z.
NVIDIA full-suite run, to go with the reports above by Dukestar69, Jackster, since none of them names a GPU run. Tested exact head
42879b2(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.the_fast_cores_are_those_of_the_best_class_if_there_is_a_worse_one.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-27T04:02:06Z.
@Jackster Thanks for catching the
cargo clippydead-code error onkeep_on_fast_cores— added#[allow(dead_code)]on it soclippy --workspace --all-targets -- -D warnings(with and without--all-features) passes while keeping the helper available.@futurepro62 Thank you for the detailed RTX 5070 Ti full-suite test report!
@Marvisak Please review and merge this PR once CI is green. Testers on untested GPU models (e.g., AMD/Intel) and multi-CCX/hybrid CPU setups are welcome to test.
AI-assisted: yes (Gemini 4 Neon)
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.