Conversation
The default mempool reserves ~2x device memory of virtual address space on first use, which cannot be satisfied in a 39-bit address space (riscv64 Sv39) and made the test flaky. Create a 2 MiB pool instead and set it before querying it, since the pool getters also create the default pool.
Contributor
Contributor
Author
|
/ok to test a8c7196 |
juenglin
marked this pull request as ready for review
October 2, 2026 21:53
Mirror the Cython change: create a 2 MiB pool and set it before querying it, so the test no longer creates the default pool and no longer needs the xfail_if_mempool_oom guard.
Contributor
Author
|
/ok to test 870ea5d |
Contributor
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
follow-on to #2381
test_interop_memPoolin thecuda_bindingsCython and Python tests used the device's default memory pool. Creating the default pool reserves virtual address space of roughly twice the installed device memory, and that reservation is not returned for the lifetime of the process. On address-space-constrained systems this can fail withCUDA_ERROR_OUT_OF_MEMORYeven when plenty of device memory is free, which is the failure mode described in #2381. It also follows the convention incuda_core/tests/AGENTS.md: tests that need a pool should create a capped one.This PR changes both tests to:
maxSize= 2 MiB) withcuMemPoolCreatecudaDeviceSetMemPoolcudaDeviceGetMemPooland assert it is the same handle, then pass it tocuDeviceSetMemPoolThe capped pool is set before it is queried because
cuDeviceGetMemPoolandcudaDeviceGetMemPoolalso create the default pool when no pool has been set. Running the test no longer grows the process virtual size (5 GiB before and after, measured locally on an RTX 6000 Ada).Both tests still check the driver/runtime handle round trip. The Python test no longer needs the
xfail_if_mempool_oomguard. The two*GetDefaultMemPoolcalls are no longer made in either test, socuda_bindingsno longer exercises them directly.Checklist