fix(shader): emit the fault record function without DontInline #7942
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7942"
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 boykopovar/AnyPS5. Originally posted by erm14254 on 2026-10-19T15:16:23Z.
What
NVIDIA driver 597.16 (RTX PRO 6000 Blackwell, Windows) crashes in its compiler at
nvgpucomp64.dll+0x28072a1while creating a compute pipeline of Code Violet. spirv-reduce, kept to that crash offset, leaves a selection steered by a ballot whose one arm callsrecord_bda_fault, aDontInlinefunction, and whose other arm holds another ballot. The reduced module and the full one compile once the function is declared without the control or withInline, so the function is emitted withoutDontInlineand the driver inlines or calls it as it sees fit. The otherDontInlinehelpers keep the control. The debt entry indocs/dev/debt/shader.mdand the NVIDIA note indocs/user/USAGE.mdrecord the finding; the test inagc_shader_memorynow expects the fault function without the control.Tested
On
main00d7e611e, whererecord_bda_faultis still declaredDontInline: Windows 11 (10.0.22631), RTX PRO 6000 Blackwell Workstation Edition, NVIDIA 597.16:agc_shader_memory,agc_driver_bda_device,agc_driver_bda_span_reads,agc_driver_guarded_null_pointer,agc_driver_image_table,agc_device_faultandagc_formatted_buffer_oncepass.Before the rebase, on
d92a8dad3with the same GPU and driver, the reduced module and the full compute module compile throughagc_compute_pipeline_replaywith this, and Code Violet (PPSA26528) no longer stops innvgpucomp64.dll; on Linux, lavapipe, the same seven tests pass. Plainmain0615cd2b8still stopped atnvgpucomp64.dll+0x28072a1on 2026-10-16 (#6257). The title has not been run on the rebased branch yet; I'll add that result in a comment.The reduced SPIR-V module is attached below.
pr4-reduced-module.zip
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by erm14254 on 2026-10-19T15:52:45Z.
Manual overlap review for the list above, against each pull request's current head. None of them changes the lines this PR changes.
main, the shared-file changes of #1341, #5021, #6171, #6612, #6645, #6679, #6788, #6946, #6947, #6977, #7332, #7395, #7417, #7484, #7800 and #7922 merge cleanly with this PR.mainin the others; #5426, #5500, #5925, #5941, #6009, #6177, #6280, #6290, #6604, #6683, #7085 and #7223 conflict withmainin all of them. Where a PR conflicts withmain, its hunks still neither change nor border this PR's lines.SpirvBdaFault.cpp: it adds the faulted-flag helpers afterReturnBdaFailureIfand a branch inStopBdaInvocationIf, about 70 lines below therecord_bda_faultdeclaration this PR changes, and leaves that declaration alone.No overlap, no
Depends on.Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T18:23:59Z.
First AMD-on-Linux (RADV) run of this PR. Merged onto
main8d5d4df96(clean merge), built in full and compared with the samemain, on the same machine.AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.
Full suite (
ANYPS5_REQUIRE_VULKAN=1 ctest -j8) at6474695df: 1638/1640 with this PR, against 1638/1640 onmain. The two failures are the same on both, so this PR adds none:agc_driver_image_table_vouched_lookups(#7766, fixed by #7916) andagc_driver_guest_memory_lifetime(#7784).Comparing the JUnit output with
main: this PR adds no ctest entry, and none is skipped or removed.This checks correctness only; I did not measure performance.
GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T22:08:17Z.
@erm14254
DontInlineonrecord_bda_faultcame fromf7d4fbab9(#1043) as a pipeline-creation fix: with the fault recording copied into every read site, one compute program reached about a million SPIR-V words and ~95 s invkCreateComputePipelines(PPSA26344's ~835k-word variants took 45 s each). Without the hint the module stays small, but any driver may now inline the function at every call site, which is the cost that change was avoiding. The change also applies to every driver, not only 597.16. Could you add thevkCreateComputePipelinestime of a large BDA program before and after (for example throughagc_compute_pipeline_replay) on NVIDIA and on AMD, or limit the change to the driver that crashes, as the other driver workarounds do?Pull request closed