Repository navigation
feat(agc): report device losses with VK_EXT_device_fault and dispatch checkpoints - #5453
Conversation
|
Tested on Windows x86_64, which this PR hasn't run yet: Windows 11 Pro 26200, MinGW-w64 GCC 15.2.0 (WinLibs UCRT r7), Release, NVIDIA RTX 4070 (driver 596.21), head The test doesn't link on Windows: target_link_libraries(agc_device_fault_tests PRIVATE libc libkernel)
...
add_test(NAME agc_device_fault COMMAND agc_device_fault_tests)
if(WIN32)
set_tests_properties(agc_device_fault PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()With that change, What the fault info gives on real device losses. Demon's Souls (PPSA01341), RTX 4070, on a local branch (not The description was empty and no vendor entries came back. The address was a data write ( One design point: I closed my #5460 (the same report, fewer call sites) in favour of this one. AI-assisted: yes |
|
Two things before this can go in:
|
… checkpoints A device that supports VK_EXT_device_fault reports, on the first VK_ERROR_DEVICE_LOST a check sees, the fault description, the faulting addresses (invalid reads and writes, or the instruction pointers of waves still running when the device hung) and the vendor fault codes. APS5_GPU_CHECKPOINTS=1 records a VK_NV_device_diagnostic_checkpoints marker with the program address before each guest dispatch and prints the last markers the GPU reached, which names the dispatch that hung. Without either extension nothing changes. Test: agc_device_fault drives the report through mock vkGetDeviceFaultInfoEXT and vkGetQueueCheckpointDataNV entry points. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: overlordxrz-source <overlordxrz-source@users.noreply.github.com>
|
Rebased onto current
Built and ran the scoped tests (libSceAgcDriver, libkernel, relinker): |
ab47810 to
1402c6c
Compare
What
Port of @MichonGoddijn231849's
011e7c70from hisgta-v/testingbranch, with him as the commit author. He okayed this port in #1203: "mainhas no device-loss reporting yet. On NVIDIA the fault info mostly gives instruction pointers it can't map to a shader, so the checkpoints are the useful part: which dispatch or draw was last started and which had finished."VK_EXT_device_faultand itsdeviceFaultfeature, the driver enables the extension. The firstVK_ERROR_DEVICE_LOSTthatGraphics::Checkor the device's ownchecksees then prints the fault description, each faulting address with its kind and precision, and the vendor fault codes as[device-fault]lines. The vendor binary is not requested.APS5_GPU_CHECKPOINTS=1, on a device withVK_NV_device_diagnostic_checkpoints, records a checkpoint with the program address before each compute dispatch. The report then lists the last checkpoints the GPU reached, which names the dispatch that hung.Port notes against Michon's commit (the hunks no longer applied after #639):
VulkanDevice::State, sincerecordDispatchis a member now. The device-lost hook is astd::functionthat captures the device, the queue and the two entry points.~Stateclears it.check(present path) reports a loss too.Execution/include/DeviceFault.hppso it can be tested. It bounds unterminated driver descriptions and the counts the second query returns.APS5_GPU_CHECKPOINTSis documented indocs/dev/BUILD.md.Why: Michon used this to diagnose the GPU hang in GTA V's ray tracing modes (#1203, open issue A). A device loss on
maintoday only throwsVulkan result -4, with nothing about where it happened.New test
agc_device_fault(tests/DeviceFault.cpp) drives the report through mockvkGetDeviceFaultInfoEXTandvkGetQueueCheckpointDataNV. It covers:Tested
agc_device_faultpasses.VulkanDevice.cpp,Resources.cpp(throughContext.hpp) and the test compile for x86_64-linux-gnu and x86_64-windows-gnu. The test also links for x86_64-linux-gnu (not run, the host is aarch64).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)