Skip to content

test(agc): lift the host import budget in the sparse dma-buf import test - #6261

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
EdouardSence:fix/sparse-import-test-budget
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
EdouardSence:fix/sparse-import-test-budget

Conversation

@EdouardSence

Copy link
Copy Markdown
Contributor

What

agc_host_import_sparse fails on main on a Linux host where /dev/udmabuf is writable and udmabuf.size_limit_mb is raised to 8192, the setting the host import path needs for large titles:

[gpu] host import budget: 8257 MiB live of 15614 MiB (APS5_HOST_IMPORT_MIB); 1 imports (8257 MiB) refused so far, last 0x7f1b0c8d0000+0x204100000
FAIL: a failure at UDMABUF_CREATE after the sparse path was chosen did not throw (got "")
FAIL: a failure at vkQueueBindSparse after the sparse path was chosen did not throw (got "")
2 sparse dma-buf import checks failed

Why it fails:

  • The test sizes each range from udmabuf's limit (RangeBytes() gives limit + 65 MiB = 8257 MiB here), and the range from ImportsALargeRangeAsOneSparseBuffer stays live.
  • The default budget is the smaller of half the physical memory and the host heap minus 2 GiB. That is 15614 MiB on this 32 GB machine, which refuses the next 8257 MiB import.
  • HostImportFor then returns nullptr before the sparse decision, so the failure cases never reach the step they test.
  • With the default size_limit_mb of 64 every range is 129 MiB and the test passes. Hosts without /dev/udmabuf access skip it, which is likely why nobody reported it.

The fix is one line: the test lifts the budget with SetHostImportBudget, as BdaResources already does. The budget is not what this test checks.

#5390 edits other functions in this file and adds one more live import in UnalignedOffsetStartsAtTheBlockBelow, so on the same host it hits this too. The hunks don't overlap.

Tested

Based on main db81992. CachyOS Linux 7.2.9, GCC, RX 9070 XT (RADV Mesa 26.2.4), 32 GB RAM, udmabuf.size_limit_mb=8192, /dev/udmabuf writable:

  • On main, agc_host_import_sparse fails as shown above. It fails the same way on a050f856f, and passes there with APS5_HOST_IMPORT_MIB=40000.
  • With this commit, it passes (host import sparse dma-buf tests passed).

Not tested: other RAM sizes or the default size_limit_mb, which needs root to change.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (test only)
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.4, CachyOS Linux 7.2.9
  • AI-assisted: yes

Tested and written by Claude (AI assistant) on a contributor's machine.

The test imports ranges just above udmabuf's size limit and keeps the first
one live. With size_limit_mb=8192 each range is 8257 MiB, so on a host with
32 GB of RAM the default budget (half the physical memory) refuses the second
import and HostImportFor returns nullptr instead of reaching the sparse path:
"a failure at UDMABUF_CREATE after the sparse path was chosen did not throw".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5390 core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp
PR 6222 core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp

@oneandonlydean
oneandonlydean merged commit 07e7414 into boykopovar:main Oct 17, 2026
9 checks passed
@EdouardSence
EdouardSence deleted the fix/sparse-import-test-budget branch October 17, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants