Repository navigation
Long sessions on PS5: what kept our MKW port alive past 40-87 min (ideas, measurements) #944
Replies: 5 comments
|
Thanks for the report. Bugs are followed in issues, where their log can be read: please open one with the bug report form (or the performance form for frame rate and slowdowns) and attach |
|
Sorry, our bot misread this as a bug report and closed it; it is reopened, and the bot no longer closes a discussion it takes for a bug report. Thank you for the detailed write-up and the numbers from a base PS5, and for crediting the texture-heap census. The large buffers built from 2 MiB pieces in one reserved range and the per-page byte table written by the generated code instead of page protection are both directly relevant to us: our page-protection write watch is a known cost, and the Knockout Tour failure you hit ("transient buffer of 4194304 bytes failed", free memory in 905 pieces) is fragmentation we have not solved. As you say, with your layer under GPL-3 we can take the ideas, not the code, and we will credit them in our research notes when we use them. Offer taken: when we have a change for long sessions, we will post it here for a run on your PS5. |
|
Thanks again for the write-up. Here is what we did with each idea, and the numbers behind it. 1. Large buffers from 2 MiB pieces. On PC the allocator (VMA) already gives requests larger than half a block their own memory, so the contiguous failures we had were staging buffers of one texture each (47-186 MB) on the Radeon 660M with 517 MiB free inside the allocator's blocks but no free range that large. Since 24/11 a texture is staged in groups of up to 8 MiB taken from a pool of 64 MiB blocks (73968b7): the same idea as yours, applied to the buffer that failed for us. To see fragmentation directly, the memory census ( With that, a 25-minute Grand Prix session on a Radeon 660M at a 4 GiB GPU memory cap no longer dies. What it showed instead was your fragmentation on the GPU side: at the second race's load the device-local memory held 10-170 MiB free in 426-913 ranges, none over 5.7 MiB, so render targets of 0.9-3.5 MB found no room and the scene went black under the HUD. So, taking your reserved range one step further: render targets now go first to a VRAM reserve of their own (32 MiB blocks kept for them, a sixteenth of the heap by default, 2. Software write watch. On Linux our write watch already takes no faults (userfaultfd in asynchronous write-protect mode, read with 3 and 4. The swap store. On PC the operating system pages out what is not used, so we have no equivalent to build. We also checked whether the copies of CPU-visible memory pools that we keep on the GPU on Linux grow with the session: they rise in the second race and then stay at about 680 MiB, and one that fails to allocate falls back to an import without harm. If you can run a long Grand Prix or Knockout Tour of current |
|
The long sessions with the render target reserve (your reserved-range idea applied to the targets), now in
We also counted how many textures share the same texels (to share one image between them): 14 MiB of 539 in a 4-player race, so we dropped that. If you run a long session of current |
|
v0.1.20 is out with the idea from here that we took: render targets get a VRAM reserve of their own (a sixteenth of the GPU's memory, none on heaps under 512 MiB), which ended the black scene at the second race of a Grand Prix on small GPUs. It is credited in |
Uh oh!
There was an error while loading. Please reload this page.
Before asking
Release
No response
Question
Hi! We are working on a separate PS5 port of mkw-recomp (same base, v0.1.13, game 1.8.0, base PS5) focused on multi-hour sessions without degradation and without lowering the original's quality. We built Pit Stop from source on our console to compare (thank you for the texture-heap census in fff608d, we adopted it, credited). Some things that may help with the Knockout Tour ending on fragmentation:
Large buffers from 2 MiB pieces. RADV buffers of 16 MiB or more that a single allocation cannot serve are built from 2 MiB direct-memory pieces mapped at fixed addresses inside one reserved range. We went from contiguous failures to 0 failed requests and a largest free hole of 200 MiB or more while racing.
Software write watch instead of page protection. The generated code marks one byte per 4 KiB page after every store (a byte table, cleared by exchange on query). No mprotect, no faults for tracking.
A lossless swap store for what does not compress, verified by hash, on the second internal drive or in system RAM: a small payload holds a shm_open object that the title maps (256 MiB re-read in 21.5 ms, stable over 30 min with the game running).
Texture-heap free blocks: besides packing them, we send the ones that do not compress to that store after 30 s.
Our numbers, at full texture quality. We never use BC1: every ASTC texture is re-encoded to BC7 only (no BC1, no size caps, no texture trimming), and we present at 2560x1440 (the game's docked render size), not 1080p. With that, on the same base PS5:
For comparison, in your log on our console about 684 textures were BC1 (425 MiB) and 376 BC7 (735 MiB), with 1080p output. Your BENCH = gp ran at 58.4-59.1 fps (faster than ours), and your BENCH = ko (our build of your source, LLVM 18 for RADV and our own libvpx, so it may differ from yours) ended at about 12 min with "transient buffer of 4194304 bytes failed", free memory split into 905 pieces.
Our PS5 layer is GPL-3 (it followed GPL references), so we are sharing ideas and numbers, not code, per your CONTRIBUTING rules. Happy to give more detail on any of them, and to test your changes on our base PS5.
exposed.ct.ws@gmail.com
All reactions