Repository navigation
DXC: the loaded compiler's version in the log, the report and xcl run's checks; 1.8 or newer recommended - #223
Merged
Merged
Conversation
…ong SDKs first Nobody running XCL could tell which dxcompiler.dll it had loaded, and it matters: with DXC 1.7.2308 (what Windows SDK 10.0.26100.4654 installs; other revisions of that SDK have 1.8.2502) the DXIL of translated compute programs was 2-2.7 times the size of DXC 1.9.2602's and an NVIDIA driver took 1.4-2.2 times as long to build pipelines from it (ivall#156); 1.7 also rejects [WaveSize] on library entries (ivall#174). - dxc.rs: after loading, dxcompiler.dll and dxil.dll are asked for IDxcVersionInfo and IDxcVersionInfo2 (commit), and their version resources are read. One info line with versions and folder; below 1.8 one warning with the measured cost and XCL_DXC_DIR. The release number is taken from the file: IDxcVersionInfo gives the DXIL version the library knows, and release 1.8.2505 answers 1.9. - report.json: `dxc` (folder, both libraries). Filled by the game process when it compiled something, else by the launcher from its checks. - xcl run's checks print the version, and a note with the fix when it is below 1.8. - Windows SDK folders are tried in the order of their DXC's version, then of the SDK's, compared as numbers (old SDKs' compilers carry their Windows build number and go last). XCL_DXC_DIR and the folder of xcl.exe come first as before. - README: DXC 1.8 or newer is recommended, and where to get it. Co-Authored-By: Claude <noreply@anthropic.com>
Owner
|
Merged (main d4f17ca). Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nobody running XCL can tell which
dxcompiler.dllit loaded, and it turns out to matter. With DXC 1.7.2308, the DXIL of translated compute programs was 2–2.7× the size of DXC 1.9.2602's, and the NVIDIA driver then took 1.4–2.2× as long to build the pipelines (#156, RTX 5070 Ti, synthetic programs). 1.7 also rejects[WaveSize]on library entries, which is what #174's linked path needs (review there).Which DXC a Windows SDK gives is not fixed by its folder name:
Windows Kits\10\bin\10.0.26100.0\x64holds 1.7.2308.16 on my PC (SDK 10.0.26100.4654) and 1.8.2502.11 on ryosen0's (#174). So the only way to know is to ask the file.This PR makes the loaded DXC visible and points users at 1.8 or newer. It bundles nothing, downloads nothing, and compiles exactly as before.
On #156 ivall wrote: "Kalmarv's finding that the DXC build changes NVIDIA's driver time a lot is worth a line in the README once confirmed". This PR has that line. It does not have the confirmation: the figures are still the one measurement on one card. What it adds is the means to get one, since every log and
report.jsonnow says which DXC was used.What changes
dxc.rs,preflight.rs,report.rs,launcher.rs, README: +306/−10, about 90 of them tests.DXC: dxcompiler 1.7.2308.16 (52da17e2), dxil 1.7 (file 101.7.2308.24), from C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64. Below 1.8, one warning with the measured cost and what to do (XCL_DXC_DIR).xcl run's checks print the version (DXC 1.7.2308.16 (52da17e2): <folder>), and below 1.8 aNOTEwith the fix. A note, not a warning: the game runs, its pipelines only take longer.report.jsongetsdxc: the folder, and fordxcompiler.dllanddxil.dllthe file version,IDxcVersionInfo's major/minor and the commit (IDxcVersionInfo2).#[serde(default)]; empty when no DXC was loaded. The game process fills it once it has compiled something; if it never did, the launcher fills it from its own checks.XCL_DXC_DIR, then the folder ofxcl.exe, as before. After that the Windows SDK folders were tried in reverse order of their names; now in order of the DXC version in them, then of the SDK version, both compared as numbers. On my PC this picks the same folder as before (10.0.26100.0). It differs when a name would mis-sort (10.0.100000.0sorts below10.0.26100.0as text) or when an older SDK folder holds a newer DXC. Nothing is loaded to find out: the version is read from the file's version resource.XCL_DXC_DIR, and why. It says a Windows SDK may hold an older one, not that it does.IDxcVersionInfois not the release numberGetVersionis the newest DXIL version the library knows: the 1.8.2505 release answers 1.9. So the release is taken from the file's version resource (1.8.2505.32), andIDxcVersionInfois the fallback for files that don't carry a DXC number (SDK 10.0.19041'sdxcompiler.dllsays10.0.19041.5609and answers 1.5; an SDK'sdxil.dllsays101.7.2308.24). Both are in the log line and the report.What the five compilers on my PC say:
GetVersion#174 and #214
#174 does not look at the DXC version: it tries to link and falls back to the whole program on any failure, logging the first. This PR does not touch that path (it is not on
main), so nothing is duplicated.dxc::toolchain().outdated()is there if #174 wants to skip linking below 1.8 instead of failing once per program. The two merge without conflict (git merge-treeof this head with #174's328cf29).#214 (PSO compile concurrency) also edits
dxc.rs, in one place: the compile pool andcompile(around line 203 of its base). This PR's changes are above that (the folder search, the version query,load) and don't touch the pool.git merge-treeof this head with #214'sbf2a27ereports no conflict in any file.Tested
Windows 11 (10.0.26200), Ryzen 9 9950X, RTX 5070 Ti, Rust MSVC debug. Head
247d909, one commit onmain6da33fa, so the head was the merge result when tested.mainhas since moved toaf20b4b(2 commits, none in the five files here;git merge-treereports no conflict); nothing was re-run on that.main6da33fa247d909cargo test -p xcl --lib -- version_tests preflight::cargo test -p xcl --lib -- gpu::recomp::dxc:: preflight:: report:: launcher::(no GPU needed)cargo test -p xcl --lib, 4 runs each, alternatingversions_parse_and_compare_as_numbers,the_sdk_with_the_newest_dxc_is_tried_first: parsing, and the order of eight made-up SDK folders, including the mis-sorting name, a newer DXC in an older SDK, and a Windows-numbered compiler.dxc_below_1_8_is_outdated: the verdict and the printed form for the compilers in the table as they answer, and for libraries that say nothing.the_loaded_dxc_is_identified: loads this PC's DXC and checks the folder,IDxcVersionInfo, the file version, the verdict, that the value goes into aReport, and that a report without the field still reads. PrintsSKIPPED … no DXCwithout one; not ignored. Run against each compiler in the table (atbb51c80, the same code before the rebase): the 10.0.26100 one by the default search, the others throughXCL_DXC_DIR. A folder inXCL_DXC_DIRwithout DXC falls through to the SDK as before.an_old_dxc_is_a_note_with_a_fix(preflight): 1.7 gives the note withXCL_DXC_DIRin the fix, 1.8 gives nothing.GetVersioninstead of the release, threshold 1.7, folders ordered by name, Windows-numbered compilers not last, the loaded version not recorded, no preflight note, the report field without its default.cargo build -p xcladds no warning.Not tested
[WaveSize]on library entries; the size gain is measured for 1.9 only.GetVersionanswer are not in the table.xcl runwith a game: the launcher fillingdxcwhen the game compiled nothing (4 lines) has no test, and the console lines were read from the unit tests, not from a run.Program Filespaths, as before; no registry lookup. XCL still doesn't fetch or ship DXC.main, and I did not find out why.main's own test binary died with0xC0000005in 1 of 4 runs at6da33fa; this branch's did not in 4 at247d909, but did in 1 of 2 atbb51c80(the same change oneaa36b6), so a pass here is not proof that the suite is clean. Separately,hle::kernelx::tests::xmem_and_physical_page_overflows_fail_cleanlyfails onmainin 3 of 15 runs of--lib hle::kernelxat6da33fa(6 of 15 ateaa36b6; last error 203 where 8 is expected). Neither is touched by this PR.AI use: Claude Code, Claude Fable 5.2. No game data.