libSceGnmDriver: inFAMOUS Second Son (CUSA00223) stops at load on 47 imports that only libSceGnmDriverForNeoMode exports #17581
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 adam25136 on 2026-11-08T23:44:03Z.
What happens
A PS4 title stops at load with
FAIL: unresolved ELF importfor 47 of itslibSceGnmDriverimports (GetLastError: 127, exit0xC0000139), which AnyPS5 exports only fromlibSceGnmDriverForNeoMode.prx(30 implemented there, 17 throwing stubs), a library the title does not load.Title, test or build step
inFAMOUS Second Son, CUSA00223 01.07 (the US 01.00 dump with the 01.07 update merged in):
eboot.binplus the bundledsce_module/libc.prxandsce_module/libSceFios2.prx. Bring-up thread: #8214.AnyPS5 commit
main22ae9a397d+ #17564 (which changes onlytools/import_audit.py, its test anddocs/user/USAGE.md). Up tomainb5a9a4781c, nothing since has changed the GNM libraries, the relinker,libkernel_sys/Export.Discovery.cpportools/unwrap_self.py.System
Windows 10 Pro 22H2 (19045), i9-12900KF, NVIDIA GeForce RTX 5080, driver 621.14, WinLibs GCC 15.2.0 r7, Release
Steps to reproduce
tools/unwrap_self.pystops on this eboot withsegment 5 does not fit the file(segment 5 isPT_INTERP, at file offset0x4000, the start ofPT_LOAD0). All three files were unwrapped with the change at the end of this issue, which places a non-LOAD header that no SELF record covers inside the placed header whose file range holds it. That is a separate problem, not part of this issue.The relinker reports 908 references and 2 converted modules (
run/app0/sce_module/libc.prx.guest.prxandlibSceFios2.prx.guest.prx). Putbuild/core/libs/libs/*.prxand the three MinGW DLLs inrun/libs/; no other game files are needed to reach the stop. Startrun/app.exewith noAPS5_*orANYPS5_*variable set: it stops after 0.2 s.Log
stderr of the run (83 lines; paths shortened to the run folder)
What was checked
libSceGnmDriver/Export.cppdefines 45 functions andlibSceGnmDriverForNeoMode/Export.cpp139 (111 implemented, 28 throwing stubs); none is in both. The PS5 3.20 export table thatdocs/dev/debt/libSceGnmDriverForNeoMode.mdcites lists the same 163 names forlibSceGnmDriverandlibSceGnmDriverForNeoMode. AnyPS5'slibSceGnmDriverhas 45 of them and itslibSceGnmDriverForNeoModethe other 118. That debt file notes that the normal provider also exports 20 unnamed NIDs oflibSceGnmDriverForNeoMode, and that future implementations there "require loader analysis".libSceGnmDriverin its SCE tables, and none nameslibSceGnmDriverForNeoMode. 38 resolve inlibSceGnmDriver(14 of them throwing stubs,sceGnmMapComputeQueueandsceGnmDingDongamong them); the other 47 only inlibSceGnmDriverForNeoMode. The converted program listslibSceGnmDriver.prxbut notlibSceGnmDriverForNeoMode.prx, and the entry stub searches only the libraries it lists (Searched librariesin the log). The same 47 NIDs are in Andretuta's bring-up thread #8214 and in DealPotato's list on #6977, both from beforelibSceGnmDriverForNeoModehad them. Earlier runs here onmain676fb61acc, and on105c9e4d91with #17140, stopped on the same 47.libSceGnmDriverForNeoModealways writes the Pro (Neo) form: its debt note says its command writers follow shadPS4's Neo-mode path (draw initiators keep flag bits 29 to 31;sceGnmSetVgtControlandsceGnmResetVgtControlwriteIA_MULTI_VGT_PARAMthroughSET_UCONFIG_REG), and that its 350 and 400 default states are shadPS4's Neo sequences. In shadPS4a808e76, 13 of the 47 choose their packets withsceKernelIsNeoMode(): the 9 draws, the two VGT calls,sceGnmDrawInitDefaultHardwareState350andsceGnmDrawInitToDefaultContextState400. So doessceGnmDispatchInitDefaultHardwareState, which this title takes from AnyPS5'slibSceGnmDriver, where it always writes the normal form. Since #12427,sceKernelIsNeoModeanswers fromparam.sfo; this title'sATTRIBUTEis0x20800002, so it would answer 1 (read from the code; not called in this run).libSceGnmDriverForNeoModehad them. With these and other local fixes, their copy of the title (CUSA00004) loaded, submitted graphics and compute work, and stopped at a GCN image instruction.libSceGnmDriverForNeoMode, #17393, #17395 and #17396 add tests for it, #16882 changeslibSceGnmDriver, and the #6977 integration draft also carrieslibSceGnmDriver. None moves functions between them. #16238 makes "the submits and the queue map" return refusal codes, because "nothing onmainconsumes a GNM command buffer"; the workload submits andsceGnmMapComputeQueueWithPriorityare among the 47, whilelibSceGnmDriver's submits have gone to the AGC driver since #9432.Question for the maintainers: which of these would you take, if any?
libSceGnmDriverexports the 47 too: calls whose packets don't depend on the mode calllibSceGnmDriverForNeoMode's code, and the 13 pick the normal or Neo form withsceKernelIsNeoMode(), as shadPS4 does.libSceGnmDriverForNeoMode.prxwhen a title needslibSceGnmDriver.prx, asReadLibrariesaddslibc.prxforlibSceLibcInternal.prx.ReadLibrariesis Windows-only, so Linux and macOS would need the same rule, and the title would then get the normal form fromsceGnmDispatchInitDefaultHardwareStateand the Neo form from the 13 of the 47 that depend on the mode.sceKernelIsNeoMode(). This moves code that #16238 and #16360 change and that #17393, #17395 and #17396 test.And for a title for which
sceKernelIsNeoModeanswers 1, shouldlibSceGnmDriver's ownsceGnmDispatchInitDefaultHardwareStatewrite the Neo form too?None of the three was tried, and the title was not run past the load stop. Not checked on Linux.
The 47 imports
libSceGnmDriverForNeoModeihxrbsoSKWcsceGnmBeginWorkload5udAm+6boVgsceGnmCreateWorkloadStream0BzLGljcwBosceGnmDispatchDirectZ43vKp5k7r0sceGnmDispatchIndirectwED4ZXCFJT0sceGnmDispatchIndirectOnMecHlTPoZ-oY7YsceGnmDrawIndexGGsn7jMTxw4sceGnmDrawIndexAutoED9-Fjr8Ta4sceGnmDrawIndexIndirectthbPcG7E7qksceGnmDrawIndexIndirectCountMulti5q95ravnuegsceGnmDrawIndexIndirectMultioYM+YzfCm2YsceGnmDrawIndexOffset4v+otIIdjqgsceGnmDrawIndirectcUCo8OvArrwsceGnmDrawIndirectCountMultif5QQLp9rzGksceGnmDrawIndirectMultiyb2cRhagD1IsceGnmDrawInitDefaultHardwareState350im2ZuItabu4sceGnmDrawInitToDefaultContextState400R6z1xM3pW-wsceGnmDriverTraceInProgressFa3x75OOLRAsceGnmEndWorkloadFFVZcCu3zWUsceGnmGetOffChipTessellationBufferSizeNfvOrNzy6sksceGnmInsertDingDongMarkerMYRtYhojKdAsceGnmResetVgtControlKx-h-nWQJ8AsceGnmSetCsShaderWithModifierX9Omw9dwv5MsceGnmSetEmbeddedPsShader+AFvOEXrKJksceGnmSetEmbeddedVsShader5uFKckiJYRMsceGnmSetPsShader350cFCp0NX8wf0sceGnmSetVgtControlnLM2i2+65hAsceGnmUpdateGsShaderGNlx+y7xPdEsceGnmUpdateHsShadermLVL7N7BVBgsceGnmUpdatePsShader350V31V01UiScYsceGnmUpdateVsShaderUtObDRQiGbssceGnmDestroyWorkloadStreambyXlqupd8cEsceGnmDingDongForWorkloadjHdPvIzlpKcsceGnmDrawIndexMultiInstancedstDSYW2SBVMsceGnmDrawOpaqueAutooL4hGI1PMpwsceGnmGetGpuBlockStatustZCSL5ulnB4sceGnmGetGpuInfoStatusiFirFzgYsvwsceGnmGetLastWaitedAddressKnldROUkWJYsceGnmGetNumTcaUnitsfzJdEihTFV4sceGnmGetProtectionFaultTimeStampnEyFbYUloIMsceGnmGetShaderProgramBaseAddressk7iGTvDQPLQsceGnmGetShaderStatusURDgJcXhQOssceGnmInsertThreadTraceMarkerA+uGq+3KFtQsceGnmMapComputeQueueWithPriority6YRHhh5mHCssceGnmRequestFlipAndSubmitDoneForWorkloadXiyzNZ9J4nQsceGnmSetWaveLimitMultipliersGa6r7H6Y0RIsceGnmSubmitAndFlipCommandBuffersForWorkloadjRcI8VcgTz4sceGnmSubmitCommandBuffersForWorkloadThe local change to
tools/unwrap_self.pyused for the unwrapAI-assisted: yes. Claude Code unwrapped and converted the title, ran it and the import audits, read the code and drafted this issue; separate review agents checked it, and another argued against it.